Skip to main content

rag-titan: a Swiss Army knife for RAG. Many RAG types, one simple API, runs locally.

PyPI version Python versions Tests Documentation License: MIT

📖 Documentation · Getting started · Supported RAG types · API reference · PyPI

rag-titan overview: index your files once, then ask questions

Why rag-titan?

  • Many RAG types, one API. Two today (simple, adaptive), with more on the way. Switch with one word: rag_type="adaptive".
  • Runs 100% locally with Ollama, so your documents never leave your machine.
  • Grounded answers. The model answers only from your files and cites the chunks it used.
  • Fixed-length chunking your way. Split by words, characters, model tokens (tiktoken or your own tokenizer) or recursive separators that keep paragraphs whole, with overlap.
  • Easy to read, easy to change. Short files, plain Python, and a docstring on every class. Swap any part by inheriting one base class.

Install

pip install rag-titan
ollama pull gemma3:4b && ollama pull nomic-embed-text

For token-based chunking, add the extra: pip install "rag-titan[tokens]".

Needs Python 3.10+ and Ollama. → Full setup guide

Quick start

from rag_titan import RAGTitan

rag = RAGTitan(rag_type="simple")            # or "adaptive"
rag.index(["handbook.pdf", "policy.docx"])

print(rag.ask("How many leave days do I get?"))
# You get 20 paid leave days every year [chunk_0].

Or from the terminal:

rag-titan ask --files handbook.pdf --question "How many leave days do I get?"

Supported RAG types

rag-titan 0.1 supports 2 RAG types. Pick one with rag_type:

Status RAG type How it works Best for LLM calls
✅ Available Simple RAG
rag_type="simple"
Retrieve → Rerank → Generate Fast answers to clear questions 1
✅ Available Adaptive RAG
rag_type="adaptive"
Route → Retrieve → Check evidence → Rewrite & retry Mixed questions, fewer wrong answers 2–5
from rag_titan import RAG_TYPES
print(RAG_TYPES)        # ['simple', 'adaptive']

Coming next (not available yet): Corrective RAG · Multi-query RAG · HyDE · Hybrid RAG · Self-RAG · Parent-document RAG · Graph RAG · Agentic RAG. → Roadmap

Also included: a tool-calling agent loop. It's a separate feature, not a rag_type.

Simple RAG: retrieve, rerank, generate, with example scores

Adaptive RAG: route, check evidence, rewrite and retry

Explore the docs

Click any picture to open its page.

Indexing pipeline

Building blocks
Load → chunk → embed → store, with the data at every step.

Swappable architecture

Extending rag-titan
Add your own LLM, vector store, chunker or RAG type.

Agent loop

Agents
Let the LLM call your Python functions as tools.

Command line demo

Command line
rag-titan ask and rag-titan chat.

I want to... Read
Install it and ask my first question Getting started
Pick the right RAG type RAG types
Change models, chunk size or reranker Configuration
See every class and method API reference

Contributing

Contributions are welcome! Read CONTRIBUTING.md to get set up. The tests run without Ollama.

License

MIT © Kumar Nishant

Metadata

Release files for rag-titan 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rag-titan 0.2.0
File Size Uploaded Provenance Actions
rag_titan-0.2.0.tar.gz 29.5 kB With provenance Details for rag_titan-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for rag-titan 0.2.0
File Interpreter ABI Platform Actions
rag_titan-0.2.0-py3-none-any.whl Python 3 none any Details for rag_titan-0.2.0-py3-none-any.whl

Total release size: 72.6 kB

Release files / rag_titan-0.2.0.tar.gz

Download URL rag_titan-0.2.0.tar.gz
Size 29.5 kB
Tags Source
SHA-256 checksum
How to use checksums
80654705543597d08a960c7c29be55f914e98df81ecbaa73f133b002eefba5a0
BLAKE2b-256 checksum
How to use checksums
aa2c77c2f8a5beafd000204497e0847300301360614fab8e29a63d9e2a9da40c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.

Transparency log

Release files / rag_titan-0.2.0-py3-none-any.whl

Download URL rag_titan-0.2.0-py3-none-any.whl
Size 43.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7f91c8cc3165a2b6698b9cf585916cda6e039ea6b49d592bdf3fb87c1126a42b
BLAKE2b-256 checksum
How to use checksums
46a93e2c9a653867145166e9092e6e62096243b9b35d03d366adb741a7388818
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.

Transparency log

Security for rag-titan 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for rag_titan-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page