PS.Prasanjit SahaPRODUCT · TRANSFORMATION · AI

Kolkata, India · Building, learning, exploring.

Retrieval & AI experience

Dharma AI

A grounded AI conversation that connects modern dilemmas with curated wisdom, practical interpretation and clear next steps.

RAGAI orchestrationGrounded responsesResponsible AI UX
Dharma AI — Ancient Wisdom for Modern Dilemmas

The context

Dharma AI explores a product question: can an AI conversation help someone pause and think through a difficult situation without pretending to provide definitive answers? It is designed for questions about work, relationships, fear and difficult choices, where the user needs perspective rather than a generic answer.

The question behind the product

A conventional chatbot can produce fluent advice without showing what informed it, and a source-heavy experience can be slow or difficult to use. The product challenge was to make a reflective conversation feel simple while preserving source context, scope boundaries and a dependable response experience.

The hypothesis

A mobile-first, anonymous conversation that retrieves a small set of relevant curated records before generating an interpretation can make ancient source material more useful for a modern dilemma than either a search experience or an ungrounded chat response.

The product approach

1. Start with the human dilemma

The experience begins with one open question. Suggested prompts help people understand the kinds of dilemmas the product is built to handle, while the conversation remains anonymous and mobile-first.

2. Keep the request inside useful boundaries

Scope checks, session context and request limits keep the system focused on reflective dilemmas and protect the experience from turning into an unrestricted advice engine.

3. Retrieve before reasoning

For the primary path, the system searches a curated corpus of Gita passages and Mahabharata and Ramayana episodes using semantic and keyword retrieval. It locally ranks the results and uses at most three records as grounding for Gemini synthesis.

4. Design for latency, not just the ideal path

If retrieval takes too long, a timed Gemini-only backup response is prepared at 3.5 seconds and can replace the primary path at 5.5 seconds. This preserves a thoughtful structure while making clear that the alternate response has no retrieved quotation or source link.

5. Return a response that helps thinking

The structured response includes a canonical verse or episode where available, an interpretation, two ethical paths forward, first-person follow-up prompts and a Sources section.

01Human dilemma
02Scope and session controls
03Curated retrieval
04Grounded synthesis or timed fallback
05Structured response and sources

How it works

Dharma AI combines a light React and Vite interface with Firebase Hosting and Cloud Functions. Behind the chat surface is a protected orchestration layer that manages retrieval, prompt structure, response formatting, timing and fallback behaviour. The product is designed as an end-to-end AI experience rather than a single model call.

What made it difficult

The difficult part is balancing quality, source grounding and response time in the same interaction. Retrieval needs to find relevant material, the model needs enough context to interpret it without overclaiming, and the user should not be left waiting for an ideal response path that may be slow. The product therefore treats evaluation, live timing tests, regression checks, bounded usage and fallback logic as core product requirements.

What changed

The live product demonstrates two response paths: a grounded retrieval-augmented path and a timed Gemini-only fallback. Its architecture makes the distinction visible: grounded answers can surface curated source context, while the backup path keeps the conversation moving without presenting unverified quotations as evidence. Five synthetic live RAG requests measured on 10 September 2026 completed in 2.1–2.7 seconds; this is a small test sample, not a service-level guarantee.

What this work reinforces

For reflective AI products, the product decision is not only what the model says. It is how users understand the basis, limits and next step of a response. Evidence, latency handling and honest fallback behaviour all shape trust as much as the wording itself.

Try the live experiment
→KEEP EXPLORING

Connected work & ideas.