top | item 46179344

Show HN: Geetanjali – RAG-powered ethical guidance from the Bhagavad Gita

7 points| vnykmshr | 2 months ago |geetanjaliapp.com

I built a RAG application that retrieves relevant Bhagavad Gita verses for ethical dilemmas and generates structured guidance.

The problem: The Gita has 701 verses. Finding applicable wisdom for a specific situation requires either deep familiarity or hours of reading.

How it works: 1. User describes their ethical dilemma 2. Query is embedded using sentence-transformers 3. ChromaDB retrieves top-k semantically similar verses 4. LLM generates structured output: 3 options with tradeoffs, implementation steps, verse citations

Tech stack: - Backend: FastAPI, PostgreSQL, Redis - Vector DB: ChromaDB with all-MiniLM-L6-v2 embeddings - LLM: Ollama (qwen2.5:3b) primary, Anthropic Claude fallback - Frontend: React + TypeScript + Tailwind

Key design decisions: - RAG to prevent hallucination — every recommendation cites actual verses - Confidence scoring flags low-quality outputs for review - Structured JSON output for consistent UX - Local LLM option for privacy and zero API costs

What I learned: - LLM JSON extraction is harder than expected. Built a three-layer fallback (direct parse → markdown block extraction → raw_decode scanning) - Semantic search on religious texts works surprisingly well for ethical queries - Smaller models (3B params) work fine when constrained by good prompts and retrieved context

GitHub: https://github.com/geetanjaliapp/geetanjali

Happy to discuss the RAG architecture or take feedback.

4 comments

order

prtmnth|2 months ago

Thank you for open sourcing and sharing the GitHub repo. As someone actively trying to upgrade my skills when it comes to coding and building apps, this is really useful.

vnykmshr|2 months ago

You are welcome! I'm really glad to hear it's useful for your learning journey. Feel free to reach out if you have any questions while exploring the code. You can also check out - docs.geetanjaliapp.com