This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
- Start the server:
./run.sh(orcd backend && uv run uvicorn app:app --reload --port 8000) - Install dependencies:
uv sync - Environment setup: Create
.envfile withANTHROPIC_API_KEY=your_key_here
- This project uses
uvas the Python package manager - Dependencies are defined in
pyproject.toml - The project requires Python 3.13+
This is a Retrieval-Augmented Generation (RAG) system for course materials with the following key architecture:
- RAGSystem (
rag_system.py): Main orchestrator that coordinates all components - VectorStore (
vector_store.py): ChromaDB-based vector storage for semantic search - AIGenerator (
ai_generator.py): Claude API integration with tool-calling capabilities - DocumentProcessor (
document_processor.py): Processes course documents into structured chunks - SessionManager (
session_manager.py): Manages conversation history and user sessions
- Course documents (PDF, DOCX, TXT) are processed into
CourseandCourseChunkobjects - Content is embedded and stored in ChromaDB collections
- User queries trigger semantic search through tools
- Claude generates responses using search results and conversation context
- Frontend communicates via FastAPI REST endpoints
- Tool-based search: Claude uses search tools rather than direct RAG context injection
- Session-based conversations: Maintains conversation history per session
- Modular component architecture: Each component has a single responsibility
- Pydantic models: Strong typing for data structures (
Course,Lesson,CourseChunk)
course_content: Main document chunks for semantic searchcourse_metadata: Course and lesson metadata- Duplicate detection based on course titles
- Static files served from
/frontend/directory - REST API endpoints under
/api/ - WebSocket-style session management for conversations
- All settings centralized in
config.py - Uses dataclass pattern with environment variable loading
- Key settings: chunk size (800), overlap (100), max results (5), conversation history (2)
- Supports PDF, DOCX, and TXT course materials
- Documents expected in
/docs/directory - Automatic course detection and duplicate prevention
- Structured extraction of course titles, lessons, and content