How akshat-singh-kshatriya/loco works
Loco is a conversational map-discovery app: users ask for places or routes by text or voice, the backend interprets the request and runs map tools, ranks results using session/profile preferences, then returns a response and map commands for the frontend. The README documents multilingual support, route discovery, hazards, and personalization. Source excerpts show the API wiring and tool loop; several frontend component-to-hook/API connections and some service internals were not sampled, so those links are omitted rather than inferred.
Main entry points: chat.py Chat orchestration · AppPage.tsx Chat and map page · main.py FastAPI app · session.py Session and feedback API
Components 29
Frontend experience
- App shell
frontend/src/App.tsx - Chat and map page
frontend/src/pages/AppPage.tsx - Chat panel
frontend/src/components/app/ChatPanel.tsx - Map panel
frontend/src/components/app/MapPanel.tsx - Place cards
frontend/src/components/app/PlaceCard.tsx - Ranking controls
frontend/src/components/app/WeightPanel.tsx - Hazard summary
frontend/src/components/app/HazardSummary.tsx - Chat state
frontend/src/hooks/use-chat.ts - Voice controls
frontend/src/components/app/VoiceButton.tsx - Voice capture
frontend/src/hooks/use-voice-input.ts - API client
frontend/src/lib/api.ts
Conversation API
- FastAPI app
backend/main.py - Chat orchestration
backend/routers/chat.py - API and session models
backend/models/schemas.py - Session and feedback API
backend/routers/session.py
Map and personalization
- LLM tool loop
backend/services/groq_service.py - Map tool handlers
backend/mcp_server/tools.py - Map and route APIs
backend/services/mappls_api.py - Place ranking
backend/services/ranking.py - User profiles
backend/services/profile_store.py - Session state
backend/services/session_store.py
Voice and language
- Speech transcription API
backend/routers/voice.py - Speech synthesis API
backend/routers/tts.py - Sarvam speech service
backend/services/sarvam_service.py - Language support
backend/services/language_service.py
Other components
- Map explorer
- Groq LLM
- Mappls services
- Sarvam AI
Connections 33
- Map explorer → App shell: opens app
README.md - App shell → Chat and map page: routes to
frontend/src/App.tsx - Map explorer → Chat panel: asks places
- Chat panel → Chat state: uses chat state
- Chat state → API client: sends requests
- API client → Chat orchestration: posts chat
- FastAPI app → Chat orchestration: registers route
backend/main.py - FastAPI app → Session and feedback API: registers route
backend/main.py - FastAPI app → Speech transcription API: registers route
backend/main.py - FastAPI app → Speech synthesis API: registers route
backend/main.py - Chat orchestration → LLM tool loop: runs conversation
backend/routers/chat.py - Chat orchestration → Language support: handles language
backend/routers/chat.py - Chat orchestration → Place ranking: ranks results
backend/routers/chat.py - Chat orchestration → User profiles: reads preferences
backend/routers/chat.py - Chat orchestration → Session state: loads state
backend/routers/chat.py - LLM tool loop → Groq LLM: requests completions
README.md - LLM tool loop → Map tool handlers: dispatches tools
backend/services/groq_service.py - Map tool handlers → Map and route APIs: calls map tools
backend/mcp_server/tools.py - Map and route APIs → Mappls services: queries maps
README.md - Chat orchestration → API and session models: uses request models
backend/routers/chat.py - Session and feedback API → Session state: updates sessions
backend/routers/session.py - Session and feedback API → User profiles: updates profiles
backend/routers/session.py - Session and feedback API → Place ranking: adjusts preferences
backend/routers/session.py - Speech transcription API → Sarvam speech service: transcribes audio
backend/routers/voice.py - Speech synthesis API → Sarvam speech service: synthesizes speech
backend/routers/tts.py - Sarvam speech service → Sarvam AI: uses speech API
README.md - Voice controls → Voice capture: captures speech
- Voice capture → API client: submits audio
- Chat and map page → Map panel: presents map
- Chat and map page → Chat panel: presents chat
- Chat and map page → Place cards: shows results
- Chat and map page → Ranking controls: adjusts ranking
- Chat and map page → Hazard summary: shows hazards