This a variant adapted to Kimi-Code
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, Moonshot AI (Kimi) for AI generation, and provides a web interface for interaction.
- Python 3.13 or higher
- uv (Python package manager)
- A Moonshot AI API key (for Kimi AI) - Get it from https://platform.moonshot.cn/
- 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:MOONSHOT_API_KEY=your_moonshot_api_key_here
Use the provided shell script:
chmod +x run.sh
./run.shcd backend
uv run uvicorn app:app --reload --port 8000The application will be available at:
- Web Interface:
http://localhost:8000 - API Documentation:
http://localhost:8000/docs
This project uses Black for automatic code formatting and isort for import sorting to maintain consistent code style throughout the codebase.
Format all code:
./scripts/format.shThis runs Black and isort to automatically format all Python files.
Check code quality (CI/CD):
./scripts/check.shThis checks if all files are properly formatted without modifying them. Returns exit code 1 if issues are found.
Run full linting suite:
./scripts/lint.shThis runs comprehensive checks including Black, isort, and syntax validation with detailed output.
Black (pyproject.toml):
- Line length: 100 characters
- Target Python version: 3.13
isort (pyproject.toml):
- Profile: black (compatible with Black formatting)
- Line length: 100 characters
Before committing code, run the formatter:
./scripts/format.shFor CI/CD pipelines, use the check script to validate formatting:
./scripts/check.sh