Inspiration

The Mahapuranas contain stories and teachings related to real-life challenges such as relationships, leadership, duty, justice, grief, and decision-making. However, their vast content can make it difficult for modern users to find stories relevant to their situations. This inspired us to build ScriptureRAG, which connects modern life situations with relevant Mahapurana wisdom.

What it does

ScriptureRAG allows users to describe their situation in natural language. It analyzes the query, identifies its key themes, and retrieves relevant Mahapurana stories using RAG. An LLM then explains the connection, lesson, and outcome of the retrieved stories while providing scriptural citations. The system focuses on reflection rather than directly making decisions for the user.

How we built it

We built the system using a Mahapurana knowledge base, semantic embeddings, ChromaDB for vector search, and a cross-encoder re-ranker to improve retrieval. A two-layer guardrail checks whether queries are relevant to the domain. Gemini 3.6 Flash is used for grounded response generation, followed by citation and faithfulness validation using RAGAS.

Challenges we ran into

Developing ScriptureRAG involved handling the large volume of Mahapurana content, preparing meaningful text chunks for retrieval, and finding stories that closely match a user's situation. We also had to reduce unsupported responses, maintain accurate scriptural references, and ensure that the system stays focused on Mahapurana-related queries.

Accomplishments that we're proud of

We built a domain-specific conversational AI focused on the Mahapuranas and implemented a complete RAG pipeline with semantic retrieval and re-ranking. We also added input guardrails and output validation to improve reliability. Most importantly, the system connects ancient stories with modern-life situations in a simple and understandable way.

What we learned

Through this project, we learned how to build a complete RAG pipeline and how embeddings and vector databases support semantic search. We also gained practical experience with re-ranking, guardrails, citation checking, and faithfulness evaluation. We learned how to design an AI system that encourages reflection rather than making personal decisions for the user.

What's next for ScriptureRAG

We plan to expand the Mahapurana knowledge base, improve retrieval and citation accuracy, and support multiple Indian languages such as Telugu and Hindi. We also aim to add richer conversational and voice-based interaction, strengthen evaluation of story relevance and faithfulness, and explore multimodal ways to learn and explore Mahapurana stories.

Built With

  • bge-embeddings
  • chromadb
  • cosine-similarity
  • cross-encoder
  • gemini-flash
  • generative-ai
  • google-gemini
  • guardrails-ai
  • hnsw
  • html5-web-speech-api
  • hugging-face
  • large-language-models
  • natural-language-processing
  • prompt-engineering
  • pypdf2
  • python
  • pytorch
  • rag
  • ragas
  • semantic-search
  • sentence-transformers
  • streamlit
  • streamlit-cloud
  • vector-database
Share this project:

Updates