Skip to content

AI-powered study assistant with multi-agent RAG architecture for querying, summarizing, and generating practice questions from PDFs, notes, and research materials.

Notifications You must be signed in to change notification settings

sauravbaid3/exam-prep-multi-agent-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

2 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

AI-Powered UPSC Study Assistant

A comprehensive full-stack application that leverages multi-agent architecture and RAG-based knowledge retrieval to assist UPSC aspirants in their studies.

๐Ÿš€ Features

  • Multi-Agent System: Retriever, Summarizer, Question Generator, and Critic agents
  • RAG-Based Knowledge Retrieval: Vector embeddings for semantic search across documents
  • Document Ingestion: Support for PDFs, notes, research papers, and bookmarks
  • AI-Powered Q&A: Get concise, exam-focused answers with key points
  • Practice Questions: Automatically generated MCQs and short-answer questions
  • Progress Tracking: Monitor your study progress and topic coverage

๐Ÿ—๏ธ Architecture

Backend

  • FastAPI: High-performance Python web framework
  • Multi-Agent System: LangChain-based agent orchestration
  • Vector Database: FAISS for efficient similarity search
  • LLM Integration: OpenAI/Gemini/LLaMA 2 support
  • Document Processing: PyPDF2, langchain for text extraction and chunking

Frontend

  • React: Modern, responsive user interface
  • Material-UI: Beautiful, accessible components
  • Real-time Updates: WebSocket integration for live progress

Data Pipeline

  • Document Ingestion: Automated text extraction and processing
  • Embedding Generation: OpenAI embeddings for semantic search
  • Chunking Strategy: Optimal text splitting for RAG performance

๐Ÿ› ๏ธ Tech Stack

  • Backend: Python 3.9+, FastAPI, LangChain, FAISS, PyPDF2
  • Frontend: React 18, Material-UI, Axios
  • Database: FAISS (vector), SQLite (metadata)
  • AI/ML: OpenAI API, LangChain agents
  • Deployment: Docker, Docker Compose

๐Ÿ“‹ Prerequisites

  • Python 3.9+
  • Node.js 16+
  • Docker and Docker Compose
  • OpenAI API key (or alternative LLM provider)

๐Ÿš€ Quick Start

Option 1: Docker (Recommended)

# Clone the repository
git clone <your-repo-url>
cd resume_upsc

# Set environment variables
cp .env.example .env
# Edit .env with your API keys

# Run the entire stack
docker-compose up -d

# Access the application
# Frontend: http://localhost:3000
# Backend: http://localhost:8000
# API Docs: http://localhost:8000/docs

Option 2: Local Development

# Backend setup
cd backend
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
pip install -r requirements.txt
uvicorn main:app --reload

# Frontend setup
cd frontend
npm install
npm start

๐Ÿ“ Project Structure

resume_upsc/
โ”œโ”€โ”€ backend/                 # FastAPI backend
โ”‚   โ”œโ”€โ”€ app/
โ”‚   โ”‚   โ”œโ”€โ”€ agents/         # Multi-agent system
โ”‚   โ”‚   โ”œโ”€โ”€ api/            # API endpoints
โ”‚   โ”‚   โ”œโ”€โ”€ core/           # Configuration and utilities
โ”‚   โ”‚   โ”œโ”€โ”€ models/         # Data models
โ”‚   โ”‚   โ”œโ”€โ”€ services/       # Business logic
โ”‚   โ”‚   โ””โ”€โ”€ utils/          # Helper functions
โ”‚   โ”œโ”€โ”€ data/               # Document storage
โ”‚   โ”œโ”€โ”€ embeddings/         # Vector embeddings
โ”‚   โ””โ”€โ”€ main.py            # Application entry point
โ”œโ”€โ”€ frontend/               # React frontend
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”œโ”€โ”€ components/     # UI components
โ”‚   โ”‚   โ”œโ”€โ”€ pages/          # Page components
โ”‚   โ”‚   โ”œโ”€โ”€ services/       # API services
โ”‚   โ”‚   โ””โ”€โ”€ utils/          # Helper functions
โ”‚   โ””โ”€โ”€ public/             # Static assets
โ”œโ”€โ”€ scripts/                # Utility scripts
โ”œโ”€โ”€ docker-compose.yml      # Docker orchestration
โ””โ”€โ”€ README.md              # This file

๐Ÿ”ง Configuration

Environment Variables

Create a .env file in the root directory:

# OpenAI Configuration
OPENAI_API_KEY=your_openai_api_key_here
OPENAI_MODEL=gpt-4

# Alternative LLM Providers
GEMINI_API_KEY=your_gemini_api_key_here
ANTHROPIC_API_KEY=your_anthropic_api_key_here

# Database Configuration
DATABASE_URL=sqlite:///./upsc_assistant.db

# Vector Store Configuration
EMBEDDING_MODEL=text-embedding-ada-002
CHUNK_SIZE=1000
CHUNK_OVERLAP=200

# Server Configuration
HOST=0.0.0.0
PORT=8000
DEBUG=True

๐Ÿ“š Usage

1. Document Upload

  • Upload PDFs, notes, and research papers through the web interface
  • Documents are automatically processed and indexed
  • Support for batch uploads

2. Ask Questions

  • Use the search bar to ask UPSC-related questions
  • Get AI-generated answers with key points and references
  • View source documents for verification

3. Practice Questions

  • Generate MCQs and short-answer questions from your documents
  • Track your performance and progress
  • Focus on weak areas

4. Progress Tracking

  • Monitor your study progress
  • View topic coverage charts
  • Identify knowledge gaps

๐Ÿค– Multi-Agent System

Retriever Agent

  • Searches uploaded documents using vector embeddings
  • Implements semantic search for relevant content
  • Returns ranked document chunks

Summarizer Agent

  • Generates concise, exam-focused summaries
  • Extracts key points and concepts
  • Maintains UPSC syllabus alignment

Question Generator Agent

  • Creates practice questions from retrieved content
  • Generates MCQs with explanations
  • Adapts difficulty based on user level

Critic Agent

  • Validates factual consistency of answers
  • Cross-references multiple sources
  • Ensures accuracy and reliability

๐Ÿ” API Endpoints

Document Management

  • POST /api/documents/upload - Upload documents
  • GET /api/documents/ - List all documents
  • DELETE /api/documents/{id} - Delete document

Knowledge Query

  • POST /api/query/ - Ask questions
  • GET /api/query/history - Query history

Practice Questions

  • POST /api/questions/generate - Generate questions
  • GET /api/questions/ - List questions
  • POST /api/questions/submit - Submit answers

Progress Tracking

  • GET /api/progress/ - User progress
  • GET /api/progress/topics - Topic coverage

๐Ÿงช Testing

# Backend tests
cd backend
pytest

# Frontend tests
cd frontend
npm test

๐Ÿš€ Deployment

Production Deployment

# Build production images
docker-compose -f docker-compose.prod.yml build

# Deploy to production
docker-compose -f docker-compose.prod.yml up -d

Environment-Specific Configs

  • docker-compose.yml - Development environment
  • docker-compose.prod.yml - Production environment
  • docker-compose.test.yml - Testing environment

๐Ÿค Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests
  5. Submit a pull request

๐Ÿ“„ License

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

๐Ÿ†˜ Support

๐Ÿ”ฎ Roadmap

  • Multi-language support
  • Mobile app
  • Advanced analytics dashboard
  • Integration with UPSC exam schedule
  • Collaborative study groups
  • Offline mode support

About

AI-powered study assistant with multi-agent RAG architecture for querying, summarizing, and generating practice questions from PDFs, notes, and research materials.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published