Visitar URL original
GitHub - WuChenxu/starting-ragchatbot-codebase · GitHub
Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

 
 

Repository files navigation

This a variant adapted to Kimi-Code

Course Materials RAG System

A Retrieval-Augmented Generation (RAG) system designed to answer questions about course materials using semantic search and AI-powered responses.

Overview

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.

Prerequisites

Installation

  1. Install uv (if not already installed)

    curl -LsSf https://astral.sh/uv/install.sh | sh
  2. Install Python dependencies

    uv sync
  3. Set up environment variables

    Create a .env file in the root directory:

    MOONSHOT_API_KEY=your_moonshot_api_key_here

Running the Application

Quick Start

Use the provided shell script:

chmod +x run.sh
./run.sh

Manual Start

cd backend
uv run uvicorn app:app --reload --port 8000

The application will be available at:

  • Web Interface: http://localhost:8000
  • API Documentation: http://localhost:8000/docs

Development

Code Quality Tools

This project uses Black for automatic code formatting and isort for import sorting to maintain consistent code style throughout the codebase.

Available Scripts

Format all code:

./scripts/format.sh

This runs Black and isort to automatically format all Python files.

Check code quality (CI/CD):

./scripts/check.sh

This checks if all files are properly formatted without modifying them. Returns exit code 1 if issues are found.

Run full linting suite:

./scripts/lint.sh

This runs comprehensive checks including Black, isort, and syntax validation with detailed output.

Tool Configurations

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

Pre-commit Workflow

Before committing code, run the formatter:

./scripts/format.sh

For CI/CD pipelines, use the check script to validate formatting:

./scripts/check.sh

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages