Framework-agnostic RAG pipeline SDK. Plug in any component, swap any stage, configure everything in YAML
Project description
NexRAG
███╗ ██╗███████╗██╗ ██╗██████╗ █████╗ ██████╗
████╗ ██║██╔════╝╚██╗██╔╝██╔══██╗██╔══██╗██╔════╝
██╔██╗ ██║█████╗ ╚███╔╝ ██████╔╝███████║██║ ███╗
██║╚██╗██║██╔══╝ ██╔██╗ ██╔══██╗██╔══██║██║ ██║
██║ ╚████║███████╗██╔╝ ██╗██║ ██║██║ ██║╚██████╔╝
╚═╝ ╚═══╝╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝
●plug ⇄swap ▶scale
Framework-agnostic RAG pipeline SDK. Plug in any component, swap any stage, configure everything in YAML.
What is NexRAG?
NexRAG is a production-grade RAG (Retrieval-Augmented Generation) pipeline SDK for Python.
NexRAG owns the pipeline shape. You own the components.
Every stage — loading, chunking, embedding, retrieval, generation — is a clean interface. NexRAG ships default implementations for each. You can swap any of them by implementing the interface and declaring it in YAML. No framework lock-in. No magic. No hidden behavior.
Quickstart
pip install "nexrag[openai,pdf]"
export OPENAI_API_KEY=sk-...
cp nexrag.example.yaml nexrag.yaml # edit to taste
from nexrag import NexRAG
pipeline = NexRAG.from_config("nexrag.yaml")
# Ingest a PDF
result = pipeline.ingest("contracts/agreement.pdf")
print(f"Ingested {result.documents_loaded} doc, {result.chunks_written} chunks")
# Query
result = pipeline.query("What are the termination clauses?")
print(result.answer)
for source in result.sources:
print(f" [{source.rank}] score={source.score:.3f} {source.chunk.metadata.get('source')}")
# nexrag.yaml (minimal)
ingestion:
loader:
type: pdf
embedder:
provider: openai
model: text-embedding-3-small
api_key: ${OPENAI_API_KEY}
vector_db:
provider: chroma
default_collection: documents
collections:
documents:
mode: persistent
path: ./.nexrag/chroma
query:
embedder: inherit
llm:
provider: openai
model: gpt-4o
api_key: ${OPENAI_API_KEY}
See docs/user-guide.md for the full guide.
Installation
# Core only
pip install nexrag
# With OpenAI support
pip install "nexrag[openai]"
# With everything
pip install "nexrag[all]"
Design Principles
| Principle | What it means |
|---|---|
| Interface-first | Every stage is a contract. Implementation is secondary. |
| Config-driven | YAML configures the pipeline. Code defines the logic. |
| Zero lock-in | Core has no dependency on LangChain, LlamaIndex, or any AI SDK. |
| Explicit over implicit | No hidden defaults. Every behavior is declared or documented. |
| Extensible by design | New components plug in without touching core. |
Architecture
NexRAG has two independent pipelines:
INGESTION → Loader → Sanitizer → Chunker → Embedder → VectorDB
QUERY → Embedder → Retriever → PromptBuilder → LLM → PipelineResult
See Architecture Documentation for full pipeline diagrams.
Supported Providers
Available now
| Category | Providers |
|---|---|
| Embedders | OpenAI |
| Vector DBs | ChromaDB (local persistent, in-memory) |
| LLMs | OpenAI, Ollama |
| Loaders | PDF, plain text |
| Chunkers | Recursive (separator-aware) |
Coming in V1
| Category | Providers |
|---|---|
| Embedders | Ollama, HuggingFace |
| Vector DBs | ChromaDB (remote server via HttpClient) |
| LLMs | Anthropic |
Contributing
NexRAG is in early development. Contribution guidelines will be published with v1.0.
Changelog
See CHANGELOG.md.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nexrag-0.2.0.tar.gz.
File metadata
- Download URL: nexrag-0.2.0.tar.gz
- Upload date:
- Size: 41.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5218528d6cab792a34d2a312dd98bfaadb4b6b6cd70497903439b6d263441aed
|
|
| MD5 |
d41c136fcf5da86c583842be61d48507
|
|
| BLAKE2b-256 |
9153b479877f95ff215573b21ea9f3ca87ae307d3c2e0a779a47fa3a6f94db2f
|
File details
Details for the file nexrag-0.2.0-py3-none-any.whl.
File metadata
- Download URL: nexrag-0.2.0-py3-none-any.whl
- Upload date:
- Size: 65.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
095277fc900d2a4da46473b80c9fbd2d661e112ce9dfe9b0ec6406a0be0b7ed1
|
|
| MD5 |
2bf4148c2f7d6fe12085775d0a515424
|
|
| BLAKE2b-256 |
da9bcf36cccfe25a8a8e4a3a99cab8abdb76fd09681adbd8743af901a9e1eadb
|