Skip to main content

Lightweight, LLM-agnostic RAG pipeline with pluggable corpora. Works with Claude, OpenAI, Gemini, or any LLM.

Project description

attune-rag

Lightweight, LLM-agnostic RAG pipeline with pluggable corpora. Works with Claude, OpenAI, Gemini, or any LLM.

  • No LLM SDK at install time. All provider deps are optional extras.
  • Pluggable corpus. Use attune-help (the default), any markdown directory, or your own CorpusProtocol.
  • Returns a prompt string by default — send it to whatever LLM you like. Optional provider adapters ship convenience wrappers.
  • Optional hybrid retrieval. QueryExpander and LLMReranker layer Claude Haiku on top of keyword retrieval to improve recall and precision — both opt-in, both fail-safe.

Install

pip install attune-rag                     # core only
pip install 'attune-rag[attune-help]'      # + bundled help corpus
pip install 'attune-rag[claude]'           # + Claude adapter
pip install 'attune-rag[openai]'           # + OpenAI adapter
pip install 'attune-rag[gemini]'           # + Gemini adapter
pip install 'attune-rag[all]'              # everything

Quick start — Claude

pip install 'attune-rag[attune-help,claude]'
import asyncio
from attune_rag import RagPipeline

async def main():
    pipeline = RagPipeline()  # defaults to AttuneHelpCorpus
    response, result = await pipeline.run_and_generate(
        "How do I run a security audit with attune?",
        provider="claude",
    )
    print(response)
    print("\nSources:", [h.entry.path for h in result.citation.hits])

asyncio.run(main())

Quick start — OpenAI

pip install 'attune-rag[attune-help,openai]'
response, result = await pipeline.run_and_generate(
    "...", provider="openai", model="gpt-4o",
)

Quick start — Gemini

pip install 'attune-rag[attune-help,gemini]'
response, result = await pipeline.run_and_generate(
    "...", provider="gemini", model="gemini-1.5-pro",
)

Quick start — custom corpus, any LLM

from pathlib import Path
from attune_rag import RagPipeline, DirectoryCorpus

pipeline = RagPipeline(corpus=DirectoryCorpus(Path("./my-docs")))
result = pipeline.run("How do I...?")

# Send result.augmented_prompt to whatever LLM you use.
# The pipeline itself does NOT call an LLM unless you use
# run_and_generate or call a provider adapter yourself.

Hybrid retrieval (optional)

QueryExpander and LLMReranker require the [claude] extra and an ANTHROPIC_API_KEY. Both are opt-in and fail-safe — any API error falls back to keyword-only order automatically.

from attune_rag import RagPipeline, LLMReranker, QueryExpander

# Reranker only (recommended for precision):
pipeline = RagPipeline(reranker=LLMReranker())

# Expander + reranker (max coverage):
pipeline = RagPipeline(
    expander=QueryExpander(),
    reranker=LLMReranker(),
)

Dashboard

attune-rag dashboard show    # live terminal dashboard
attune-rag dashboard render --out report.html  # HTML snapshot

Status

v0.1.6. Part of the attune ecosystem (attune-ai, attune-help, attune-author).

License

Apache 2.0. See LICENSE.

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

attune_rag-0.1.6.tar.gz (43.7 kB view details)

Uploaded Source

Built Distribution

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

attune_rag-0.1.6-py3-none-any.whl (52.3 kB view details)

Uploaded Python 3

File details

Details for the file attune_rag-0.1.6.tar.gz.

File metadata

  • Download URL: attune_rag-0.1.6.tar.gz
  • Upload date:
  • Size: 43.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for attune_rag-0.1.6.tar.gz
Algorithm Hash digest
SHA256 d766e7766ee528f190abc694a5fc1abb9903e386562751b86afb343035a9b713
MD5 c742a6c1f4f08cf97da5d5856cd14060
BLAKE2b-256 ffa0f68fcd15ebd11e796f2d0596b535ebc3d2e1d915024427690d7a3c5882dc

See more details on using hashes here.

File details

Details for the file attune_rag-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: attune_rag-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 52.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for attune_rag-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 4d3cc29d0c9a30ffb8c29d1097571028c66551dac3cab2ae8cead734c922efc7
MD5 f6c7adc2ebd24a986458bc95ce2fdee2
BLAKE2b-256 242291e3ee6e6d216e215666586065e07cff0c6a250c3642617942c0d0964abd

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