RAG-with-Chroma is an open-source Retrieval-Augmented Generation (RAG) application designed to be integrated into your server, providing APIs and a user-friendly frontend for managing AI knowledge. The application utilizes Chroma with SQLite as the vector store, OpenAI API for text embedding, ChatGPT and Deepseek as Large Language Models (LLMs), FastAPI for the backend, and React with Vite and TypeScript for the frontend.
- AI Knowledge Management: Efficiently manage and retrieve AI-related information.
- API Integration: Seamlessly integrate with your existing systems through robust APIs.
- User-Friendly Frontend: Intuitive interface built with React and TypeScript.
- Flexible Backend: Powered by FastAPI, ensuring high performance and scalability.
Ensure your system meets the following requirements before setting up RAG-with-Chroma:
- Python: Version 3.10 or higher
- Node.js: Version 18 or higher
- SQLite: Version 3.35 or higher (Why?)
- React: Version 19 or higher
-
Navigate to the Backend Directory:
cd backend -
Install Dependencies:
Use pip to install the required Python packages:
pip install -r requirements.txt
-
Configuration:
Create a
config.jsonfile in the backend directory. Use the providedconfig.example.jsonas a template. This configuration file includes settings such as CORS and other persistent configurations.
-
Navigate to the Frontend Directory:
cd frontend -
Install Dependencies:
Use npm to install the required Node.js packages:
npm install
-
Environment Variables:
Create a
.envfile in the frontend directory with the following content:# Backend URL VITE_BACKEND_URL=<your backend domain URI or localhost> # Password for Page Login VITE_ENTRE_PWD=<your password for system login>
Replace
<your backend domain URI or localhost>with the URL where your backend is hosted, and<your password for system login>with your desired login password.
To run the application in development mode:
-
Start the Backend:
In the
backenddirectory, run:python main.py # OR uvicorn main:app --reloadThis will start the FastAPI server with automatic reloading enabled.
-
Start the Frontend:
In the
frontenddirectory, run:npm run dev
This will start the development server for the React application.
For production deployment:
-
Backend Deployment:
Use a production-ready ASGI server such as
gunicornwithuvicornworkers:gunicorn -k uvicorn.workers.UvicornWorker main:app
-
Frontend Deployment:
Build the frontend for production:
npm run build
Serve the contents of the
distdirectory using a web server of your choice, such as Nginx or Apache.
This project is licensed under the MIT License. See the LICENSE file for more details.
For further assistance or to contribute to the project, please refer to the repository's GitHub page. It should be ready for fork and customise by yourself now~