Skip to main content

raghilda raghilda hex logo

RAG made simple.

raghilda is a Python package for implementing Retrieval-Augmented Generation (RAG) workflows. It provides a complete solution with sensible defaults while remaining transparent (not a black box).

What you can build

raghilda puts a question-answering layer over content you already have. Use it to chat over your documentation with cited sources, build internal knowledge assistants over runbooks, wikis, or policies (scoped per team or product with attribute filters), run research and Q&A across a directory of PDFs, notebooks, or reports, or power entity-scoped retrieval over customer records, product catalogs, and case timelines where every answer must stay within a single record.

Installation

pip install raghilda

Or install from GitHub:

pip install git+https://github.com/posit-dev/raghilda.git

Key Steps

raghilda handles the complete RAG pipeline:

  1. document Processing: convert documents to Markdown using MarkItDown
  2. text chunking: split text at semantic boundaries (headings, paragraphs, sentences)
  3. embedding: generate vector representations via OpenAI or other providers
  4. storage: store chunks and embeddings in DuckDB, ChromaDB, or OpenAI Vector Stores
  5. retrieval: find relevant chunks using similarity search or BM25

Each step is an ordinary, inspectable Python object with sensible defaults, so you can run the whole pipeline as-is and customize any stage when you need to.

Usage

from raghilda.store import DuckDBStore
from raghilda.embedding import EmbeddingOpenAI
from raghilda.scrape import find_links
from raghilda.read import read_as_markdown
from raghilda.chunker import MarkdownChunker

# Create a store with embeddings
store = DuckDBStore.create(
    location="chatlas.db",
    embed=EmbeddingOpenAI(),
)

# Find and index pages from the chatlas documentation
links = find_links("https://posit-dev.github.io/chatlas/")
chunker = MarkdownChunker()

# Read, chunk, and store each page
for link in links:
    document = read_as_markdown(link)
    chunked_document = chunker.chunk(document)
    store.upsert(chunked_document)

# Build indexes before retrieval
store.build_index()

# Retrieve relevant chunks
chunks = store.retrieve("How do I stream a response?", top_k=5)
for chunk in chunks:
    print(chunk.text)

Requirements

  • Python 3.11–3.13
  • An embedding provider (such as OpenAI) is optional: semantic search needs one, but keyword search works with no API key.

Links

Contributing

Contributions are welcome! See CONTRIBUTING for setup and development guidelines.

License

Released under the MIT License.


Developed by Daniel Falbel and Tomasz Kalinowski.
Supported by Posit Software, PBC.

Release files for raghilda 0.2.1

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

Source distribution (sdist)

Source distribution for raghilda 0.2.1
File Size Uploaded
raghilda-0.2.1.tar.gz 85.5 kB Details

Built distribution (wheel)

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

Total release size: 183.8 kB

Release files / raghilda-0.2.1.tar.gz

Download URL raghilda-0.2.1.tar.gz
Size 85.5 kB
Tags Source
SHA-256 checksum
How to use checksums
d04d5cabc7a9831d5be44ec419c1e0c06258613b76a3d0b0f3bf90c3c29ec96e
BLAKE2b-256 checksum
How to use checksums
b6f405ef65e1447ba5af7a6d7bb58ad9eb1e5502872464f0cca1d3a518932616
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.9 {"installer":{"name":"uv","version":"0.12.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / raghilda-0.2.1-py3-none-any.whl

Download URL raghilda-0.2.1-py3-none-any.whl
Size 98.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
96f92fea1a7694177b9792f2e39693a998d40886b1d97f1c7c343364f164f7a3
BLAKE2b-256 checksum
How to use checksums
8d8f30b746f9a152ac4977c4340f38c00cbc8d55b23100c16154ae2291e371db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.9 {"installer":{"name":"uv","version":"0.12.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.2.0

2 release files

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