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

PyPI publishes a separate wheel per platform (Linux/macOS/Windows, x86_64/arm64), each bundling a Go binary compiled for that target, so brags init's spawned server works out of the box regardless of OS.

Optional extras

A few features have dependencies that aren't installed by default, to keep the base install lighter:

# EnsembleEmbedding: TF-IDF + LDA + BM25 blended with dense embeddings
pip install "brags[ensemble]"

# chunking.splitter: code -- syntax-aware chunking via tree-sitter
pip install "brags[code]"

# `brags mcp` -- stdio MCP server exposing a read-only search tool
pip install "brags[mcp]"

# all of the above
pip install "brags[ensemble,code,mcp]"

From a source checkout, the poetry equivalent is poetry install -E ensemble -E code -E mcp (or --all-extras).


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 the prose/PDF profile, or rag_config.code.example.yaml for a profile tuned for indexing and searching a codebase instead (syntax-aware chunking, hybrid dense+keyword embeddings, reranking on by default -- each setting's comments explain why it differs from the prose profile).


MCP server

brags mcp runs brags as a stdio MCP server exposing a single read-only search tool -- similarity search (with reranking, if enabled) directly against the persisted vector store, returning raw chunks with source/line metadata rather than an LLM-summarized answer. Needs the mcp extra:

pip install "brags[mcp]"

Register it with Claude Code:

claude mcp add brags -- python -m brags mcp --config /path/to/rag_config.yaml

The index has to already exist (brags ingest --docs /path/to/repo first) -- brags mcp only searches, it never ingests.


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

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.6
File Size Uploaded
brags-0.1.6.tar.gz 5.3 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for brags 0.1.6
File
brags-0.1.6-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details
brags-0.1.6-py3-none-manylinux2014_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64 Details
brags-0.1.6-py3-none-manylinux2014_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64 Details
brags-0.1.6-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details
brags-0.1.6-py3-none-macosx_10_15_x86_64.whl Python 3 none macOS 10.15+ x86-64 Details

Total release size: 31.5 MB

Release files / brags-0.1.6.tar.gz

Download URL brags-0.1.6.tar.gz
Size 5.3 MB
Tags Source
SHA-256 checksum
How to use checksums
ecb23466df2305106fb5458edb3fbbaa49a90d7153b37a6577624b07632fcce7
BLAKE2b-256 checksum
How to use checksums
995e1e133d8d5f5931a7d2a8926eb16b27d73af83563d7d5da8a95ea5da4518d
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.6-py3-none-win_amd64.whl

Download URL brags-0.1.6-py3-none-win_amd64.whl
Size 5.5 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
daec2c2fe2a18b34f65a5ae7044ca54346c8a4d34a035f586c5b6e9c01fd959a
BLAKE2b-256 checksum
How to use checksums
2d90131d1d4566119404c7620a4bc9eef5ded31cc1e4c1e08ffa048e9f392253
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.6-py3-none-manylinux2014_x86_64.whl

Download URL brags-0.1.6-py3-none-manylinux2014_x86_64.whl
Size 5.3 MB
Tags Linux glibc 2.17+ x86-64 Python 3
SHA-256 checksum
How to use checksums
f1d66cdcbaf3fd278c19bcc5192640d14d02816ba7090bdbc6a42ea563c27717
BLAKE2b-256 checksum
How to use checksums
5a824d68fb88d0eaaaa9056adbcd49af687f420e5cf2f8f3da5d73c8ea47995c
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.6-py3-none-manylinux2014_aarch64.whl

Download URL brags-0.1.6-py3-none-manylinux2014_aarch64.whl
Size 4.9 MB
Tags Linux glibc 2.17+ ARM64 Python 3
SHA-256 checksum
How to use checksums
f10939d0a61f08ebb54320c60fe30277cfbb1303f0f5693f7e7c101d89e20b21
BLAKE2b-256 checksum
How to use checksums
115c9c8c6f7adb89dad513dea7ee0f7c56483fbcb72fa333e9f13dbb9c67ade1
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.6-py3-none-macosx_11_0_arm64.whl

Download URL brags-0.1.6-py3-none-macosx_11_0_arm64.whl
Size 5.1 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
61ff14deb488c4f3907f797f8e091ba8e0616ef8c5e26c76e33c88c6e700b7eb
BLAKE2b-256 checksum
How to use checksums
5d403f5740fe9a60cdf847e6de733064e515049370f6be47addd7891a72329d7
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.6-py3-none-macosx_10_15_x86_64.whl

Download URL brags-0.1.6-py3-none-macosx_10_15_x86_64.whl
Size 5.4 MB
Tags Python 3 macOS 10.15+ x86-64
SHA-256 checksum
How to use checksums
f6bbb8863b0dbbec33f26aa6cd9dbd2a9018372d4d688990c82e6171d29fc743
BLAKE2b-256 checksum
How to use checksums
89b8ae047b5b1a2e4f8e7b9c1bffa422b11b591af3719500b1802e80bcf50fd1
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

This release

0.1.6 This release

6 release files

0.1.5

6 release files

0.1.4

2 release files

0.1.3

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