Skip to main content

RAG made simple

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

raghilda-0.2.0.tar.gz (85.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

raghilda-0.2.0-py3-none-any.whl (98.1 kB view details)

Uploaded Python 3

File details

Details for the file raghilda-0.2.0.tar.gz.

File metadata

  • Download URL: raghilda-0.2.0.tar.gz
  • Upload date:
  • Size: 85.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","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}

File hashes

Hashes for raghilda-0.2.0.tar.gz
Algorithm Hash digest
SHA256 343d0eb651e1eabd0c6105934d61964c1a52dc4e23f779d9a99c9c95c21378ac
MD5 4d7b697fa660bc8c54c6cfa65b957206
BLAKE2b-256 d1f1fc3f2e1991cd2df8e7502a02e7667fae97ee3949f3638b8ddfce384c7ead

See more details on using hashes here.

File details

Details for the file raghilda-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: raghilda-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 98.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","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}

File hashes

Hashes for raghilda-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0f41b95517e7b0d748f40213ecb58728d8a66729afc3f08eff7a7c9c48e7832f
MD5 e0e4919955814f9411e57960390b3e49
BLAKE2b-256 10ef7f7c9abd096bc779c630b7df27cd9e9a827b8ea3d74a3574e6fd497fd7ad

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page