Skip to content

SamPujade/BuildYourRAG

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BuildYourRAG

A modular RAG (Retrieval-Augmented Generation) framework to chat with your own documents.

Overview

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.


Features

  • Upload and chat with your documents
  • API-based LLM integration (Gemini)
  • ChromaDB-powered vector store
  • Streamlit + FastAPI architecture
  • Easy dependency management with uv and pyproject.toml

Requirements

Getting Started

1. Clone the repository

git clone https://github.com/SamPujade/BuildYourRAG.git
cd BuildYourRAG

2. Setup environment variables

Create a .env file in the root of your project with the following content:

BACKEND_PORT=8199
GOOGLE_API_KEY=your_gemini_api_key_here

2. Install dependencies and start the app

Run 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.


Custom prompts

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>

Project Structure

.
├── 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

About

Create and customize your very own RAG pipeline

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors