A Retrieval-Augmented Generation (RAG) system designed to answer questions about course materials using semantic search and AI-powered responses.
This application is a full-stack web application that enables users to query course materials and receive intelligent, context-aware responses. It uses ChromaDB for vector storage, Anthropic's Claude for AI generation, and provides a web interface for interaction.
- Python 3.13 or higher
- uv (Python package manager)
- An Anthropic API key (for Claude AI)
- For Windows: Use Git Bash to run the application commands - Download Git for Windows
-
Install uv (if not already installed)
curl -LsSf https://astral.sh/uv/install.sh | sh -
Install Python dependencies
uv sync
-
Set up environment variables
Create a
.envfile in the root directory:ANTHROPIC_API_KEY=your_anthropic_api_key_here
Use the provided shell script:
chmod +x run.sh
./run.shcd backend
uv run uvicorn app:app --reload --port 9000The application will be available at:
- Web Interface:
http://localhost:9000 - API Documentation:
http://localhost:9000/docs
The project includes comprehensive unit tests for all components:
# Install test dependencies
uv sync
# Run all tests
uv run pytest tests/ -v
# Run specific test files
uv run pytest tests/test_search_tools.py -v
uv run pytest tests/test_ai_generator.py -v
uv run pytest tests/test_rag_system.py -v
# Run tests with detailed output
uv run pytest tests/ -v -s
# Run diagnostic tests to check system health
uv run pytest tests/test_system_diagnostics.py -v -stest_search_tools.py: Tests CourseSearchTool and CourseOutlineTool functionalitytest_ai_generator.py: Tests AI response generation and tool calling logictest_rag_system.py: Integration tests for the complete RAG workflowtest_system_diagnostics.py: System health and configuration validation teststest_live_system.py: End-to-end tests with real data and API calls