CSRC-Car-Manual-RAG / README.md
Bryceeee's picture
Rename README_SPACES.md to README.md
23af869 verified

A newer version of the Gradio SDK is available: 6.1.0

Upgrade
metadata
title: CSRC Car Manual RAG System
emoji: πŸš—
colorFrom: blue
colorTo: purple
sdk: gradio
sdk_version: 6.0.0
app_file: app.py
pinned: false
license: mit

CSRC Car Manual RAG System

An intelligent RAG (Retrieval-Augmented Generation) system for querying car manual documents using OpenAI and vector stores.

πŸš€ Features

  • RAG-based Q&A: Ask questions about car manual content
  • Vector Store: Fast and accurate document retrieval
  • Knowledge Graph: Visualize document relationships
  • Personalized Learning: Adaptive learning paths (optional)
  • Scenario Contextualization: Context-aware responses (optional)

πŸ“‹ Setup Instructions

1. Clone or Upload to Hugging Face Spaces

  • Option A: Create a new Space on Hugging Face and upload files
  • Option B: Connect your GitHub repository to Spaces

2. Set Environment Variables (Secrets)

Go to Settings > Secrets in your Space and add:

OPENAI_API_KEY=your-openai-api-key-here

⚠️ Important: Never commit API keys to the repository. Always use Spaces Secrets.

3. Upload PDF Files

Ensure your PDF files are in the car_manual/ directory:

car_manual/
β”œβ”€β”€ Function of Active Distance Assist DISTRONIC.pdf
β”œβ”€β”€ Function of Active Lane Change Assist.pdf
β”œβ”€β”€ Function of Active Steering Assist.pdf
└── Function of Active Stop-and-Go Assist.pdf

4. Wait for Build

Spaces will automatically:

  • Install dependencies from requirements.txt
  • Run app.py
  • Start the Gradio interface

πŸ“ Project Structure

.
β”œβ”€β”€ app.py                 # Hugging Face Spaces entry point
β”œβ”€β”€ main.py               # Local development entry point
β”œβ”€β”€ requirements.txt      # Python dependencies
β”œβ”€β”€ src/                  # Core modules
β”œβ”€β”€ modules/              # Feature modules
β”œβ”€β”€ car_manual/           # PDF files directory
β”œβ”€β”€ config/               # Configuration files
└── output/               # Output directory (auto-created)

πŸ”§ Configuration

Required

  • OPENAI_API_KEY: Your OpenAI API key (set in Spaces Secrets)

Optional

  • PDF Files: Place in car_manual/ directory
  • Vector Store: Automatically created on first run

πŸ“– Usage

  1. Wait for the Space to build (check the logs)
  2. Open the Gradio interface
  3. Enter your question in the input field
  4. Get answers with source citations

πŸ› Troubleshooting

Error: OPENAI_API_KEY not found

  • Go to Settings > Secrets
  • Add OPENAI_API_KEY with your actual API key
  • Restart the Space

Error: No PDF files found

  • Ensure PDF files are in the car_manual/ directory
  • Check file permissions
  • Verify file names (case-sensitive)

Build Fails

  • Check the logs for error messages
  • Verify requirements.txt is correct
  • Ensure all Python dependencies are compatible

πŸ“ Notes

  • Vector store is created automatically on first run
  • Vector store ID is saved in config/vector_store_config.json
  • First initialization may take time (uploading PDFs to OpenAI)

πŸ”— Links

πŸ“„ License

MIT License