Skip to content

🕵️ rag7

Not just hybrid search. A true autonomous retrieval agent.

Shaken, not stirred — plug in any vector store, any LLM, any reranker.
The mission: find the right documents, neutralise irrelevant noise, and deliver the answer. Every time.


from rag7 import init_agent

rag = init_agent("documents", model="openai:gpt-5.4", backend="qdrant")
state = rag.chat("What is the status of operation overlord?")
print(state.answer)  # Cited. Grounded. Delivered.

🔄 True Agentic Loop

Retrieve → judge → rewrite → retry. Fully autonomous up to max_iter rounds. Never satisfied with good enough.

BM25 + vector search fused with Reciprocal Rank Fusion or Distribution-Based Score Fusion. Multi-query variants in parallel.

🗄️ 8 Backends

Meilisearch, Azure AI Search, ChromaDB, LanceDB, Qdrant, pgvector, DuckDB, InMemory. Swap with one line.

🏆 Multi-Reranker

Cohere, HuggingFace, Jina, ColBERT, RankGPT, embed-anything, or any custom reranker.

🧠 HyDE

Hypothetical Document Embeddings boost recall on vague or descriptive queries automatically.

🎯 Auto Strategy

LLM samples your collection at init, tunes hyde_style_hint, semantic_ratio, and domain hints — zero per-query overhead.

🛠️ Tool-Calling Agent

invoke_agent gives the LLM a toolset: inspect schema, sample field values, build filters on the fly, boost by business signals.

📂 Multi-Collection

Route queries to the right subset of collections automatically. LLM picks which indexes to search per request.


Install

pip install rag7[recommended]   # Meilisearch + Cohere + CLI
pip install rag7                # Base only — InMemory backend
pip install rag7[all]           # Everything

See Quick Start for all install options and a 5-minute walkthrough.