Back to Projects
SOM.ai
CompletedNext.js 14TypeScriptPython+10 more

SOM.ai

Vedic intelligence engine grounded in the Bhagavad Gita. The AI system that delivers philosophical clarity for complex decisions. No generic advice, no filler just timeless wisdom.

Timeline

7 Weeks

Role

Full Stack AI Engineer

Team

Solo

Status
Completed

Technology Stack

Next.js 14
TypeScript
Python
FastAPI
PostgreSQL
pgvector
RAG
Multi-Agent Orchestration
Tailwind CSS
Groq API
LLaMA
Vector Search
Moderation Layer

Key Challenges

  • RAG Pipeline over a Fixed Philosophical Canon
  • Multi-Agent Reasoning Chain Architecture
  • pgvector-Backed Semantic Search
  • Context-Aware Verse Retrieval
  • Structured Output (Meaning → Apply → Reflect)
  • Conversation Memory Across Sessions
  • Safety Moderation Layer for Sensitive Queries

Key Learnings

  • Retrieval-Augmented Generation (RAG) Design
  • pgvector Embedding & Similarity Search
  • Multi-Agent Orchestration Patterns
  • LLM Prompt Engineering for Philosophical Reasoning
  • Next.js 14 App Router Architecture
  • Grounding LLMs in a Fixed Knowledge Canon
  • Output Structuring for Actionable AI Responses

Summary

"Think Clearer. Decide Better." SOM.ai is a Vedic intelligence engine grounded in the Bhagavad Gita , a philosophical reasoning system built for people who think for a living. No surface-level advice. No generic platitudes. Just timeless clarity. With 700 verses indexed and instantly searchable, an 8-agent reasoning chain, and a RAG pipeline backed by pgvector, SOM.ai transforms your real-world struggles into grounded, actionable wisdom in under 5 seconds.


Features

  • Vedic Intelligence Core — Every answer is matched to a specific Bhagavad Gita verse, not scraped from random web pages
  • Structured Output — Responses follow a three-part format: Meaning Synthesis → Apply Today → Reflect
  • Multi-Agent Reasoning — 8 specialized agents collaborate on context retrieval, synthesis, and moderation
  • RAG + Vector Search — pgvector-backed semantic search across all 700 Gita verses for precise retrieval
  • Conversation Memory — Remembers your full journey across sessions, not just the last few messages
  • Safety Moderation — Active moderation layer ensures responsible, grounded output for sensitive queries
  • Instant Recall — Sub-5-second response time from query to philosophical insight

Architecture with Real-Life Use Case

The Vedic Intelligence Pipeline

When a user says: "My startup is pivoting and I feel like a failure."

  1. Query Intake & Sanitization (instant) → Input is parsed and moderated for context
  2. Semantic Verse Retrieval (< 1 sec) → pgvector search finds the most relevant Gita verse(s)
  3. Multi-Agent Reasoning Chain (2–3 sec) → 8 agents collaborate on meaning, application, and reflection
  4. Structured Synthesis (instant) → Output is formatted as Meaning → Apply → Reflect
  5. Moderation Pass (instant) → Safety layer validates response before delivery
  6. Session Memory Update (instant) → Conversation context is persisted for continuity

Total: < 5 seconds vs. years of trial-and-error, therapy queues, or hollow internet advice

Real-World Outcome

Generic AI Approach:

"Take a deep breath." "Have you tried journaling?" "Consider talking to someone."

Surface-level. Forgettable. Treats the symptom, not the cause.

SOM.ai Approach:

User asks: "My startup is pivoting and I feel like a failure."

Results in < 5 seconds:

  1. Verse Retrieved: Bhagavad Gita 2.47 — "You have a right to perform your prescribed duty, but you are not entitled to the fruits of action."
  2. Meaning Synthesis: Anxiety stems from obsessing over outcomes outside your control. Reclaim agency by focusing strictly on execution.
  3. Apply Today: Define success today entirely by the effort expended on your deepest work block — disregard external validation.
  4. Reflect: "What outcome are you mentally attaching to right now that is causing friction?"

Result: Root-cause clarity grounded in 5,000 years of philosophical truth.


Tech Stack

  • Frontend: Next.js 14 (App Router), TypeScript, Tailwind CSS
  • Backend: FastAPI, Python, SQLAlchemy (async)
  • AI / RAG: Groq API (LLaMA), pgvector, Retrieval-Augmented Generation
  • Database: PostgreSQL with pgvector extension
  • Architecture: Multi-agent orchestration, context-aware synthesis, moderation layer

Key Technical Achievements

  • Fixed Philosophical Canon: Unlike general-purpose LLMs, SOM.ai is grounded exclusively in the 700 verses of the Bhagavad Gita — eliminating hallucinations and ensuring every response has a traceable source
  • 8-Agent Reasoning Engine: Specialized agents handle retrieval, synthesis, application framing, reflection prompting, memory management, moderation, and more
  • pgvector Semantic Search: Verse embeddings are stored in PostgreSQL via pgvector, enabling meaning-level similarity search far beyond keyword matching
  • Structured Output Format: Every response is intentionally shaped into three actionable layers — Meaning, Apply, and Reflect — making wisdom immediately usable
  • Conversation Memory: Full session history is retained, enabling SOM.ai to track your mental and philosophical journey over time

Architecture Highlights

Vedic RAG Pipeline:

User Query → Sanitization → Embedding Generation →
pgvector Semantic Search → Verse Retrieval →
Multi-Agent Reasoning Chain → Structured Synthesis →
Moderation Pass → Final Response

Architecture Comparison

  • Where answers come from

    • Typical AI: Scraped from random web pages
    • SOM.ai: Matched to a specific Gita verse
  • What you actually get

    • Typical AI: A wall of text
    • SOM.ai: Meaning → Apply → Reflect
  • Conversation memory

    • Typical AI: Forgets after a few messages
    • SOM.ai: Remembers your full journey
  • Depth of thinking

    • Typical AI: One-shot answer
    • SOM.ai: Multi-agent reasoning chain

Real-World Impact Example

Founders, Engineers & Therapists

The Problem with Generic AI:

  • Produces engagement-optimized answers, not truth-optimized ones
  • No philosophical grounding — answers shift based on phrasing
  • Surface-level coping advice that treats symptoms, not root causes
  • Forgets context between sessions; no continuity of thought

With SOM.ai:

  • Every answer is traceable to a specific Gita verse with a 5,000-year track record
  • Multi-agent reasoning pinpoints the root cause of your mental friction
  • Structured output gives you something concrete to act on today
  • Session memory means SOM.ai grows more useful the more you use it

Built for people who think for a living : the founders making high-stakes pivots, the engineers debugging their decision-making, the therapists seeking evidence-backed philosophical frameworks for their clients.


Development Journey

Technical Challenges Overcome

  1. Grounding an LLM in a Fixed Canon

    • Problem: General LLMs hallucinate and drift from authoritative sources
    • Solution: RAG pipeline strictly limits retrieval to the 700 indexed Gita verses via pgvector similarity search
  2. Multi-Agent Coordination at Speed

    • Problem: Chaining 8 agents risks compounding latency and coherence loss
    • Solution: Async FastAPI architecture with parallel agent execution where possible, keeping responses under 5 seconds
  3. Meaning-Level Verse Retrieval

    • Problem: Keyword search misses semantically relevant verses
    • Solution: Sentence-level embeddings stored in pgvector enable meaning-aware retrieval even for abstract emotional queries
  4. Structuring Philosophical Output for Action

    • Problem: Raw verse translations are cryptic and hard to apply to modern problems
    • Solution: Dedicated synthesis and application agents transform ancient text into a three-part actionable framework
  5. Conversation Memory Without Context Bloat

    • Problem: Full history injection bloats the context window and slows reasoning
    • Solution: Memory agent maintains a compressed session summary that preserves continuity without sacrificing speed

Performance Benchmarks

  • Average Response Time

    • Target: < 10 sec
    • Achieved: < 5 sec
  • Verses Indexed

    • Target: 700
    • Achieved: 700 (complete Bhagavad Gita)
  • Moderation Coverage

    • Target: Key sensitive categories
    • Achieved: Active moderation on every response

Resources & Links

For Employers & Collaborators

What This Project Demonstrates:

  • RAG Systems Engineering: Production-grade retrieval pipeline grounded in a fixed philosophical canon with pgvector
  • Multi-Agent Architecture: 8-agent orchestration system handling retrieval, synthesis, application, memory, and moderation
  • LLM Prompt Engineering: Structured output design translating ancient text into modern, actionable three-part responses
  • Semantic Search: pgvector-backed embedding search enabling meaning-level verse retrieval from a 700-verse corpus
  • Product Philosophy: Opinionated AI product design and grounding intelligence in truth, not engagement optimization
  • Full-Stack Ownership: End-to-end architecture from RAG pipeline to Next.js 14 frontend

Contact: Available for technical interviews or architecture deep-dives


Project Status

Current: Live at som.ai.thevanshgarg.com
Corpus: 700 Gita verses indexed • 8 reasoning agents • < 5s response time
Next Milestones:

  • Expanded verse corpus with Upanishads and Stoic philosophy
  • Personalized insight tracking and journaling layer
  • Team / shared session features for coaching use cases
  • API access for therapists and mental health practitioners