How tonbunheng/ai_chat_assistant works
Angkor Verse AI is a Cambodia-focused tourism assistant with a Vue chat interface and FastAPI backend. A visitor submits a question in the chat; the client calls the backend, which classifies the request, gathers tourism knowledge or intent-specific information, selects an AI execution mode, and returns a response rendered with structured cards. Separate documented capabilities include itinerary planning, recommendations, weather, currency, events, and place lookup. The principal chat-route wiring and several integrations were not sampled, so uncertain links are dashed; README-described capabilities are retained without asserting unseen implementation details.
Main entry points: tourism_routes.py Tourism routes · rag_service.py RAG orchestrator · chatService.js Chat service · recommendation_engine.py Recommendations
Components 24
Web client
- Chat page
frontend/src/pages/ChatPage.vue - Chat service
frontend/src/services/chatService.js - Chat views
frontend/src/components/chat/ChatMessage.vue
API layer
- Chat API
backend/app/api/routes/chat.py - Tourism routes
backend/app/api/routes/tourism_routes.py
Chat processing
- RAG orchestrator
backend/app/services/rag_service.py - Intent detection
backend/app/services/intent_service.py - Language handling
backend/app/services/language_service.py - Conversation memory
backend/app/services/memory_service.py - Offline knowledge
backend/app/services/offline/offline_knowledge_service.py
Tourism capabilities
- Tourism catalogue
backend/app/services/tourism_service.py - Semantic matching
backend/app/services/matching_service.py - Embedding service
backend/app/services/embedding_service.py - Itinerary planner
backend/app/services/itinerary_engine.py - Recommendations
backend/app/services/recommendation_engine.py - Weather service
backend/app/services/weather_service.py - Currency service
backend/app/services/currency_service.py - Events service
backend/app/services/events_service.py - Places service
backend/app/services/places_service.py
AI and data providers
- AI routing
backend/app/services/ai_router.py - Gemini provider
backend/app/services/online/gemini_service.py - Ollama provider
backend/app/services/offline/ollama_service.py - Live data providers
backend/app/services/online
Other components
- Visitor
Connections 26
- Visitor → Chat page: asks
README.md - Chat page → Chat service: submits message
frontend/src/pages/ChatPage.vue - Chat service → Chat API: sends HTTP request
- Chat API → RAG orchestrator: processes chat
- RAG orchestrator → Intent detection: classifies request
backend/app/services/rag_service.py - RAG orchestrator → Language handling: handles language
backend/app/services/rag_service.py - RAG orchestrator → Conversation memory: reads and updates
backend/app/services/rag_service.py - RAG orchestrator → AI routing: selects provider
- AI routing → Gemini provider: dispatches online
- AI routing → Ollama provider: dispatches offline
- RAG orchestrator → Offline knowledge: uses fallback
- RAG orchestrator → Tourism catalogue: retrieves knowledge
- RAG orchestrator → Semantic matching: matches tourism
backend/app/services/rag_service.py - Semantic matching → Embedding service: encodes queries
backend/app/services/matching_service.py - Chat views → Visitor: renders answer
frontend/src/components/chat/ChatMessage.vue - Chat service → Tourism routes: requests tourism APIs
- Tourism routes → Itinerary planner: generates itinerary
backend/app/api/routes/tourism_routes.py - Itinerary planner → Currency service: gets exchange rate
backend/app/services/itinerary_engine.py - Tourism routes → Weather service: gets forecast
backend/app/api/routes/tourism_routes.py - Tourism routes → Currency service: gets conversion rate
backend/app/api/routes/tourism_routes.py - Tourism routes → Events service: retrieves events
backend/app/api/routes/tourism_routes.py - Tourism routes → Places service: retrieves places
backend/app/api/routes/tourism_routes.py - Tourism routes → Recommendations: ranks attractions
backend/app/api/routes/tourism_routes.py - Recommendations → Tourism catalogue: reads catalogue
backend/app/services/recommendation_engine.py - Recommendations → Weather service: considers weather
backend/app/services/recommendation_engine.py - Tourism routes → Live data providers: uses live integrations