How sreenathkalluri/virgo-ai works
Virgo is a hotel operations assistant: staff sign in, select a property and reporting date, then view dashboard metrics or ask hotel questions answered from property data. The backend also maintains provider data snapshots and processes PMS updates asynchronously. The graph preserves the documented chat, knowledge/RAG, dashboard, integrations, and background-sync branches. Source excerpts do not show the UI’s HTTP requests or all worker/cache operations, so those links are omitted rather than inferred.
Main entry points: api_dependencies.py Auth dependencies · chat.py Chat endpoint · pms.py PMS and dashboard API · pms_cache.py PMS snapshot cache
Components 25
Hotel workspace
- Workspace UI
virgo-ui/src/Interface.tsx - Report date picker
virgo-ui/src/ReportDatePicker.tsx - Answer renderer
virgo-ui/src/AnswerContent.tsx
API and identity
- FastAPI application
backend/main.py - Auth dependencies
backend/api_dependencies.py - Authentication
backend/auth.py
Chat and knowledge
- Chat endpoint
backend/routes/chat.py - Chat orchestration
backend/orchestrator.py - Language model
backend/llm.py - Knowledge retrieval
backend/knowledge.py - Embeddings
backend/embeddings.py - Text splitting
backend/text_splitting.py - Knowledge indexing
backend/index_knowledge.py
PMS data platform
- PMS and dashboard API
backend/routes/pms.py - Integration checks
backend/routes/integrations.py - Property configuration
backend/pms_config.py - PMS queries
backend/pms_queries.py - Sync workers
backend/pms_worker.py - PMS event bus
backend/pms_event_bus.py
State and providers
- PMS snapshot cache
backend/pms_cache.py - Provider adapters
backend/pms_adapters.py
Other components
- Hotel staff
- Cloudbeds API
backend/cloudbeds.py - Mews API
backend/mews.py - PostgreSQL
database/schema.sql
Connections 32
- FastAPI application → Auth dependencies: registers
backend/main.py - FastAPI application → Chat endpoint: registers
backend/main.py - FastAPI application → PMS and dashboard API: registers
backend/main.py - FastAPI application → Integration checks: registers
backend/main.py - Auth dependencies → Authentication: builds auth
backend/api_dependencies.py - Auth dependencies → PostgreSQL: connects
backend/api_dependencies.py - Chat endpoint → Auth dependencies: requires user
backend/routes/chat.py - Chat endpoint → Chat orchestration: runs chat
backend/routes/chat.py - Chat endpoint → Knowledge retrieval: searches
backend/routes/chat.py - Chat endpoint → PMS queries: executes tools
backend/routes/chat.py - Chat orchestration → PMS queries: defines tools
backend/orchestrator.py - Chat orchestration → Language model: calls model
backend/orchestrator.py - Knowledge retrieval → Embeddings: uses
backend/knowledge.py - Knowledge retrieval → Text splitting: uses
backend/knowledge.py - Knowledge indexing → Knowledge retrieval: indexes for
backend/index_knowledge.py - Knowledge indexing → PMS snapshot cache: uses
backend/index_knowledge.py - PMS and dashboard API → Auth dependencies: requires user
backend/routes/pms.py - PMS and dashboard API → PMS queries: calculates metrics
backend/routes/pms.py - PMS and dashboard API → PMS snapshot cache: reads status
backend/routes/pms.py - PMS and dashboard API → Property configuration: authorizes property
backend/routes/pms.py - Integration checks → Auth dependencies: requires user
backend/routes/integrations.py - Integration checks → PMS snapshot cache: validates connection
backend/routes/integrations.py - Integration checks → Property configuration: selects property
backend/routes/integrations.py - Sync workers → PMS snapshot cache: syncs snapshots
backend/pms_worker.py - Sync workers → PMS event bus: drains events
backend/pms_worker.py - Sync workers → PMS queries: warms summaries
backend/pms_worker.py - PMS snapshot cache → Provider adapters: creates adapter
backend/pms_cache.py - Provider adapters → Cloudbeds API: delegates
backend/pms_adapters.py - Provider adapters → Mews API: delegates
backend/pms_adapters.py - Hotel staff → Workspace UI: uses
- Workspace UI → Report date picker: renders
virgo-ui/src/Interface.tsx - Workspace UI → Answer renderer: renders
virgo-ui/src/Interface.tsx