Skip to main content

Production-grade RAG in 4 lines — hybrid search, streaming, and agent tools on by default.

Project description

ragxpy

CI PyPI Downloads Python 3.11+ License: MIT Docs Code style: ruff

The pip-installable Python RAG library built for 2026 — hybrid search, streaming, and agent tools on by default.

No Docker. No background server. No framework lock-in. Just Python.

Docs · Changelog · Contributing · Discussions

Install

pip install ragxpy

Quickstart

from ragxpy import RAG

async with RAG(llm="openai/gpt-4o-mini") as rag:
    await rag.ingest("./docs/")
    answer = await rag.query("What is the refund policy?")
    print(answer.text)
    print(answer.citations)

Why ragxpy?

Feature ragxpy LangChain LlamaIndex RAGFlow
Lines to get started 4 40+ 20+ Docker setup
Hybrid search on by default opt-in ✓ (Docker)
pip install (no server)
Async-first partial partial
Streaming responses partial partial
Agent tool built-in
Multi-tenant isolation
Incremental indexing opt-in
Built-in eval partial

Chunking accuracy: RecursiveChunker matches FloTorch Feb 2026 benchmark winner at 69% end-to-end accuracy.

Who It's For

✓ Python developers who want production-ready RAG as a library, not a platform.
✓ Teams already on PostgreSQL — zero new infrastructure with store="postgresql://...".
✓ Anyone who values typed, async-first, minimal-dependency code.

✗ Not for you if you need a no-code UI, knowledge graphs, or agent orchestration — use RAGFlow or LangGraph instead.

Store Options

# Development — volatile, zero setup
RAG(store="memory")

# Development — persistent across restarts, embedded
RAG(store="lance://./ragxpy-index")

# Production — PostgreSQL + pgvector, native hybrid search
RAG(store="postgresql://user:pass@localhost/mydb")

Upgrade Path

store="memory"                  # local dev / tests
    ↓
store="lance://./ragxpy-index"  # persistent dev, survives restarts
    ↓
store="postgresql://..."        # production (pgvector benchmark: 471 QPS @ 50M vectors)

Configuration

from ragxpy import RAG, QueryConfig

async with RAG(
    embedder="openai/text-embedding-3-small",
    store="lance://./my-index",
    llm="openai/gpt-4o-mini",
    chunk_size=512,
    chunk_overlap=64,
    cache=True,
) as rag:
    await rag.ingest("./docs/", glob="**/*.md")
    answer = await rag.query(
        "What changed in v2?",
        config=QueryConfig(top_k=5, include_citations=True),
    )

Optional Extras

pip install ragxpy[lance]       # LanceDB persistent store
pip install ragxpy[postgres]    # PostgreSQL + pgvector
pip install ragxpy[local-emb]   # sentence-transformers embedder + reranker
pip install ragxpy[eval]        # RAGAS + Langfuse eval loop
pip install ragxpy[serve]       # ragxpy serve HTTP API

CLI

ragxpy init          # generate ragxpy_config.py with defaults
ragxpy serve         # start HTTP API on localhost:8000
ragxpy serve --port 9000

Streaming

async for token in rag.stream_query("What changed in v2?"):
    print(token, end="", flush=True)

Works with OpenAI, Anthropic, and Ollama. Falls back gracefully for custom LLMs.

Agent tools

from ragxpy.agent import as_claude_tool

# Give your Claude agent access to your document index
tool = as_claude_tool(rag)              # Anthropic-compatible tool schema
results = await rag.search("query", top_k=5)  # raw retrieval, no generation

Pass as_openai_tool(rag) for OpenAI function calling.

Multi-tenant isolation

# Tag documents by tenant at ingest time
await rag.ingest("./org_a_docs/", tenant_id="org_a")
await rag.ingest("./org_b_docs/", tenant_id="org_b")

# Filter by tenant at query time — no code changes to the store
answer = await rag.query("policy?", config=QueryConfig(tenant_id="org_a"))

Roadmap

v0.1.0 is the foundation. Follow GitHub Discussions for what's coming next — roadmap is shaped by real usage and feedback.

Community

License

MIT — 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

ragxpy-0.1.0.tar.gz (58.6 kB view details)

Uploaded Source

Built Distribution

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

ragxpy-0.1.0-py3-none-any.whl (38.8 kB view details)

Uploaded Python 3

File details

Details for the file ragxpy-0.1.0.tar.gz.

File metadata

  • Download URL: ragxpy-0.1.0.tar.gz
  • Upload date:
  • Size: 58.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ragxpy-0.1.0.tar.gz
Algorithm Hash digest
SHA256 84fa6f162df0a977f26072965839bfabc6a15f0f02e4804302566d26ec558f9a
MD5 0444e55dbc78110e7ac2e93649da6732
BLAKE2b-256 3d6f2b76efc586b94c3a82abfa0c088021191766d13dc5f35c478bb5450f0333

See more details on using hashes here.

Provenance

The following attestation bundles were made for ragxpy-0.1.0.tar.gz:

Publisher: release.yml on laxmikanta415/ragxpy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ragxpy-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: ragxpy-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 38.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ragxpy-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ed3f2fe4b8ba353878cf82fe2fe6f4cea2e50f650230cbef5f8884a88c816d0e
MD5 2bde988bf1c830beb4f8b1b9bff2a082
BLAKE2b-256 1cc674afca70e95cb48894be058e767cbb5cf63b9a9c202f38665cb2b538dfb5

See more details on using hashes here.

Provenance

The following attestation bundles were made for ragxpy-0.1.0-py3-none-any.whl:

Publisher: release.yml on laxmikanta415/ragxpy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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