Anugamana — अनुगमन
Type what you're going through — get the Bhagavad Gita verse that answers it. Semantic search across 700 verses in 10 languages, grounded strictly in Prabhupada's purport.
Stack: FastAPI, ChromaDB, BGE-M3, HyDE, Claude Haiku 4.5, React, Sarvam
GitHub · Live
The problem: A user types "I'm paralyzed by fear of making the wrong decision." The most relevant verse says: "You have a right to perform your prescribed duties, but you are not entitled to the fruits of your actions." These share zero vocabulary. Every existing Gita search tool fails this query.
Synthetic semantic enrichment: Before indexing, every verse gets four meaning fields generated by Claude: real-world situations it applies to, emotional states it addresses, the core teaching, and philosophical concepts. These fields are what gets embedded and searched, not the Sanskrit translation. A 21st-century query lands in the same vector space as these modern-language fields.
HyDE: For each query, Claude generates a hypothetical Prabhupada commentary, then that commentary is embedded instead of the raw query. This moves the query vector from casual-language space into Gita-commentary space, where the indexed purports actually live.
Full pipeline: input guardrail (Claude Haiku, on-topic classifier) → query routing (direct verse lookup, Sanskrit fast-path, or full semantic) → HyDE + query expansion in parallel → hybrid retrieval across two ChromaDB collections and a sparse index (all BGE-M3) → RRF fusion → cross-encoder reranking → MMR diversity pass → confidence threshold → RAG generation with Claude Haiku, strictly grounded in Prabhupada's purport.
Every stage degrades gracefully: if HyDE fails it embeds the raw query, if the reranker fails it falls back to RRF scores. The system never returns a 500.
Faithfulness: Claude's generation prompt limits guidance to the retrieved verse and commentary. Nothing is invented. An async LLM-as-judge scores every response for faithfulness and logs it to a feedback loop.
Research: The core claim is that synthetic semantic enrichment outperforms baseline sparse search on queries where user vocabulary and verse vocabulary share no overlap. This is the subject of a paper targeting EMNLP 2026.
swayam.codes