A modular RAG (Retrieval-Augmented Generation) framework to chat with your own documents.
BuildYourRAG is a Python-based application that empowers users to build custom RAG pipelines with ease. Featuring a FastAPI backend and Streamlit frontend, this app allows users to upload documents and interact with them via natural language queries. Embeddings are managed using ChromaDB, and the LLM support is currently API-based with Gemini.
- Upload and chat with your documents
- API-based LLM integration (Gemini)
- ChromaDB-powered vector store
- Streamlit + FastAPI architecture
- Easy dependency management with
uvandpyproject.toml
- Python 3.10+
uv(modern Python package manager)Microsoft C++ Build Tools(Windows)Poppler(Windows)
git clone https://github.com/SamPujade/BuildYourRAG.git
cd BuildYourRAGCreate a .env file in the root of your project with the following content:
BACKEND_PORT=8199
GOOGLE_API_KEY=your_gemini_api_key_hereRun the following script to install dependencies and launch both frontend and backend:
bash start- Backend runs at:
http://localhost:8199 - Frontend runs in your browser via Streamlit
Logs are saved to logs/backend.log and logs/frontend.log.
You can build you own agent with custom prompts for your specific use cases !
To do so, create a yaml file in src/agents/examples/ with the following format :
initial_message: >
<Custom initial message>
prompt_template: |
<Custom generation template using context, chat history and user message (query)>
<context>
{context}
</context>
<history>
{history}
</history>
<question>
{message}
</question>
router_template: |
<Custom routing template for query classification, query rephrasing or entity extraction>
<question>
{query}
</question>.
├── start.sh # Script to start backend and frontend
├── pyproject.toml # Project dependencies managed by uv
├── .env # API keys and secrets (user-provided)
├── src/
│ ├── app.py # Streamlit frontend app
│ └── server/
│ └── main.py # FastAPI backend entry point
├── logs/ # Log files for debugging
└── data/ # Data folder
└── chroma_data/ # ChromaDB collection folder
└── upload/ # Uploaded folders