An AI-powered study assistant for academic courses
MyAcademicCopilot is a full-stack AI assistant that helps students understand course material. It indexes course PDFs/notes and lets the user ask natural-language questions, using a RAG (Retrieval-Augmented Generation) pipeline and AI agents.
- 📂 Ingest course material – PDFs and text files (lectures, notes, solved exercises)
- ❓ Answer questions in natural language about the uploaded material
- 🧠 Use RAG – retrieve the most relevant chunks before calling the LLM
- 🧩 Agentic behavior – different “modes” (answer / summarize / explain) via LangGraph
- 📑 Cited answers – return both the answer and the supporting document passages
- 📊 Observability – log all LLM calls with Langfuse for debugging and evaluation
- 💬 Chat-style UI – React/Vite frontend that feels like a modern AI chat app
The project is split into two main parts:
MyAcademicCopilot/
backend/ FastAPI server, RAG & agents
app/
agents/ Agent definitions and routing
LLM/ LLM client abstraction (LiteLLM )
rag/ RAG pipeline: loader, splitter, retriever, store
schemas.py Pydantic request/response models
main.py FastAPI app entrypoint
data/
*.pdf Example course materials
intro_ai.txt Example text knowledge source
requirements.txt
frontend/ React + Vite chat UI
src/
components/ Chat UI components (header, sidebar, messages, input, etc.)
App.jsx Main app component
api.js Client for talking to the backend
-
Document Ingestion
- User provides course materials (PDFs or text files).
- Backend loads and parses the documents.
- RAG component splits text into chunks and stores embeddings.
-
User Question
- User sends a natural-language query via the chat interface.
- Frontend sends the request to the FastAPI backend.
-
RAG Retrieval
- Relevant document chunks are retrieved from the vector store.
- Retrieved context is attached to the LLM prompt.
-
AI Agent Execution
- LangGraph selects the appropriate agent (answer, summary, explanation, etc.).
- The LLM (via LiteLLM) generates a grounded answer.
-
Response Construction
- Backend returns:
- The answer
- The supporting citations (document passages used)
- Metadata for debugging/observability (Langfuse trace IDs)
- Backend returns:
-
Frontend Display
- The React UI renders the conversation in a chat format.
- Citations and context are shown alongside the assistant’s response.
- Python, FastAPI
- LangChain, LangGraph
- **LiteLLM **
- ChromaDB (in-memory vector store)
- Pydantic & Pydantic-Settings
- Langfuse for observability + tracing
- Uvicorn ASGI server
- React
- Vite
- REST API communication (JSON)
- Modular, clean architecture
- Docker support for easy deployment (full-stack)
# 1. Clone the repository
git clone https://github.com/bengarusi/MyAcademicCopilot.git
cd MyAcademicCopilot
# 2. Set up the backend environment file
cd backend
cp env.example .env # Windows PowerShell: copy env.example .env
# Edit the .env file and insert your OPENAI_API_KEY
cd ..
# 3. Build and run the entire system (backend + frontend)
docker compose up --build
# 4. Access the application
# Frontend: http://localhost:5173
# Backend: http://localhost:8000
# 5. Stop the system
docker compose down