Skip to main content

brags

brags (Build-your-own RAG System) is a Python package that makes it easy to spin up a custom Retrieval-Augmented Generation (RAG) pipeline.
It combines Python for the RAG logic and a background Go file watcher that monitors your documents folder, so your vector database is always up to date.


Features

  • Config-driven RAG setup (rag_config.yaml)
  • Pluggable embeddings (HuggingFace, OpenAI, etc.)
  • Flexible LLM providers (OpenAI, Gemini, Ollama, HuggingFace)
  • Multiple vector stores (FAISS, Chroma, Qdrant, Pinecone, Weaviate)
  • Two file watcher modes:
  • Persistent (event-driven) → watches changes in real time via fsnotify
  • Cron (polling-based) → scans folder at regular intervals
  • Chunking and reranking options
  • Hallucination checking with embedding similarity or LLM-based fact checking
  • Configurable logging & monitoring

Installation

Requires Python 3.10+. Building the file-watcher binary from source also requires Go 1.22+.

From source (recommended)

git clone https://github.com/Omkar-Wagholikar/adora.git
cd adora
pip install -e .

Build the Go watcher binary (required for background file monitoring):

cd go
./build.sh

This generates brags/bin/server_executable (plus the static UI and pythonFiles/, copied alongside it), which brags init spawns in the background.

From PyPI

pip install brags

Note: the version currently published on PyPI predates several fixes made in this repository (real dependency declarations, a corrected Python version floor, portable file paths) — a new version needs to be tagged and released before pip install brags reflects them. Until then, prefer the source install above.

The published wheel also bundles a Go binary built for Linux. Installing on macOS or Windows gets you the Python RAG pipeline, but the bundled brags init binary won't run there — build go/ from source on those platforms instead.

Optional: ensemble embeddings

EnsembleEmbedding (TF-IDF + LDA + BM25 blended with dense embeddings) needs an extra dependency group not installed by default:

poetry install --with ensemble
# or, with plain pip:
pip install scikit-learn gensim rank-bm25

Quick Start

  1. Copy the example config:
cp brags/rag_config.example.yaml brags/rag_config.yaml
  1. Edit rag_config.yaml with your model, embeddings, and file watcher preferences:
file_watcher:
  type: "persistent"   # Options: persistent, cron
  watch_dir: "./watched"
  pattern: "*.txt"
  cron_schedule: "*/3 * * * * *"  # Only for cron watcher
  debounce_seconds: 1             # Only for persistent watcher
  1. Run your RAG system:
python -m brags.main

The Go watcher will start in the background, monitor your documents folder, and update your vector DB whenever files change.


Project Structure

brags/                # Python package
go/                   # Go watchers + Python callback
tests/                # Unit tests
vector_db/            # Local FAISS indexes
rag_config.yaml       # Main configuration file

Configuration

All behavior is controlled via rag_config.yaml. Sections include:

  • llm → provider, model, API keys
  • embedding → embedding model & dimensions
  • vector_store → FAISS, Chroma, etc.
  • chunking → chunk size, overlap, splitter
  • reranking → reranker model
  • hallucination_checker → method + provider
  • logging → level and log file path
  • file_watcher → watcher type, path, debounce/cron config

See rag_config.example.yaml for details.


Testing

Run unit tests:

pytest tests

Contributing

We welcome contributions! Please see CONTRIBUTING.md for guidelines, and check CHANGELOG.md for updates.


License

This project is licensed under the MIT License.


Metadata

Release files for brags 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for brags 0.1.3
File Size Uploaded
brags-0.1.3.tar.gz 5.3 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for brags 0.1.3
File Interpreter ABI Platform
brags-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 10.7 MB

Release files / brags-0.1.3.tar.gz

Download URL brags-0.1.3.tar.gz
Size 5.3 MB
Tags Source
SHA-256 checksum
How to use checksums
11020ba536967c008bf37b8dc16c45f96e87764a20d09b732e4e80e20836b096
BLAKE2b-256 checksum
How to use checksums
c7dfee6bb2db3aa5e2827ac679e16ce40edc588146d494d4edf71fcc49c80fec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / brags-0.1.3-py3-none-any.whl

Download URL brags-0.1.3-py3-none-any.whl
Size 5.3 MB
Tags Python 3
SHA-256 checksum
How to use checksums
b7efe73dea38ae8fe43d76743a43c942856b9de2de9164622fd26b54df5f02b8
BLAKE2b-256 checksum
How to use checksums
0dceeb03d1a267f28656a451c9e2e15a236b934cffaa0338ff6a6785217bd119
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

0.2.0

6 release files

0.1.6

6 release files

0.1.5

6 release files

0.1.4

2 release files

This release

0.1.3 This release

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page