Skip to content

About

Resources

Stars

1 star

Watchers

0 watching

Forks

 
 

Latest commit

 

History

103 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🔮 SecularAi

🪷 Ancient wisdom, modern tech. Chat with the Bhagavad Gita.

🚀 Try it live → secular-ai.vercel.app


🎯 The Idea

Ever wanted to ask the Gita a question without flipping through 700 verses?

This chatbot gets it. Type your question in plain English, and it pulls the most relevant verses, then explains them using Retrieval-Augmented Generation.

No hallucinations. No generic wisdom. Just grounded answers from the actual text.

    🧘
   /|\    "What should
   / \     I do about fear?"
    
    ↓
    
   🤖 SecularAi
   
   ↓
   
  📖 "Chapter 2, Verse 56
     speaks about..."



💎 Features That Matter


🔍 💬 🎯
Semantic Search Memory Zero BS
Natural language queries Remembers conversation Grounded in actual verses
⚡ 🎨 📱
Streaming Clean UI Responsive
Real-time responses No clutter Works everywhere



⚡ Architecture


┌──────────────────────────────────────────────────────────────────┐
│                                                                  │
│  👤 YOU                                                          │
│  │  "What does Krishna say about dharma?"                       │
│  │                                                               │
│  ↓                                                               │
│  🧠 MISTRAL EMBEDDINGS                                           │
│  │  Query → Vector [0.234, 0.891, ...]                          │
│  │                                                               │
│  ↓                                                               │
│  🗄️  PINECONE                                                     │
│  │  Search 10,000+ pre-embedded Gita chunks                     │
│  │  Return top 5 most similar verses                            │
│  │                                                               │
│  ↓                                                               │
│  📦 CONTEXT BUILDER                                              │
│  │  Combine: Retrieved verses + Chat history + Your query       │
│  │                                                               │
│  ↓                                                               │
│  🤖 GROQ (LLAMA MODEL)                                           │
│  │  Generate answer grounded in retrieved context               │
│  │                                                               │
│  ↓                                                               │
│  💬 STREAM RESPONSE                                              │
│  │  "In Chapter 3, Krishna explains..."                         │
│                                                                  │
└──────────────────────────────────────────────────────────────────┘

+ Gita PDF pre-chunked and embedded in vector DB
+ Query → Embed → Search → Retrieve → Generate → Stream
+ Context stays in chat memory for follow-up questions
- No hallucinations because answers are grounded in retrieved text



🧰 Built With


🎨 Frontend

Next.js 14
App Router + React Server Components

TailwindCSS
Utility-first styling

Vercel AI SDK
Streaming chat UI primitives

⚙️ Backend

FastAPI
Python async API framework

LangChain
RAG orchestration & memory

Uvicorn
Lightning-fast ASGI server

🤖 AI Stack

Groq API
Llama model for generation

Mistral Embeddings
Vector representations

Pinecone
Managed vector database




🚀 Run It Locally


Backend Setup

cd backend

# Create virtual environment
python -m venv venv
source venv/bin/activate

# Install dependencies
pip install -r requirements.txt

# Run server
uvicorn main:app --reload

Server runs on: http://localhost:8000

Frontend Setup

cd frontend

# Install dependencies
npm install

# Run dev server
npm run dev

App runs on: http://localhost:3000


🔐 Environment Variables (click to expand)

Backend .env

GROQ_API_KEY=your_groq_key_here
PINECONE_API_KEY=your_pinecone_key_here
PINECONE_INDEX_NAME=gitarag
MISTRAL_API_KEY=your_mistral_key_here

Frontend .env.local

NEXT_PUBLIC_API_URL=http://localhost:8000



🤝 Contributing

Want to improve this? PRs are welcome.
Keep code clean, follow existing patterns.




📝 Note: Open for educational use only.




Built with modern AI tools to make ancient philosophy more accessible ✨

Bhagavad Gita text is in public domain

About

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages