Skip to content

Samvaad is a speech-driven AI tutor that transforms PDFs, articles, and notes into interactive learning. People learn better through dialogue, and we are here to facilitate that.

License

Notifications You must be signed in to change notification settings

atharva-again/samvaad

Repository files navigation

Samvaad (संवाद)

Dialogue-Based Learning Facilitated by Real-Time AI

Samvaad is a sophisticated, full-stack Retrieval-Augmented Generation (RAG) platform that transforms static documents into interactive, dialogue-driven learning experiences. By combining state-of-the-art vector retrieval with ultra-low-latency WebRTC voice conversations, Samvaad allows you to talk to your knowledge—literally.

Key Features

  • Real-Time Voice Mode: Ultra-low latency voice conversations using WebRTC (Daily) and the Pipecat framework. Interact naturally with your documents using voice.
  • Deep RAG Pipeline: Advanced document ingestion supporting PDF, Docx, Images (OCR), and more via LlamaParse and Docling.
  • Intelligent Deduplication: Content-addressable storage (SHA-256) ensures zero-redundancy in document chunks across users.
  • Multi-Model Intelligence: Optimized for Gemini, Groq, and OpenAI, with high-quality embeddings via Voyage AI.
  • Neural TTS & STT: Crystal-clear speech synthesis and high-accuracy transcription using Deepgram for a human-like conversational experience.
  • Verified Citations: Every claim is backed by atomic citations linked directly to your source documents to eliminate hallucinations.
  • Modern Full-Stack Architecture: A high-performance FastAPI backend paired with a premium Next.js 15+ frontend.

Tech Stack

Backend (Python)

  • Framework: FastAPI (Asynchronous, High Performance)
  • Package Manager: uv (Extremely fast Python package installer)
  • Database: PostgreSQL with pgvector (Vector similarity search)
  • Voice Framework: Pipecat & Daily
  • AI/LLM: Google Gemini, Voyage AI (Embeddings), Deepgram (STT/TTS)

Frontend (TypeScript)

  • Framework: Next.js 15 (App Router)
  • Styling: Tailwind CSS with a custom "Void" Dark Theme
  • UI Components: Shadcn/ui & Framer Motion
  • Auth: Supabase (OAuth & Email)

Getting Started

Prerequisites

  • Python 3.11+
  • Node.js 18+ & pnpm
  • Supabase Account
  • API Keys: Gemini, Voyage AI, Deepgram, Daily, Supabase

Installation

  1. Clone the repository:

    git clone https://github.com/atharva-again/samvaad.git
    cd samvaad
  2. Setup Backend:

    # Install uv if you haven't
    curl -LsSf https://astral.sh/uv/install.sh | sh
    
    # Sync dependencies and create venv
    uv sync
  3. Setup Frontend:

    cd frontend
    pnpm install

Configuration

Create a .env file in the root directory (for backend) and frontend/.env.local (for frontend).

Backend .env:

# AI & Pipeline
GEMINI_API_KEY=...
VOYAGE_API_KEY=...
DEEPGRAM_API_KEY=...
DAILY_API_KEY=...

# Database
DATABASE_URL=...
SUPABASE_URL=...
SUPABASE_SERVICE_ROLE_KEY=...

Development

Run Backend

# From the root
uvicorn samvaad.api.main:app --reload

Run Frontend

# From the frontend directory
pnpm dev

Interactive CLI (Internal testing)

# From the root
samvaad

Project Structure

.
├── samvaad/           # Core Backend Logic
│   ├── api/           # FastAPI Routes & App Initialization
│   ├── core/          # Shared Logic (Auth, Memory, Unified Context)
│   ├── db/            # Database Models & Service Layer (pgvector)
│   ├── pipeline/      # RAG Pipeline (Ingestion, Retrieval, Deletion)
│   ├── prompts/       # AI Personas & System Prompt Engineering
│   └── utils/         # Citation Handling, Text Processing, Hashing
├── frontend/          # Next.js Application
├── tests/             # Pytest Unit & Integration Suites
├── PLANS/             # Living Architecture & Development Roadmap
└── AGENTS.md          # Developer Knowledge Base for AI Assistants

Developer Knowledge Base

This project maintains a hierarchical set of AGENTS.md files that act as a "source of truth" for code conventions, architecture, and anti-patterns.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Samvaad is a speech-driven AI tutor that transforms PDFs, articles, and notes into interactive learning. People learn better through dialogue, and we are here to facilitate that.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published