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.

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

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()

for link in links:
    document = read_as_markdown(link)
    chunked_document = chunker.chunk(document)
    store.upsert(chunked_document)

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

Links

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.1.1.tar.gz (52.5 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.1.1-py3-none-any.whl (61.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: raghilda-0.1.1.tar.gz
  • Upload date:
  • Size: 52.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","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.1.1.tar.gz
Algorithm Hash digest
SHA256 564bd5e60c9c7ae4d594468552c9148d29a451d1c30e1583284a39ea109a8b5c
MD5 f7c2287240de5397ab7475b035e234da
BLAKE2b-256 cf550ce6dda13b53eba5b7658d55604ea7f27e546c2538272d92794495bef34f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: raghilda-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 61.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","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.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7b38dded175a2e8e7bed98f7336d52819a6490ab7cf889613a84d653c678221c
MD5 fbf4882d54cf151c93dece026b2f4608
BLAKE2b-256 9884f63d9bfb308b907ad7bb0a954f555164215ac3ba45939f98cb4b4507659f

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