A comprehensive full-stack application that leverages multi-agent architecture and RAG-based knowledge retrieval to assist UPSC aspirants in their studies.
- 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
- 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
- React: Modern, responsive user interface
- Material-UI: Beautiful, accessible components
- Real-time Updates: WebSocket integration for live progress
- Document Ingestion: Automated text extraction and processing
- Embedding Generation: OpenAI embeddings for semantic search
- Chunking Strategy: Optimal text splitting for RAG performance
- 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
- Python 3.9+
- Node.js 16+
- Docker and Docker Compose
- OpenAI API key (or alternative LLM provider)
# 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
# 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
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
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
- Upload PDFs, notes, and research papers through the web interface
- Documents are automatically processed and indexed
- Support for batch uploads
- Use the search bar to ask UPSC-related questions
- Get AI-generated answers with key points and references
- View source documents for verification
- Generate MCQs and short-answer questions from your documents
- Track your performance and progress
- Focus on weak areas
- Monitor your study progress
- View topic coverage charts
- Identify knowledge gaps
- Searches uploaded documents using vector embeddings
- Implements semantic search for relevant content
- Returns ranked document chunks
- Generates concise, exam-focused summaries
- Extracts key points and concepts
- Maintains UPSC syllabus alignment
- Creates practice questions from retrieved content
- Generates MCQs with explanations
- Adapts difficulty based on user level
- Validates factual consistency of answers
- Cross-references multiple sources
- Ensures accuracy and reliability
POST /api/documents/upload
- Upload documentsGET /api/documents/
- List all documentsDELETE /api/documents/{id}
- Delete document
POST /api/query/
- Ask questionsGET /api/query/history
- Query history
POST /api/questions/generate
- Generate questionsGET /api/questions/
- List questionsPOST /api/questions/submit
- Submit answers
GET /api/progress/
- User progressGET /api/progress/topics
- Topic coverage
# Backend tests
cd backend
pytest
# Frontend tests
cd frontend
npm test
# Build production images
docker-compose -f docker-compose.prod.yml build
# Deploy to production
docker-compose -f docker-compose.prod.yml up -d
docker-compose.yml
- Development environmentdocker-compose.prod.yml
- Production environmentdocker-compose.test.yml
- Testing environment
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- Create an issue for bugs or feature requests
- Check the documentation for detailed guides
- Join our discussion forum
- Multi-language support
- Mobile app
- Advanced analytics dashboard
- Integration with UPSC exam schedule
- Collaborative study groups
- Offline mode support