This is a full-stack web application that provides a Retrieval-Augmented Generation (RAG) system for answering questions about course materials.
Main Technologies:
- Backend: Python, FastAPI, Uvicorn
- Frontend: HTML, CSS, JavaScript
- AI: Anthropic's Claude
- Vector Store: ChromaDB
- Embeddings: Sentence Transformers
- Package Manager: uv
Architecture:
The application is composed of a frontend and a backend.
- The backend is a FastAPI application that exposes a REST API for querying the RAG system. It handles document processing, vector storage, and AI-powered response generation.
- The frontend is a single-page application that provides a chat interface for users to interact with the RAG system.
Prerequisites:
- Python 3.13 or higher
- uv (Python package manager)
- An Anthropic API key
Installation:
-
Install uv:
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
Running the Application:
-
Quick Start:
chmod +x run.sh ./run.sh
-
Manual Start:
cd backend uvicorn app:app --reload --port 8000
The application will be available at:
- Web Interface:
http://localhost:8000 - API Documentation:
http://localhost:8000/docs
Testing:
To run the tests, use the following command:
pytest- Code Style: The project uses
blackfor code formatting,isortfor import sorting, andflake8for linting. - Type Checking: The project uses
mypyfor static type checking. - Testing: The project uses
pytestfor testing. Tests are located in thebackend/testsdirectory.