Interactive terminal UI for visualizing, debugging, and tuning RAG chunking pipelines
Project description
RAG-TUI v0.0.4 Beta
The terminal sidekick for chunking, retrieval, and “why did my RAG answer do that?”
You know the moment when your LLM confidently answers with something you never said? Yeah. RAG‑TUI exists for that exact moment. It lets you see your chunks, tweak them in real time, and test retrieval before you ship.
Now with a headless CLI and a Python API — because sometimes you want the debug UI, and sometimes you want a CI‑friendly report.
What Is This?
RAG‑TUI is a beautiful terminal‑based debugger for Retrieval‑Augmented Generation pipelines. It helps you tune chunking strategies, inspect retrieval results, run batch tests, and export production‑ready configs.
In short: fewer hallucinations, more receipts.
Quick Start (30 seconds)
Install
pip install rag-tui
Launch the TUI
rag-tui
Pro tip: Press L in the app to load a sample document and start experimenting immediately.
New: Headless CLI
For scripts, CI, and “just give me JSON”.
Chunk text
rag-tui chunk --file docs.txt --strategy token --chunk-size 200 --overlap-percent 10 --format json
Evaluate retrieval
rag-tui eval --file docs.txt --queries-file queries.txt --top-k 3 --threshold 0.5
Export config
rag-tui export --strategy recursive --chunk-size 600 --overlap-percent 15 --format langchain
If you want the UI explicitly:
rag-tui ui
New: Python API (Headless Mode)
Use RAG‑TUI directly inside notebooks or pipelines.
from rag_tui import api
# Chunk text
result = api.chunk(
text="Hello world. Here's a tiny document.",
strategy="sentence",
chunk_size=200,
overlap_percent=10,
)
# Evaluate retrieval
metrics = api.eval(
queries=["What is this about?"],
docs="Hello world. Here's a tiny document.",
strategy="token",
chunk_size=200,
overlap_percent=10,
)
# Export config
langchain_code = api.export(
format="langchain",
strategy="recursive",
chunk_size=600,
overlap_percent=15,
)
What You Can Do in the TUI
1) Visualize chunking strategies
Pick from six chunkers and instantly see the results:
- Token
- Sentence
- Paragraph
- Recursive
- Fixed characters
- Custom (your own Python)
2) Tune chunk size + overlap live
Slide, watch, repeat. No guessing.
3) Search and inspect retrieval
Type a query and see exactly which chunks are returned.
4) Batch test
Paste a list of queries and get metrics like hit rate and average scores.
5) Export production configs
Generate LangChain or LlamaIndex splitters without hand‑translating numbers.
Providers Supported
Pick your flavor:
- Ollama (local, free, private)
- OpenAI
- Groq (fast)
- Google Gemini
Set your API key env vars, or just run Ollama locally and you’re good.
File Types Supported
.txt, .md, .py, .js, .json, .yaml, .pdf, .csv, and more. If it’s text‑ish, RAG‑TUI probably speaks it.
Why People Use RAG‑TUI
- “My chunks were too big, but I couldn’t see it.”
- “Retrieval looked fine… until I inspected the top‑k results.”
- “My RAG answers were drifting, and I needed a clean baseline.”
RAG‑TUI makes chunking and retrieval visible.
Common Workflows
Debug a RAG failure in 5 minutes
- Load your document.
- Try a few queries in Search.
- Adjust chunk size + overlap.
- Repeat until retrieval actually makes sense.
Generate a production config
- Tune your chunks in the TUI.
- Export LangChain or LlamaIndex config.
- Paste into production. Done.
Tips and Tricks
- Press
Lto load sample text instantly. - Use smaller chunks for QA, larger ones for summarization.
- If in doubt, start with the Q&A Retrieval preset.
Installation Notes
Python 3.10+ required.
pip install rag-tui
Contributing
Got ideas? We want them. Open an issue or send a PR. If you fix a weird chunking bug, we’ll probably name a preset after you.
License
MIT. Do cool things.
Project details
Release history Release notifications | RSS feed
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 rag_tui-0.0.4b1.tar.gz.
File metadata
- Download URL: rag_tui-0.0.4b1.tar.gz
- Upload date:
- Size: 436.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
95326581f6c60f362425fafd6c1b37f93d832329a9c8a010a6a275601e71922e
|
|
| MD5 |
f5a1e9f75cfdbb0e27f5552f8c64aa08
|
|
| BLAKE2b-256 |
9c925de4290d01cd96f33b74b8dde81b01ad8fb756d305f6103d2e71570a0b73
|
File details
Details for the file rag_tui-0.0.4b1-py3-none-any.whl.
File metadata
- Download URL: rag_tui-0.0.4b1-py3-none-any.whl
- Upload date:
- Size: 49.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0b4b0db6803c6ef2282847cf12a93d41a60d4ba410470f8bea1ff40ee9f06f85
|
|
| MD5 |
7f0402db8d24451f09d6a7e427d2ba24
|
|
| BLAKE2b-256 |
f1e64027d9754cb4452793a46be756adfb1fa69ee944e535f4f57424ab9e98f3
|