How alwyn25/voice_agent_ai works
This is a FastAPI AI voice-sales and customer-lifecycle platform. Its central workflow starts with a session, processes conversational turns through the engine, and performs post-call memory updates when the session ends. Separate capabilities cover knowledge ingestion and retrieval, configurable rules and tools, telephony, and administrative APIs. The excerpts establish session-to-turn and retrieval/ingestion relationships; broader subsystem links are included only where documented by the README or marked as unverified. Several major modules are represented at their exact tree paths because their source was not sampled.
Main entry points: sessions.py Session lifecycle · retrieval.py Hybrid retrieval · planner.py Planning and response · ingestion.py Document ingestion
Components 22
API and sessions
- FastAPI application
core/app/main.py - Session lifecycle
core/app/api/sessions.py
Conversation engine
- Turn processing
core/app/engine/planner/turn_runner.py - Planning and response
core/app/engine/planner/planner.py - Tool execution
core/app/engine/tools/executor.py - Post-call memory
core/app/engine/memory/pipeline.py
Knowledge retrieval
- Document ingestion
core/app/engine/rag/ingestion.py - Chunking and enrichment
core/app/engine/rag/chunkers.py - Parent-child chunks
core/app/engine/rag/parent_child.py - Hybrid retrieval
core/app/engine/rag/retrieval.py - Result reranking
core/app/engine/rag/reranker.py
Platform capabilities
- Business APIs
core/app/api - Voice and telephony
core/app/engine/voice/bridge.py - Rules engine
core/app/engine/rules/engine.py - Custom instructions
core/app/custom_instructions/service.py - Industry packs
core/app/packs
Providers and persistence
- Relational database
core/app/db/base.py - Domain records
core/app/db/models - LLM provider routing
core/app/providers/llm/router.py - Embedding provider routing
core/app/providers/embeddings/router.py - Shared turn schemas
packages/shared/src/shared/schemas/turns.py
Other components
- Channel clients
Connections 23
- Channel clients → FastAPI application: sends requests
- FastAPI application → Session lifecycle: mounts routes
core/app/main.py - Channel clients → Session lifecycle: drives sessions
core/app/api/sessions.py - Session lifecycle → Turn processing: processes turns
core/app/api/sessions.py - Session lifecycle → Post-call memory: runs on end
core/app/api/sessions.py - Turn processing → Planning and response: delegates planning
- Planning and response → Tool execution: dispatches tools
- Planning and response → Hybrid retrieval: retrieves knowledge
- Document ingestion → Chunking and enrichment: chunks documents
core/app/engine/rag/ingestion.py - Document ingestion → Parent-child chunks: builds hierarchy
core/app/engine/rag/ingestion.py - Document ingestion → Embedding provider routing: creates vectors
core/app/engine/rag/ingestion.py - Hybrid retrieval → Result reranking: reranks results
core/app/engine/rag/retrieval.py - Hybrid retrieval → Parent-child chunks: fetches parents
core/app/engine/rag/retrieval.py - Hybrid retrieval → Embedding provider routing: embeds queries
core/app/engine/rag/retrieval.py - Hybrid retrieval → Domain records: queries records
core/app/engine/rag/retrieval.py - Post-call memory → Domain records: updates facts
core/app/engine/memory/pipeline.py - Session lifecycle → Relational database: loads sessions
core/app/api/sessions.py - FastAPI application → Business APIs: registers endpoints
core/app/main.py - Custom instructions → Rules engine: validates rules
- LLM provider routing → Planning and response: supplies model
- Voice and telephony → Session lifecycle: uses session lifecycle
- Shared turn schemas → Session lifecycle: defines turn contract
- Industry packs → Planning and response: configures domain behavior