An AI-powered Windows system analysis assistant that combines Google Gemini, deterministic system diagnostics, natural-language command routing, controlled Windows tools, and a risk-based safety layer.
System Analysis Chatbot is a local AI-powered desktop assistant designed to help users inspect and interact with their Windows system through natural-language commands.
The project combines:
- π€ Google Gemini for conversational AI and system explanation
- π§ Intent-based command routing
- π₯οΈ Windows system analysis
- π¦ Installed software discovery
- βοΈ Process analysis
- π Startup application analysis
- πΎ Large-file and storage analysis
- π₯ Controlled software installation and verification
- π Risk-based safety and approval
- π‘οΈ Allowlisted Windows application launching
- π§ͺ Automated testing
The project intentionally separates AI reasoning from system execution.
Instead of allowing an LLM to directly execute arbitrary operating-system commands, requests pass through a controlled execution pipeline.
ββββββββββββββββββββββββ
β User Input β
β Natural Language β
ββββββββββββ¬ββββββββββββ
β
βΌ
ββββββββββββββββββββββββ
β Command Router β
β β
β Intent + Confidence β
ββββββββββββ¬ββββββββββββ
β
βΌ
ββββββββββββββββββββββββ
β Safety / Approval β
β β
β Risk Classification β
ββββββββββββ¬ββββββββββββ
β
βΌ
ββββββββββββββββββββββββ
β Tool Executor β
β β
β Controlled Dispatch β
ββββββββββββ¬ββββββββββββ
β
ββββββββββββββββββΌβββββββββββββββββ
β β β
βΌ βΌ βΌ
βββββββββββββββ βββββββββββββββ βββββββββββββββ
β Software β β System β β Windows β
β Tools β β Analysis β β Actions β
β β β β β β
β Scan β β Processes β β Open URL β
β Install β β Startup β β Launch App β
β Verify β β Storage β β β
ββββββββ¬βββββββ ββββββββ¬βββββββ ββββββββ¬βββββββ
β β β
ββββββββββββββββββΌβββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββ
β Structured Results β
ββββββββββββ¬ββββββββββββ
β
βΌ
ββββββββββββββββββββββββ
β Gemini Analysis β
β & Human Explanation β
ββββββββββββββββββββββββ
AI interprets what the user wants. Deterministic tools determine what is actually happening.
This separation makes the system easier to test, extend, and control.
The application combines deterministic system measurements with Gemini-powered reasoning.
Gemini can explain findings related to:
- CPU health
- Memory utilization
- Storage conditions
- Installed software
- Software-health findings
- Overall system-health observations
The AI is not treated as the source of truth for raw system measurements.
Instead:
System Metrics
β
Deterministic Analysis
β
Structured Findings
β
Gemini
β
Human-readable Explanation
This reduces the possibility of the model inventing system facts.
User commands are converted into structured intents before reaching system tools.
| Intent | Purpose |
|---|---|
SYSTEM_INFO |
Retrieve system information |
SOFTWARE_SCAN |
Scan installed software |
PROCESS_ANALYSIS |
Analyze running processes |
STARTUP_ANALYSIS |
Analyze Windows startup applications |
STORAGE_ANALYSIS |
Find large files |
SOFTWARE_INSTALL |
Install supported software |
OPEN_URL |
Open a URL |
LAUNCH_APPLICATION |
Launch an approved Windows application |
CHAT |
Normal conversational interaction |
UNKNOWN |
Unrecognized command |
"show running processes"
β
βΌ
Command Router
β
βΌ
PROCESS_ANALYSIS
β
βΌ
Process Analyzer
β
βΌ
Structured Result
The router therefore keeps intent recognition separate from execution.
The current implementation is focused specifically on Windows.
Windows-specific APIs and system interfaces are used where appropriate, while the higher-level architecture remains modular enough to support additional platforms later.
Installed Windows software can be discovered using:
- Windows AppX packages
- Windows Registry
- Win32 application registry entries
- 32-bit registry entries
Collected information can include:
- Application name
- Version
- Publisher
- Installation location
- Installation metadata
The software-health layer can identify:
- Missing installation paths
- Missing versions
- Missing publishers
- Duplicate application names
- Large installed applications
The process analyzer uses psutil to inspect running Windows processes.
It can analyze:
- CPU usage
- Memory usage
- Process count
- Process status
- Process ownership
show running processes
what is using my cpu
show top memory processes
The analyzer produces structured results that can then be displayed or passed into the AI explanation layer.
The startup analyzer inspects Windows Registry startup locations.
Currently checked locations include:
HKCU
HKLM
HKLM 32-bit
startup apps
show startup programs
what starts with Windows
Returned information includes:
- Application name
- Startup command
- Registry source
The storage analyzer searches the Windows filesystem for large files.
It supports:
- Configurable traversal depth
- Configurable result limits
- File-size sorting
- Permission-error handling
- Missing-file handling
- Windows system-directory exclusions
show largest files
find large files
what is using my storage
Results include:
- File name
- Full path
- Size in MB
- Size in GB
The project includes a controlled software installation pipeline.
User Request
β
βΌ
Command Router
β
βΌ
Safety Layer
β
βΌ
User Approval
β
βΌ
Download
β
βΌ
Windows Installer
β
βΌ
Installation Verification
β
βΌ
Confirmed Result
A completed installer process alone is not considered sufficient evidence of successful installation.
After installation, the application performs a verification step to determine whether the software is actually detected on the system.
Every executable system action is associated with a risk level.
| Action | Risk | Confirmation |
|---|---|---|
| System information | π’ Low | No |
| Software scan | π’ Low | No |
| Process analysis | π’ Low | No |
| Startup analysis | π’ Low | No |
| Storage analysis | π’ Low | No |
| Open URL | π’ Low | No |
| Launch application | π‘ Medium | Yes |
| Software installation | π΄ High | Yes |
| Unknown action | π΄ High | Yes |
The safety layer is implemented independently from the Streamlit UI.
This means an action cannot simply bypass the normal safety policy by reaching an underlying tool through the standard execution pipeline.
The project does not allow arbitrary application strings to be passed directly to a shell.
Currently supported applications include:
notepad
calculator
calc
Application launching uses:
subprocess.Popen(
["notepad.exe"],
shell=False
)rather than unrestricted shell execution.
This provides an additional protection layer against arbitrary command execution.
URLs can be opened through a dedicated tool:
open https://example.com
URL handling is separated from application launching and follows its own execution path.
The system uses a registry and executor pattern for system capabilities.
User Command
β
βΌ
Command Router
β
βΌ
Structured Intent
β
βΌ
Tool Registry
β
βΌ
Safety Policy
β
βΌ
Tool Executor
β
βΌ
Controlled Function
β
βΌ
Structured Result
This architecture allows new system capabilities to be added without turning the chatbot into an unrestricted command shell.
Converts natural-language commands into structured RoutedCommand objects.
Example:
RoutedCommand(
intent=CommandIntent.PROCESS_ANALYSIS,
command="show running processes",
confidence=0.90
)The router determines:
- User intent
- Original command
- Confidence score
- Whether confirmation may be required
Maintains the controlled mapping between command intents and executable tools.
Conceptually:
Intent
β
Tool Registry
β
Approved Function
This prevents arbitrary user input from being directly mapped to arbitrary Python functions.
Responsible for controlled tool execution.
The executor:
- Receives a routed command
- Resolves the associated tool
- Retrieves its safety policy
- Determines whether confirmation is required
- Executes the tool if permitted
- Returns a structured result
- Handles execution errors
Centralizes risk classification and approval policies.
Unknown actions use a restrictive policy that requires confirmation.
This keeps security decisions independent from the UI.
Provides deterministic system-health calculations and Gemini-based diagnosis.
The deterministic layer establishes the actual system measurements.
Gemini is then used to explain those findings.
Contains controlled Windows actions such as:
- Opening URLs
- Launching allowlisted applications
Platform checks prevent these actions from executing on unsupported operating systems.
System_Analysis_Chatbot/
β
βββ app.py
β
βββ utils/
β βββ chat_db.py
β βββ chats.py
β βββ command_router.py
β βββ installexe.py
β βββ model.py
β βββ process_analysis.py
β βββ safety.py
β βββ software_details.py
β βββ software_health.py
β βββ startup_analysis.py
β βββ storage_analysis.py
β βββ system_diagnosis.py
β βββ tool_executor.py
β βββ tool_registry.py
β βββ windows_actions.py
β
βββ tests/
β βββ test_command_router.py
β βββ test_windows_process_analysis.py
β βββ test_windows_startup.py
β βββ test_windows_storage.py
β βββ test_windows_actions.py
β βββ test_windows_action_execution.py
β
βββ .env.example
βββ .gitignore
βββ requirements.txt
βββ README.md
The project includes a Windows-focused automated test suite.
Windows-specific behavior is mocked where necessary so the implementation can be tested safely from the development environment.
- Command routing
- Process analysis
- Startup analysis
- Storage analysis
- Windows URL actions
- Windows application launching
- Application allowlisting
- Safety confirmation
- Tool execution
- Error handling
pytest -q28 passed
28/28 tests currently pass.
| Technology | Purpose |
|---|---|
| Python | Core application |
| Streamlit | Local user interface |
| Google Gemini | AI conversation and analysis |
| psutil | Process and system information |
| PowerShell | Windows software discovery |
| Windows Registry | Software and startup discovery |
| python-dotenv | Environment configuration |
| pytest | Automated testing |
git clone https://github.com/arjungupt771/System_Analysis_Chatbot.git
cd System_Analysis_ChatbotOn Windows:
python -m venv venvActivate it:
venv\Scripts\activatepip install -r requirements.txtCreate a .env file in the project root:
GEMINI_API_KEY=your_gemini_api_keyA template is available at:
.env.example
Never commit your actual .env file or API key to GitHub.
streamlit run app.pyThe Streamlit interface will open in your browser.
system info
show system information
scan apps
show installed software
show running processes
what is using my cpu
show top memory processes
startup apps
show startup programs
show largest files
find large files
what is using my storage
install vlc
Software installation is classified as a high-risk action and therefore requires explicit approval.
open https://example.com
open notepad
open calculator
Application launching requires confirmation because it performs an external system action.
The project intentionally avoids giving the language model unrestricted access to the operating system.
The execution pipeline is:
User Input
β
Intent Recognition
β
Tool Validation
β
Safety Policy
β
Approval if Required
β
Controlled Tool
β
Structured Result
- No unrestricted shell execution
- Explicit tool registry
- Risk-based action policies
- Confirmation for sensitive operations
- Application allowlisting
shell=Falsefor process launching- Windows platform guards
- Input validation
- Installation verification
- Structured execution results
- Restrictive handling of unknown intents
The system deliberately separates AI reasoning from system execution.
User
β
LLM
β
Arbitrary OS Command
User
β
AI / Intent Router
β
Structured Intent
β
Safety Layer
β
Approved Tool
β
Actual System Data
β
AI Explanation
This makes the system:
- More predictable
- Easier to test
- Easier to extend
- Safer to operate
- Less dependent on LLM-generated system facts
Adding a new system capability follows a controlled pattern:
New Intent
β
New Tool
β
Tool Registry Entry
β
Safety Policy
β
Executor Integration
β
Tests
This allows the assistant to grow without turning the project into an unrestricted operating-system command interface.
| Platform | Status |
|---|---|
| Windows | β Supported |
| Linux | π§ Future |
| macOS | π§ Future |
The current implementation intentionally prioritizes Windows-specific functionality.
The routing, registry, safety, and executor architecture can later be reused for platform-specific implementations.
- Gemini integration
- Deterministic system-health analysis
- Software-health analysis
- Windows software discovery
- Software installation verification
- Natural-language command routing
- Tool registry
- Tool executor
- Windows process analysis
- Windows startup analysis
- Windows storage analysis
- Safety and approval layer
- Windows URL actions
- Controlled application launching
- Application allowlisting
- Windows-focused automated tests
- 28/28 tests passing
- GitHub documentation
- Linux system-analysis support
- Additional Windows diagnostics
- More controlled Windows automation
- Expanded system-health recommendations
- Additional AI-assisted troubleshooting
The current project has several intentional limitations:
- Windows is the supported runtime platform.
- Some capabilities depend on Windows APIs, Registry access, and PowerShell.
- Application launching is restricted to an explicit allowlist.
- Sensitive actions require explicit confirmation.
- Software installation depends on configured installer sources.
- Storage analysis is bounded by traversal depth and result limits.
- Gemini functionality requires a valid API key.
These limitations are intentional design decisions that keep system interaction controlled.
B.Tech β Information Technology
VIT Vellore
GitHub:
https://github.com/arjungupt771
No license has currently been specified for this repository.
If the project is later released for redistribution or open-source use, an appropriate license can be added.
Built with Python Β· Streamlit Β· Google Gemini Β· Windows System Tooling