How shaerware/ai_secretary_system works
AI Secretary System is a self-hosted assistant platform with an admin UI, chat APIs, local and cloud LLM options, speech, knowledge retrieval, and messaging channels. Users configure assistants and integrations in the admin panel, then interact through chat, Telegram, WhatsApp, or an embedded widget; requests reach domain APIs and supporting services, with persistent state in SQLite and Redis. The README documents capabilities beyond the sampled source, so those branches are included with unverified links shown as dashed. Evidence comes from README statements and SOURCE INDEX references; unsampled internals are not asserted.
Main entry points: database.py SQLite database · chat/service.py Chat orchestration · router.py Chat API · knowledge/service.py Knowledge retrieval
Components 30
User Interfaces
- Admin panel
admin/src/App.vue - Mobile app
mobile/src/App.vue
API Domains
- Chat API
modules/chat/router.py - LLM API
modules/llm/router.py - Speech API
modules/speech/router_tts.py - Knowledge API
modules/knowledge/router_wiki_rag.py - Auth & workspace
modules/core/router_auth.py - Monitoring API
modules/monitoring/router_monitor.py
Assistant Runtime
- Chat orchestration
modules/chat/service.py - Knowledge retrieval
modules/knowledge/service.py - Wiki RAG
app/services/wiki_rag_service.py - LLM routing
modules/llm/service.py - Cloud LLM providers
cloud_llm_service.py - Local LLM
vllm_llm_service.py - Speech engines
modules/speech/service.py - CLI provider bridge
services/bridge/src/providers/manager.py
Channels & Business
- Telegram channel
modules/channels/telegram/service.py - WhatsApp channel
modules/channels/whatsapp/service.py - Web chat widget
modules/channels/widget/service.py - CRM & sales
modules/crm/service.py - Commerce
modules/ecommerce/service.py - GSM telephony
modules/telephony/service.py - Kanban
modules/kanban/service.py
Shared Infrastructure
- SQLite database
db/database.py - Redis
db/redis_client.py - Authentication
auth_manager.py - Audit & usage
modules/monitoring/service.py
Other components
- Assistant user
- Administrator
- Cloud model providers
Connections 31
- Assistant user → Chat API: sends messages
README.md - Administrator → Admin panel: configures system
README.md - Assistant user → Mobile app: chats through
README.md - Admin panel → Auth & workspace: manages access
README.md - Chat API → Chat orchestration: delegates chat
modules/chat/router.py - Chat API → Knowledge retrieval: uses retrieval
modules/chat/router.py - Chat API → LLM routing: routes generation
modules/chat/router.py - Knowledge API → Knowledge retrieval: manages knowledge
README.md - Knowledge API → Wiki RAG: searches collections
modules/knowledge/router_wiki_rag.py - LLM API → LLM routing: manages models
modules/llm/router.py - LLM API → Cloud LLM providers: invokes providers
modules/llm/router.py - LLM API → Local LLM: manages local model
modules/llm/router.py - Speech API → Speech engines: requests synthesis
modules/speech/router_tts.py - Chat orchestration → Telegram channel: serves channel
modules/chat/router.py - Chat orchestration → WhatsApp channel: serves channel
modules/chat/router.py - Chat orchestration → Web chat widget: serves channel
modules/chat/router.py - Chat orchestration → SQLite database: persists conversations
README.md - Knowledge retrieval → SQLite database: reads and writes
modules/knowledge/service.py - Wiki RAG → Knowledge retrieval: manages documents
README.md - LLM routing → SQLite database: loads configuration
modules/llm/service.py - Cloud LLM providers → Cloud model providers: calls provider
README.md - CLI provider bridge → Cloud model providers: dispatches CLI requests
README.md - Auth & workspace → Authentication: authenticates users
modules/core/router_auth.py - Auth & workspace → Audit & usage: records audit
modules/core/router_auth.py - Audit & usage → SQLite database: stores audit records
modules/monitoring/service.py - Monitoring API → Audit & usage: serves metrics
README.md - Admin panel → Chat API: administers chat
README.md - CRM & sales → SQLite database: stores CRM data
README.md - Commerce → SQLite database: stores commerce data
README.md - GSM telephony → Speech engines: uses voice services
README.md - Kanban → SQLite database: stores tasks
README.md