How adithya-charan/shopsahayak works
ShopSahayak is a conversational retail business assistant: shopkeepers ask sales or inventory questions by text or voice, and receive answers grounded in business data. Text requests enter FastAPI and pass through NLP, bounded agent orchestration, business tools, analytics or ML, and LLM response generation; voice adds LiveKit and Sarvam speech processing. The repository also includes daily reports, sales and inventory endpoints, forecasting, anomaly detection, restock logic, and optional avatar sessions. The frontend and some voice/provider wiring are documented but not fully shown in the sampled source.
Main entry points: endpoints.py FastAPI routes · agent.py Query orchestrator · voice_worker.py LiveKit voice worker · tools.py Business tool registry
Components 20
User interaction
- Web assistant
ShopSahayak-AI-Retail-Assistant - FastAPI routes
app/api/endpoints.py - Application entry
app/main.py
Assistant orchestration
- Query orchestrator
app/core/agent.py - Language processing
app/core/nlp.py - Conversation history
app/core/session.py - Business tool registry
app/core/tools.py - Response generation
app/core/llm.py
Retail intelligence
- Retail analytics
app/analytics/engine.py - Forecast and restock
app/ml/engine.py - Business data interface
app/data/interfaces.py - Demo business data
app/data/synthetic.py - Retail data models
app/data/models.py
Voice and providers
- Runtime configuration
app/config.py - Sarvam speech
app/core/sarvam.py - LiveKit voice worker
app/voice_worker.py - Avatar sessions
app/core/beyond_presence.py - LiveKit service
- Groq service
Other components
- Shopkeeper
Connections 26
- Shopkeeper → Web assistant: asks question
README.md - Web assistant → FastAPI routes: sends requests
README.md - Application entry → FastAPI routes: registers routes
app/main.py - FastAPI routes → Query orchestrator: processes query
app/api/endpoints.py - Query orchestrator → Language processing: parses query
app/core/agent.py - Query orchestrator → Conversation history: reads and stores history
app/core/agent.py - Query orchestrator → Business tool registry: executes selected tools
app/core/agent.py - Query orchestrator → Response generation: requests tool calls and answer
app/core/agent.py - Business tool registry → Retail analytics: calls analytics
app/core/tools.py - Business tool registry → Forecast and restock: calls ML methods
app/core/tools.py - Retail analytics → Business data interface: reads business data
app/analytics/engine.py - Forecast and restock → Business data interface: reads business data
app/ml/engine.py - Demo business data → Business data interface: implements interface
app/data/synthetic.py - Demo business data → Retail data models: creates retail records
app/data/synthetic.py - FastAPI routes → Retail analytics: serves stock queries
app/api/endpoints.py - FastAPI routes → Forecast and restock: provides ML services
app/api/endpoints.py - FastAPI routes → Demo business data: initializes data provider
app/api/endpoints.py - Response generation → Groq service: generates completions
README.md - LiveKit voice worker → LiveKit service: joins room
app/voice_worker.py - LiveKit voice worker → Query orchestrator: processes transcript
app/voice_worker.py - LiveKit voice worker → Sarvam speech: transcribes and speaks
README.md - Shopkeeper → LiveKit service: streams voice
README.md - FastAPI routes → Avatar sessions: creates avatar session
app/api/endpoints.py - Avatar sessions → LiveKit service: uses room
README.md - Runtime configuration → Response generation: configures provider
app/core/llm.py - Runtime configuration → Avatar sessions: configures provider
app/core/beyond_presence.py