# ragtime-ai **Repository Path**: bali-dalian/ragtime-ai ## Basic Information - **Project Name**: ragtime-ai - **Description**: demo for rag - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-08-11 - **Last Updated**: 2025-08-12 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # ๐Ÿ“– **Ragtime-AI: A RAG (Retrieval-Augmented Generation) System** This is a Retrieval-Augmented Generation (RAG) system built with: - **FastAPI** - **HuggingFace embedding models** (Qwen3-embedding-0.6B) - **Weaviate** as the vector database - **Deepseek** as LLM ๐Ÿ”– **Features** - File uploading - Document indexing to vector DB - Semantic search - Question answering (Chat with uploaded docs) ## ๐Ÿ“œ Requirements - Python 3.13+ (Recommended) - Install the packages: ``` pip install --no-cache-dir -r requirements.txt ``` - Weaviate 1.25.1+ - Run the following command to start a Weaviate instance using Docker (Default port 8080): ``` cd weaviate docker-compose up -d ``` - If you want to customize your Weaviate configuration, refer to: https://docs.weaviate.io/deploy/installation-guides/docker-installation - Set environment variables - Create a `.env` file in `/ragtime_ai/config/` and provide your Deepseek API key: ``` DEEPSEEK_API_KEY=sk- ``` ## ๐Ÿš€ Quick Start - Start the FastAPI endpoints: ```bash python app.py ``` - The server runs at http://localhost:5000 - You can open the API docs in your browser: http://localhost:5000/docs - Launch the UI: ```bash streamlit run ui.py ``` ## ๐Ÿ—„๏ธ **Data Persistence** * Uploaded files are stored on host: `./file/` (not tracked in Git) * HuggingFace model cache: `./.cache/huggingface` (not tracked in Git) * Weaviate data: `./weaviate_data/` (not tracked in Git) These are mounted as Docker volumes so that data persists even when containers are stopped. ## ๐Ÿ“„ **Configuration** * Application config: `ragtime_ai/config/config.yaml` * Environment variables: `ragtime_ai/config/.env` (not tracked in Git) ## ๐Ÿณ Run with Docker Compose - Change the config file path in `ragtime_ai/config.py`: - Find this line: ``` config_path = os.path.join(current_dir, "config", "config.yaml") ``` - Change it to: ``` config_path = os.path.join(current_dir, "config", "config_docker.yaml") ``` - Run: ```bash docker-compose up -d --build ``` This will: - Build and start the FastAPI server (`ragtime-fastapi`) - Start the Weaviate vector database (`ragtime-weaviate`) ### ๐ŸŒ Access the FastAPI server * Open the API docs in your browser: ๐Ÿ‘‰ [http://localhost:8000/docs](http://localhost:8000/docs) ### ๐Ÿงช Test Weaviate (Optional) You can check if Weaviate is ready: ```bash curl http://localhost:8081/v1/.well-known/ready ``` ### ๐Ÿงน Stop and clean up ```bash docker-compose down ``` If you also want to remove volumes: ```bash docker-compose down -v ``` ## ๐Ÿ“œ **Notes** * `.env` is gitignored. Please create your own and add required environment variables. * `.dockerignore` excludes unnecessary files (like `file/` and `.cache/`) from the image. * The `file/` and `weaviate_data/` directories are created automatically if not present. ## ๐Ÿ‘จโ€๐Ÿ’ป Author > Rachel asdxl1996@163.com