This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
# Install dependencies
uv sync
# Run the application (from project root)
./run.sh
# Manual start (from backend directory)
cd backend && uv run uvicorn app:app --reload --port 8000The application serves at http://localhost:8000 with API docs at /docs.
This is a RAG (Retrieval-Augmented Generation) chatbot for course materials using FastAPI, ChromaDB, and Claude.
- Document Ingestion: Course documents (
.txt,.pdf,.docx) fromdocs/are processed on startup - Chunking: Documents are split into sentence-based chunks with overlap for vector storage
- Query Processing: User queries trigger AI-driven tool use to search the vector store
- Response Generation: Claude generates responses using retrieved context
Backend (backend/)
app.py- FastAPI server with/api/queryand/api/coursesendpointsrag_system.py- Main orchestrator connecting all componentsvector_store.py- ChromaDB wrapper with two collections:course_catalog(metadata) andcourse_content(chunks)ai_generator.py- Claude API integration with tool-use supportdocument_processor.py- Parses course documents and chunks textsearch_tools.py- Tool interface for AI to search course contentsession_manager.py- Conversation history managementmodels.py- Pydantic models:Course,Lesson,CourseChunk
Frontend (frontend/) - Static HTML/CSS/JS served by FastAPI
Course documents follow a specific format:
Course Title: [title]
Course Link: [url]
Course Instructor: [instructor]
Lesson 0: Introduction
Lesson Link: [url]
[content]
Lesson 1: [title]
...
config.py- Settings loaded from environment (.envfile required withANTHROPIC_API_KEY)- Default embedding model:
all-MiniLM-L6-v2 - Default Claude model:
claude-sonnet-4-20250514