Agent System is an integrated, fully local AI agent platform that combines a Python-based MCP (Model Context Protocol) server with a modern React + Electron frontend. It gives you a powerful conversational AI that can see, hear, speak, and control your entire computer β all without sending a single byte to the cloud.
The system is built around Ollama for local LLM inference and is designed to be extended with custom tools, routines, and voice providers.
- Local LLM inference via Ollama β runs entirely on your machine
- Streaming responses with Server-Sent Events (SSE) for a fluid, real-time experience
- Deep Thinking (
deep_think) β triggers extended chain-of-thought reasoning for complex tasks - Deep Search β web-aware research tool powered by DuckDuckGo
- Real-time Speech-to-Text using OpenAI Whisper (streaming
tiny.en+ finalsmall.enpass) - Voice Activity Detection (VAD) via Silero for precise speech boundary detection
- Neural Text-to-Speech via Piper TTS with multiple voice models
- Bidirectional WebSocket voice stream (
/ws/voice) β send audio, receive speech back - On-demand model warmup to eliminate cold-start latency
| Tool | Capability |
|---|---|
system_commands_windows |
Run shell commands, scripts, and terminal operations |
open_program / close_program |
Launch and terminate any application |
computer_control |
GUI automation via UI Automation (click, type, navigate) |
filesystem |
Read, write, and manage files within a safe sandbox directory |
| Tool | Capability |
|---|---|
manage_planner |
Create, update, and query a persistent daily task planner |
create_new_routine / execute_routine |
Define and trigger named automation routines |
send_email_gmail |
Compose and send emails with file attachments via Gmail SMTP |
get_current_weather |
Fetch live weather data for any location |
calculate |
Safe expression evaluator for mathematical computations |
- File Upload & OCR β supports PDF, DOCX, TXT, MD, PNG, JPG, WebP
- Tesseract OCR for extracting text from images
- pypdf for multi-page PDF text extraction
- Per-tool permission gates β sensitive tools prompt the user before executing
- "Always Allow" toggles per tool β grant trust once, never be asked again
- Timed Full Access mode β grant blanket access for a configurable duration
- Safe write directory sandbox β all file writes are contained in a safe folder
- Dark / Light mode toggle
- Online / Offline API status indicator
- Streaming chat UI with Markdown rendering and syntax highlighting
- Voice chat interface with real-time transcription display
- File attachment support in chat
- Model selector β switch LLMs on the fly
- Voice model selector β choose your TTS voice
- Daily planner panel β view and manage tasks from the sidebar
- Packagable as a desktop app via Electron
Agent-System/
βββ MCP_server/ # Python backend
β βββ server.py # Entry point: starts Ollama, API, and frontend
β βββ web_api.py # FastAPI REST + WebSocket endpoints
β βββ config.py # All configurable constants & model settings
β βββ tts_piper.py # Piper TTS integration
β βββ ai_chat/ # Core LLM chat engine (Ollama client)
β βββ voice/ # Voice pipeline
β β βββ voice_manager.py # WebSocket orchestrator
β β βββ speech_engine.py # Whisper STT + confidence scoring
β β βββ vad.py # Silero Voice Activity Detection
β β βββ providers/ # Local & cloud voice providers
β β βββ models/ # Cached model weights
β βββ tools/ # Pluggable tool modules
β βββ calculator.py
β βββ deep_search.py
β βββ email.py
β βββ filesystem.py
β βββ planner.py
β βββ routines.py
β βββ system_commands.py
β βββ system_action_commands.py
β βββ thinker.py
β βββ ui_control.py
β βββ weather.py
β
βββ AI_Chatbot/ # React + Vite + Electron frontend
β βββ src/
β β βββ App.jsx
β β βββ components/ # UI components
β β βββ hooks/ # Custom React hooks (useVoiceChat, etc.)
β β βββ pages/ # Route-level pages
β β βββ api/ # API client helpers
β β βββ utils/ # Shared utilities
β βββ electron/ # Electron shell for desktop packaging
β βββ package.json
β
βββ build.ps1 # One-click Windows build script
βββββββββββββββββββββββ REST / SSE / WebSocket ββββββββββββββββββββββββββββ
β React Frontend β ββββββββββββββββββββββββββββββββββββΊ β FastAPI Server (:8000) β
β (Vite :5173 / App) β β web_api.py β
βββββββββββββββββββββββ ββββββββββββββ¬ββββββββββββββ
β
ββββββββββββββΌββββββββββββββ
β ai_chat Engine β
β (Ollama LLM + Tools) β
ββββββββββββββ¬ββββββββββββββ
β
ββββββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββ
β Tool Registry β
β calculate Β· weather Β· email Β· filesystem Β· system_commands β
β planner Β· routines Β· deep_think Β· open/close_program β
β computer_control Β· deep_search β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
| Requirement | Notes |
|---|---|
| Python 3.10+ | Required for the backend |
| Node.js 18+ | Required for the frontend |
| Ollama | Download here β must be installed and on PATH |
| Tesseract OCR | Download here β install to C:\Program Files\Tesseract-OCR\ |
| FFmpeg (optional) | For audio processing; can be installed via WinGet |
| GPU (recommended) | CUDA-capable GPU greatly accelerates Whisper and Ollama inference |
git clone https://github.com/amrokld/Agent-System.git
cd Agent-Systemollama pull gpt-oss:120b-cloud
# or any other compatible modelcd MCP_server
pip install -r requirements.txtcd ../AI_Chatbot
npm install# From the MCP_server directory
python server.pyThis single command will:
- π Start the Ollama engine
- π Launch the FastAPI server on
http://0.0.0.0:8000 - βοΈ Start the Vite dev server for the React frontend
- π Open the chat UI in your browser at
http://localhost:5173
Run the included PowerShell build script from the project root:
.\build.ps1This will:
- Bundle the Python backend into a standalone
server.exevia PyInstaller - Build the React frontend with Vite
- Package everything into a Windows desktop installer via Electron Builder
The final installer is placed in AI_Chatbot/release/.
All backend settings are centralized in MCP_server/config.py:
| Setting | Default | Description |
|---|---|---|
OLLAMA_MODEL |
gpt-oss:120b-cloud |
The LLM model served by Ollama |
OLLAMA_KEEP_ALIVE |
10m |
How long to keep the model loaded in memory |
WHISPER_MODEL_STREAMING |
tiny.en |
Fast Whisper model for real-time STT |
WHISPER_MODEL_FINAL |
small.en |
Higher-accuracy model for final transcription |
VOICE_MODEL |
en_US-ryan-medium |
Default Piper TTS voice |
VAD_SILENCE_TIMEOUT_MS |
4000 |
Silence threshold to end a voice turn (ms) |
STT_CONFIDENCE_THRESHOLD_FINAL |
0.75 |
Below this, words are marked as uncertain |
SAFE_WRITE_DIR |
./written_files |
Sandboxed directory for all file output |
GMAIL_USER |
env var |
Gmail address for the email tool |
GMAIL_APP_PASSWORD |
env var |
Gmail app password for the email tool |
You can override most settings using environment variables.
The backend exposes a RESTful API plus WebSocket endpoints:
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/chat |
Synchronous chat (returns full reply) |
POST |
/api/chat/stream |
Streaming chat via SSE |
POST |
/api/voice |
Upload audio β get transcript (deprecated) |
WS |
/ws/voice |
Real-time bidirectional voice pipeline |
POST |
/api/voice/warmup |
Pre-load STT models |
POST |
/api/tts |
Text β WAV audio file |
POST |
/api/file |
Upload file + instruction β AI response |
GET |
/api/download/{filename} |
Download a generated file |
GET |
/api/model |
Get current active model |
POST |
/api/model |
Switch active model |
GET |
/api/voices |
List installed TTS voices |
POST |
/api/voices/set |
Set active TTS voice |
GET |
/api/permissions/pending |
Check for a pending permission request |
POST |
/api/permission |
Respond to a permission request |
POST |
/api/permissions/grant-full-access |
Grant timed full access |
GET |
/api/planner/tasks |
Get today's planner tasks |
GET |
/api/routines |
List all saved routines |
GET |
/api/health |
Health check |
- FastAPI β High-performance async REST framework
- Uvicorn β ASGI server
- Ollama β Local LLM inference engine
- OpenAI Whisper β Speech recognition
- Piper TTS β Neural text-to-speech
- PyTorch β ML inference backend (Whisper + Silero VAD)
- FastMCP β Model Context Protocol integration
- PyInstaller β Python bundling for distribution
- React 19 β UI library
- Vite 7 β Lightning-fast bundler & dev server
- Electron 28 β Desktop app wrapper
- TailwindCSS 3 β Utility-first styling
- React Router 7 β Client-side routing
- react-markdown β Markdown rendering
- Highlight.js β Code syntax highlighting
- Lucide React β Icon library
MCP_server/tools/ β Add new tools here
MCP_server/voice/ β Voice pipeline (VAD, STT, TTS, WebSocket)
MCP_server/ai_chat/ β Core chat engine & Ollama client
AI_Chatbot/src/components/ β React UI components
AI_Chatbot/src/hooks/ β Custom hooks (useVoiceChat, etc.)
AI_Chatbot/electron/ β Desktop app entry point
Contributions, issues, and feature requests are welcome!
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License β see the LICENSE file for details.
This project was designed and built by:
| Name | Role |
|---|---|
| Abdalla Dawoud | Co-Developer & Architect |
| Amro Khaled | Co-Developer & Architect |
Made with β€οΈ and a lot of β
"The night is darkest just before the dawn."