How tranvanhuy-hichan/nestor-agent works
Nestor is a self-hosted personal AI assistant with a web UI, CLI, API, background gateway, and optional messaging/MCP integrations. The main workflow is a user submitting a chat or task through the UI/API; the backend routes it to an agent run, which can use tools and return a response while persisting sessions. Separate capabilities include document RAG, skills, scheduled work, channels, and office-document generation. Edges are limited to relationships shown in the excerpts, SOURCE INDEX, or README; several unsampled feature links are documented rather than inferred from implementation.
Main entry points: chat_runner.py Chat runner · main.py HTTP gateway · chat.py Chat API · jobs.py Background jobs
Components 21
User interfaces
- Web application
app/frontend/src/App.tsx - Chat interface
app/frontend/src/features/chat/ChatPage.tsx
Agent runtime
- HTTP gateway
app/backend/nestor/main.py - Chat API
app/backend/nestor/api/chat.py - Chat runner
app/backend/nestor/services/chat_runner.py - Tasks API
app/backend/nestor/api/tasks.py - Background jobs
app/backend/nestor/services/jobs.py - Model providers
app/backend/nestor/services/providers.py
Knowledge and tools
- Knowledge base
app/backend/nestor/services/knowledge.py - Embeddings
app/backend/nestor/services/embeddings.py - Skills
app/backend/nestor/services/skills.py - Agent tools
app/backend/nestor/services/tools.py - Office documents
app/backend/nestor/services/vanban/writer.py
Automation and integrations
- MCP client
app/backend/nestor/services/mcp_client.py - Messaging channels
app/backend/nestor/api/channels.py - Automations
app/backend/nestor/services/scheduler.py
Local state
- Sessions and memory
app/backend/nestor/services/sessions.py - SQLite state
app/backend/nestor/core/db.py - Configuration
app/backend/nestor/core/config.py
Other components
- User
- External services
Connections 25
- User → Web application: uses
app/frontend/src/App.tsx - Web application → Chat interface: routes to
app/frontend/src/App.tsx - Chat interface → Chat API: submits chat
- Web application → HTTP gateway: calls API
- HTTP gateway → Chat API: routes requests
app/backend/nestor/main.py - HTTP gateway → Tasks API: routes requests
app/backend/nestor/main.py - Chat API → Chat runner: runs agent
app/backend/nestor/api/chat.py - Chat API → Sessions and memory: manages sessions
app/backend/nestor/api/chat.py - Tasks API → Background jobs: starts jobs
app/backend/nestor/api/tasks.py - Background jobs → Sessions and memory: uses sessions
app/backend/nestor/services/jobs.py - Sessions and memory → SQLite state: reads and writes
app/backend/nestor/services/sessions.py - Background jobs → SQLite state: reads and writes
app/backend/nestor/services/jobs.py - Chat runner → Agent tools: uses tools
- Chat runner → Model providers: calls models
- Chat runner → Knowledge base: retrieves documents
- Knowledge base → Embeddings: indexes content
- Chat runner → Skills: uses skills
- Agent tools → MCP client: invokes MCP
app/backend/nestor/services/mcp_client.py - MCP client → External services: connects servers
- Messaging channels → Chat runner: dispatches tasks
- Messaging channels → External services: communicates
- Automations → Background jobs: schedules work
- Chat runner → Office documents: creates documents
- HTTP gateway → Configuration: loads settings
app/backend/nestor/main.py - Chat runner → Sessions and memory: persists conversation