Skip to content

Latest commit

 

History

96 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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, Zhipu AI (GLM-4-Flash) for AI generation, and provides a web interface for interaction.

Prerequisites

  • Python 3.13 or higher
  • uv (Python package manager)
  • A Zhipu AI API key (for GLM-4-Flash model)
  • For Windows: Use Git Bash to run the application commands - Download Git for Windows

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:

    ZHIPU_API_KEY=your_zhipu_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 Tools

Code Quality

This project includes automated code quality tools:

# Format code
python scripts/format.py

# Run quality checks
python scripts/check_quality.py

# Or use the convenience scripts (Windows)
scripts\dev.bat format
scripts\dev.bat check

# Or use the convenience scripts (Linux/Mac)
bash scripts/dev.sh format
bash scripts/dev.sh check

Tools included:

  • Black: Code formatter (line length: 100 chars)
  • isort: Import statement organizer
  • Flake8: Code style checker

For detailed usage, see docs/CODE_QUALITY.md.

Testing

Run the test suite:

cd backend
uv run pytest -v

Pre-commit Hooks (Optional)

Install pre-commit hooks for automatic quality checks:

# Install pre-commit framework
pip install pre-commit

# Install hooks
pre-commit install

# Now hooks will run automatically on each commit

About

RAG chatbot for answering questions about course materials

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages