How ladsonsa/ai-assistant-platform works
AI Assistant Platform accepts mathematical conversations through FastAPI or Streamlit, then resolves intent and prior-result references, evaluates expressions deterministically, and generates a natural-language response. The HTTP path validates structured messages and maps the application result back to a response schema; the Streamlit path maintains conversation memory and shares the orchestrator. The README documents the major stages and provider options; some provider wiring and parts of the Streamlit flow are not shown in source excerpts, so uncertain links are omitted or marked unverified.
Main entry points: chatbot_orchestrator.py Chat Orchestrator · context_resolver.py Context Resolver · llm_service.py LLM Service · chat_service.py Chat Service
Components 24
User Interfaces
- Streamlit UI
app.py - Conversation Memory
ai_assistant_platform/memory/chat_memory.py
Application Flow
- Chat Service
ai_assistant_platform/services/chat_service.py - Chat Orchestrator
ai_assistant_platform/orchestrators/chatbot_orchestrator.py
Math and Context
- Context Resolver
ai_assistant_platform/core/context_resolver.py - Math Context
ai_assistant_platform/core/math_context.py - Expression Extractor
ai_assistant_platform/core/expression_extractor.py - Math Agent
ai_assistant_platform/agents/mathematical_agent.py - Expression Evaluator
ai_assistant_platform/tools/expression_evaluator.py - Math Operations
ai_assistant_platform/tools/math_operations.py
Language Services
- Writer Agent
ai_assistant_platform/agents/writer_agent.py - Writer Prompt
ai_assistant_platform/prompts/writer_prompt.py - LLM Service
ai_assistant_platform/llm/llm_service.py - Context Prompt
ai_assistant_platform/prompts/context_prompt.py - Provider Factory
ai_assistant_platform/llm/provider_factory.py - LLM Providers
ai_assistant_platform/llm/providers - Runtime Settings
ai_assistant_platform/config/settings.py
HTTP Contract
- Chat Router
ai_assistant_platform/api/routers/chat.py - Request Schemas
ai_assistant_platform/api/schemas/chat_request.py - Message Schema
ai_assistant_platform/api/schemas/chat_message.py - Response Mapper
ai_assistant_platform/api/mappers/chat_response_mapper.py - Response Schema
ai_assistant_platform/api/schemas/chat_response.py
Other components
- User
- HTTP Client
Connections 27
- User → Streamlit UI: submits message
README.md - Streamlit UI → Conversation Memory: uses history
README.md - Conversation Memory → Chat Orchestrator: provides history
README.md - User → HTTP Client: sends request
README.md - HTTP Client → Chat Router: posts chat
README.md - Chat Router → Request Schemas: validates request
ai_assistant_platform/api/routers/chat.py - Request Schemas → Message Schema: contains messages
ai_assistant_platform/api/schemas/chat_request.py - Chat Router → Chat Service: delegates
ai_assistant_platform/api/routers/chat.py - Chat Service → Chat Orchestrator: processes message
ai_assistant_platform/services/chat_service.py - Chat Orchestrator → Context Resolver: resolves intent
ai_assistant_platform/orchestrators/chatbot_orchestrator.py - Context Resolver → LLM Service: interprets request
ai_assistant_platform/core/context_resolver.py - Context Resolver → Context Prompt: builds prompt
ai_assistant_platform/core/context_resolver.py - Context Resolver → Math Context: produces context
ai_assistant_platform/core/context_resolver.py - Context Resolver → Expression Extractor: extracts expression
- Chat Orchestrator → Math Agent: prepares calculation
ai_assistant_platform/orchestrators/chatbot_orchestrator.py - Math Agent → Expression Evaluator: evaluates expression
README.md - Chat Orchestrator → Expression Evaluator: evaluates expression
ai_assistant_platform/orchestrators/chatbot_orchestrator.py - Expression Evaluator → Math Operations: uses operations
- Chat Orchestrator → Writer Agent: generates response
ai_assistant_platform/orchestrators/chatbot_orchestrator.py - Writer Agent → Writer Prompt: builds prompt
ai_assistant_platform/agents/writer_agent.py - Writer Agent → LLM Service: requests generation
ai_assistant_platform/agents/writer_agent.py - LLM Service → Provider Factory: selects provider
ai_assistant_platform/llm/llm_service.py - Provider Factory → LLM Providers: resolves provider
- LLM Service → Runtime Settings: reads defaults
ai_assistant_platform/llm/llm_service.py - Chat Service → Response Mapper: maps result
ai_assistant_platform/services/chat_service.py - Response Mapper → Response Schema: creates response
ai_assistant_platform/api/mappers/chat_response_mapper.py - Response Schema → HTTP Client: returns response
README.md