Name: Rahul Raj
Institute : Indian Institute of Technology Bhilai
Department : Computer Science and Engineering
An Intelligent Study Companion Powered by Multi-Agent AI
StudyBuddy AI transforms static documents into interactive, adaptive learning experiences using advanced AI technologies. Upload your PDFs and Excel files to get personalized tutoring, automated study plans, AI-powered flashcards, and intelligent document analysis.
- ConductorAgent: Intelligent workflow orchestration and intent analysis
- TutorAgent: Personalized educational responses with source attribution
- PlannerAgent: Structured study plan generation with timelines
- SearchAgent: Web search integration for enhanced learning resources
- FlashcardAgent: Spaced repetition system with adaptive difficulty
- Smart Upload: Support for PDF, Excel, and DOCX files
- Semantic Search: Vector-based similarity search across documents
- Context-Aware Chat: Ask questions and get answers with page references
- Automatic Processing: Intelligent chunking and embedding generation
- AI Study Plans: Comprehensive, personalized learning paths
- Smart Flashcards: Auto-generated cards with spaced repetition
- Progress Dashboard: Visual analytics and learning statistics
- Interactive Chat: Real-time AI tutoring with workflow visualization
- Responsive Design: Works seamlessly on desktop and mobile
- Dark/Light Mode: Adaptive theming for comfortable studying
- Smooth Animations: Framer Motion powered interactions
- Real-time Updates: Live feedback and progress tracking
- Docker & Docker Compose (recommended)
- Python 3.10+ (for development)
- Node.js 16+ (for frontend development)
- OpenAI API Key (Get one here)
-
Clone the repository
git clone (https://github.com/Rahul5977/StudyBot) cd StudyBuddy -
Set up environment variables
cp .env.example .env # Edit .env and add your OpenAI API key -
Start all services
docker-compose up --build
-
Access the application
- Frontend: http://localhost:3000
- Backend API: http://localhost:8000
- API Documentation: http://localhost:8000/docs
- Qdrant Vector DB: http://localhost:6333
-
Backend Setup
cd backend python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate pip install -r requirements.txt # Start Qdrant with Docker docker run -p 6333:6333 qdrant/qdrant:latest # Start backend server uvicorn app.main:app --reload --port 8000
-
Frontend Setup
cd frontend npm install npm start
graph TB
subgraph "Frontend Layer"
A[React + Tailwind UI]
B[Framer Motion Animations]
C[Real-time State Management]
end
subgraph "API Gateway"
D[FastAPI Backend]
E[Authentication Middleware]
F[Rate Limiting & CORS]
end
subgraph "AI Engine - LangGraph Multi-Agent System"
G[ConductorAgent - Orchestrator]
G --> H[TutorAgent - Educational AI]
G --> I[PlannerAgent - Study Plans]
G --> J[SearchAgent - Web Search]
G --> K[FlashcardAgent - Spaced Repetition]
end
subgraph "Data Processing Pipeline"
L[Document Parser]
M[Semantic Chunker]
N[Embedding Generator]
O[Vector Indexer]
end
subgraph "Storage Layer"
P[Qdrant Vector DB]
Q[Local File System]
R[JSON Configuration]
S[Interaction Logs]
end
subgraph "External Services"
T[OpenAI API]
U[Tavily Search API]
end
A --> D
D --> G
G --> T
J --> U
H --> P
I --> P
L --> M --> N --> O --> P
D --> Q
D --> R
D --> S
graph TB
subgraph "Frontend Layer"
A[React + Tailwind UI]
B[Framer Motion Animations]
C[Real-time State Management]
end
subgraph "API Gateway"
D[FastAPI Backend]
E[CORS & Rate Limiting]
end
subgraph "AI Engine - Multi-Agent System"
F[ConductorAgent - Orchestrator]
F --> G[TutorAgent - Educational AI]
F --> H[PlannerAgent - Study Plans]
F --> I[SearchAgent - Web Search]
F --> J[FlashcardAgent - Spaced Repetition]
end
subgraph "Data Processing"
K[Document Parser]
L[Semantic Chunker]
M[Embedding Generator]
end
subgraph "Storage"
N[Qdrant Vector DB]
O[Local File System]
end
subgraph "External APIs"
P[OpenAI API]
Q[Tavily Search API]
end
A --> D
D --> F
F --> P
I --> Q
G --> N
H --> N
K --> L --> M --> N
| Component | Technology | Purpose |
|---|---|---|
| Frontend | React 18, Tailwind CSS, Framer Motion | Modern, responsive UI with smooth animations |
| Backend | FastAPI, Python 3.10+ | High-performance async API server |
| AI Framework | LangChain, LangGraph, OpenAI | Multi-agent orchestration and LLM integration |
| Vector DB | Qdrant | Fast similarity search and document retrieval |
| Document Processing | PyPDF2, pandas, openpyxl | Extract and process various file formats |
| Containerization | Docker, Docker Compose | Consistent development and deployment |
StudyBuddy/
βββ π backend/ # FastAPI backend application
β βββ π app/
β β βββ π agents/ # Multi-agent AI system
β β β βββ conductor.py # Main orchestrator agent
β β β βββ planner.py # Study plan generation
β β β βββ search_agent.py # Web search integration
β β βββ π api/ # API route handlers
β β β βββ routes_chat.py
β β β βββ routes_docs.py
β β β βββ routes_plan.py
β β β βββ routes_flashcards.py
β β βββ π core/ # Core services and utilities
β β β βββ config.py # Configuration management
β β β βββ db.py # Database connections
β β β βββ logger.py # Logging setup
β β βββ π services/ # Business logic services
β β βββ simple_rag.py # RAG pipeline
β β βββ embeddings.py # Vector embeddings
β βββ requirements.txt
β βββ Dockerfile
βββ π frontend/ # React frontend application
β βββ π src/
β β βββ π components/ # React components
β β β βββ Dashboard.jsx # Analytics dashboard
β β β βββ ChatBox.jsx # AI chat interface
β β β βββ Flashcards.jsx # Spaced repetition system
β β β βββ UploadForm.jsx # File upload handling
β β βββ π pages/ # Page components
β β β βββ Home.jsx # Main application layout
β β βββ π utils/ # Utility functions
β β βββ api.js # API communication
β βββ package.json
β βββ tailwind.config.js
βββ π data/ # Processed documents and metadata
βββ π storage/ # Uploaded files storage
βββ π logs/ # Application logs
βββ docker-compose.yml # Multi-service orchestration
βββ .env.example # Environment variables template
βββ README.md # Project documentation
Create a .env file in the project root:
# OpenAI Configuration
OPENAI_API_KEY=sk-your-openai-api-key-here
# Tavily Search API (optional)
TAVILY_API_KEY=your-tavily-api-key
# Qdrant Configuration
QDRANT_HOST=localhost
QDRANT_PORT=6333
QDRANT_COLLECTION=studybuddy_docs
# Application Settings
DEBUG=true
MAX_FILE_SIZE=52428800 # 50MB
CHUNK_SIZE=1000
CHUNK_OVERLAP=200
# CORS Settings
ALLOWED_ORIGINS=http://localhost:3000,http://localhost:3002Update frontend/src/utils/api.js if needed:
const API_BASE_URL = process.env.REACT_APP_API_URL || "http://localhost:8000";- Navigate to the Upload Documents tab
- Drag and drop or select PDF/Excel files
- Wait for processing to complete
- View processed documents in the file list
- Go to the AI Chat tab
- Ask questions about your uploaded documents
- View real-time agent workflow steps
- Get responses with source page references
Example queries:
- "Explain the main concepts in this document"
- "Create a summary of chapter 3"
- "What are the key formulas mentioned?"
- Switch to the Study Plans tab
- Enter a topic (e.g., "Machine Learning Fundamentals")
- Click "Generate Plan" to create a structured learning path
- Edit and customize the generated plan
- Visit the Flashcards tab
- Generate flashcards from your documents
- Review cards with spaced repetition algorithm
- Rate difficulty to improve future scheduling
Monitor your learning progress:
- Study plan completion rates
- Flashcard review statistics
- Recent activity timeline
- Document processing status
POST /api/documents/upload # Upload and process documents
GET /api/documents # List all documents
GET /api/documents/{id} # Get document details
DELETE /api/documents/{id} # Remove documentPOST /api/chat # Send message to AI
GET /api/chat/history # Get conversation history
GET /api/chat/logs # Get interaction logsPOST /api/plan/create # Generate study plan
GET /api/plans # List user plans
PUT /api/plans/{id} # Update existing planGET /api/flashcards # Get due flashcards
POST /api/flashcards/generate # Generate new flashcards
POST /api/flashcards/review # Submit review result
GET /api/flashcards/stats # Get learning statistics// Upload a document
const formData = new FormData();
formData.append("file", selectedFile);
const response = await fetch("http://localhost:8000/api/documents/upload", {
method: "POST",
body: formData,
});
// Send chat message
const chatResponse = await fetch("http://localhost:8000/api/chat", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
message: "Explain machine learning concepts",
session_id: "unique-session-id",
}),
});cd backend
python -m pytest tests/ -v
# Run specific test categories
python -m pytest tests/test_agents.py -v # Agent tests
python -m pytest tests/test_api.py -v # API tests
python -m pytest tests/test_integration.py -v # Integration testscd frontend
npm test
# Run tests with coverage
npm test -- --coverage
# Run tests in watch mode
npm test -- --watch# Start all services first
docker-compose up -d
# Run E2E tests
npm run test:e2e-
Build production images
docker-compose -f docker-compose.prod.yml build
-
Deploy with environment variables
docker-compose -f docker-compose.prod.yml up -d
# k8s/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: studybuddy-backend
spec:
replicas: 3
selector:
matchLabels:
app: studybuddy-backend
template:
metadata:
labels:
app: studybuddy-backend
spec:
containers:
- name: backend
image: studybuddy/backend:latest
ports:
- containerPort: 8000
env:
- name: OPENAI_API_KEY
valueFrom:
secretKeyRef:
name: studybuddy-secrets
key: openai-api-key- AWS: ECS/EKS with RDS and S3
- Google Cloud: GKE with Cloud SQL and Cloud Storage
- Azure: AKS with Azure Database and Blob Storage
- Railway/Render: Simple deployment for smaller scale
# Backend health
curl http://localhost:8000/ping
# Qdrant health
curl http://localhost:6333/
# Check document processing status
curl http://localhost:8000/api/documents# View backend logs
docker-compose logs backend
# View all logs
docker-compose logs -f
# Check specific service logs
tail -f logs/app.log- Backend metrics: Available at
/metricsendpoint - Frontend performance: React DevTools
- Database queries: Qdrant dashboard at
:6333
- Fork and clone the repository
- Create a feature branch
git checkout -b feature/amazing-feature
- Set up development environment
docker-compose up -d qdrant # Start only Qdrant # Then run backend and frontend separately
- Make your changes and test
- Submit a pull request
- Backend: Black formatter, flake8 linter
- Frontend: Prettier formatter, ESLint
- Commits: Conventional commit messages
# Format code
cd backend && black . && flake8
cd frontend && npm run format && npm run lint- New AI Agents: Extend the
agents/directory - API Endpoints: Add routes in
api/directory - Frontend Components: Follow the existing component structure
- Tests: Always include tests for new functionality
# Ensure Qdrant is running
docker ps | grep qdrant
# Restart Qdrant
docker-compose restart qdrant- Check your API key in
.env - Verify API quota and usage limits
- Ensure the API key has necessary permissions
- Check file size limits (default 50MB)
- Verify supported file formats (PDF, Excel, DOCX)
- Ensure sufficient disk space in
storage/directory
# Clear cache and reinstall
cd frontend
rm -rf node_modules package-lock.json
npm installEnable debug logging:
DEBUG=true
LOG_LEVEL=DEBUG- π§ Email: your-email@example.com
- π¬ Discord: Join our community
- π Issues: GitHub Issues
- π Documentation: Full docs
- Concurrent Users: 50+ simultaneous users
- Document Size: Up to 50MB per file
- Response Time: <3 seconds for most queries
- Vector Search: <100ms for similarity queries
- Horizontal Scaling: Add more backend replicas
- Database Scaling: Use Qdrant Cloud for production
- Caching: Implement Redis for response caching
- Load Balancing: Use Nginx or cloud load balancers
- Input Validation: All inputs sanitized and validated
- Rate Limiting: API endpoints protected against abuse
- CORS: Configured for specific allowed origins
- File Validation: Strict file type and size checking
- Data Retention: Documents stored locally by default
- API Keys: Never logged or exposed in responses
- User Data: No personal information stored without consent
- Encryption: All API communication over HTTPS in production
- Data Portability: Export user data on request
- Right to Deletion: Complete data removal capability
- Consent Management: Opt-in for data processing
- Audit Logging: Track all data access and modifications
- Multi-user support with authentication
- Real-time collaboration on study plans
- Mobile app (React Native)
- Advanced analytics dashboard
- Integration with popular LMS platforms
- Voice interaction with speech-to-text
- Automated quiz generation
- Progress sharing and social features
- Multi-language support
- Offline mode capabilities
- Custom AI model fine-tuning
- AR/VR learning experiences
- Marketplace for study materials
- Corporate learning platform
- AI tutoring certification
This project is licensed under the MIT License - see the LICENSE file for details.
MIT License
Copyright (c) 2024 StudyBuddy AI Team
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Special thanks to the amazing open-source community and the following projects that made StudyBuddy AI possible:
- OpenAI - For providing powerful language models
- Qdrant - For the excellent vector database
- LangChain - For the comprehensive LLM framework
- FastAPI - For the high-performance web framework
- React - For the amazing frontend framework
- Tailwind CSS - For the utility-first CSS framework
Made with β€οΈ by the StudyBuddy AI Team
π Star on GitHub β’ π Report Bug β’ π‘ Request Feature