How tanya-223/vaani_market works
Vaani Market is a voice-first, multilingual Indian-market explainer. A browser sends spoken audio to the web server, which obtains a transcript and passes the turn to the orchestrator. The orchestrator applies deterministic refusal and clarification checks, plans the query, resolves tickers, gathers market facts or retrieval context, and produces a grounded answer guarded against unsupported numbers and advice. The web app returns text and display data and can synthesize spoken output. README documents several pipeline links; sampled excerpts confirm only some call sites, so unsampled links are cited to the README.
Main entry points: orchestrate.py Turn orchestrator · app.py HTTP web server · tier2.py Hybrid company retrieval · app.js Browser voice UI
Components 25
Web experience
- Browser voice UI
src/vaani/web/static/app.js - HTTP web server
src/vaani/web/app.py
Turn orchestration
- Turn orchestrator
src/vaani/agent/orchestrate.py - Advice classifier
src/vaani/agent/advice.py - Intent planner
src/vaani/agent/planner.py - Ticker resolver
src/vaani/agent/ticker_resolver.py - Session memory
src/vaani/agent/memory.py
Market and retrieval
- Grounded facts
src/vaani/agent/facts.py - Market data tools
src/vaani/data/market.py - Glossary retrieval
src/vaani/retrieval/tier1.py - Multilingual glossary
src/vaani/retrieval/glossary.py - Hybrid company retrieval
src/vaani/retrieval/tier2.py - Company notes
src/vaani/retrieval/corpus.py - Retrieval budgets
src/vaani/retrieval/router.py
Answer and safety
- Refusal responses
src/vaani/agent/refusal.py - Answer explainer
src/vaani/agent/explainer.py - Numeric provenance gate
src/vaani/agent/numeric_gate.py - Advice output guard
src/vaani/agent/advice.py
Speech and model services
- Prisma speech recognition
src/vaani/gnani/stt.py - Timbre speech synthesis
src/vaani/gnani/tts.py - LLM adapter
src/vaani/llm/adapter.py
Other components
- Market questioner
- Gnani speech APIs
- Yahoo Finance
- LLM and embedding API
Connections 32
- Market questioner → Browser voice UI: asks by voice
- Browser voice UI → HTTP web server: sends audio
- HTTP web server → Prisma speech recognition: transcribes audio
src/vaani/web/app.py - Prisma speech recognition → Gnani speech APIs: requests transcript
- HTTP web server → Turn orchestrator: routes transcript
src/vaani/web/app.py - Turn orchestrator → Advice classifier: checks intent
src/vaani/agent/orchestrate.py - Turn orchestrator → Refusal responses: returns refusal
src/vaani/agent/orchestrate.py - Turn orchestrator → Ticker resolver: checks ambiguity
src/vaani/agent/orchestrate.py - Turn orchestrator → Intent planner: plans query
src/vaani/agent/orchestrate.py - Intent planner → LLM adapter: requests plan
src/vaani/agent/planner.py - Turn orchestrator → Session memory: uses session
src/vaani/agent/orchestrate.py - Turn orchestrator → Glossary retrieval: queries concepts
src/vaani/agent/orchestrate.py - Glossary retrieval → Multilingual glossary: retrieves entries
src/vaani/retrieval/tier1.py - Glossary retrieval → Retrieval budgets: runs within budget
src/vaani/retrieval/tier1.py - Turn orchestrator → Ticker resolver: resolves planned ticker
src/vaani/agent/orchestrate.py - Turn orchestrator → Grounded facts: builds facts
src/vaani/agent/orchestrate.py - Grounded facts → Market data tools: fetches market data
src/vaani/agent/facts.py - Market data tools → Yahoo Finance: fetches quotes and news
- Turn orchestrator → Hybrid company retrieval: attaches company notes
src/vaani/agent/orchestrate.py - Hybrid company retrieval → Company notes: retrieves notes
src/vaani/retrieval/tier2.py - Hybrid company retrieval → LLM adapter: embeds queries
src/vaani/retrieval/tier2.py - Hybrid company retrieval → Retrieval budgets: uses tier budgets
- Turn orchestrator → Answer explainer: generates answer
src/vaani/agent/orchestrate.py - Answer explainer → LLM adapter: requests explanation
src/vaani/agent/explainer.py - Turn orchestrator → Numeric provenance gate: checks numeric provenance
src/vaani/agent/orchestrate.py - Turn orchestrator → Advice output guard: rejects unsafe output
src/vaani/agent/orchestrate.py - LLM adapter → LLM and embedding API: sends chat and embeddings
src/vaani/llm/adapter.py - Turn orchestrator → HTTP web server: returns answer payload
src/vaani/web/app.py - HTTP web server → Timbre speech synthesis: synthesizes speech
src/vaani/web/app.py - Timbre speech synthesis → Gnani speech APIs: requests audio
- HTTP web server → Browser voice UI: returns answer and audio
- Browser voice UI → Market questioner: plays spoken answer