metawake
PageIndex (19k stars) scored 44% on legal docs. Same as vector RAG
I've added this to the roadmap as `--bootstrap N`:
ragtune simulate --queries queries.json --bootstrap 5
# Output:
# Recall@5: 0.664 ± 0.012 (n=5)
# MRR: 0.533 ± 0.008 (n=5)
The implementation would sample N random subsets from the query set (or corpus), run each independently, and report mean ± std.This also enables detecting real regressions vs noise eg "Recall dropped 3% ± 0.8%" is actionable, "dropped 3%" alone isn't.
Will ship this during next few weeks. Thanks for the push toward more rigorous methodology, this is exactly what's missing from most RAG benchmarks.
Surprising findings:
1. On legal text (CaseHOLD), 1024 chunks scored WORST (0.618). The "small" 256 chunks won (0.664). 7% swing.
2. On Wikipedia text? All chunk sizes hit ~99%. No difference.
3. Plot twist: At 5K docs, optimal chunk size FLIPPED from 256→1024. Scale changes everything.
Code is MIT: github.com/metawake/ragtune
Happy to discuss methodology.
Show HN: RAG chunk size "best practices" failed on legal text – I benchmarked it
*Backends:* Currently supports Qdrant, pgvector, Weaviate, Chroma, and Pinecone. Adding more is straightforward since it's just implementing a Store interface. Let me know if I missed some good backend!
*Relevance scoring:* No LLM-as-judge — that's intentional. RagTune focuses on retrieval-layer metrics only:
- Vector similarity scores (what the DB returns) - Recall@K, MRR against your golden set - Score distribution diagnostics
The philosophy is: debug retrieval separately from generation. If your retrieval is broken, no amount of prompt engineering will fix it.
For chunk size/overlap optimization — exactly the use case! `ragtune compare --chunk-sizes 256,512,1024` lets you see the impact directly.
Happy to hear feedback if you try it!
Show HN: RagTune – EXPLAIN ANALYZE for your RAG retrieval layer
https://github.com/metawake/ragtune
CLI tool to debug and benchmark RAG retrieval without LLM calls.- `ragtune explain "query"` → see what was retrieved with scores - `ragtune simulate` → batch eval with recall/MRR metrics - `ragtune compare` → compare embedders or chunk sizes - CI/CD mode for quality gatesWorks with Qdrant, pgvector, Weaviate, Chroma, Pinecone.Built because I kept guessing why retrieval was bad. Now I can see...
ragtune explain "your query" --collection prod
Shows scores, sources, and diagnostics. Helps catch when your chunking
or embeddings are silently failing or you need numeric estimations to base your judgements on.Open source: https://github.com/metawake/ragtune
Exploring spaCy-based prompt compression for LLMs – thoughts welcome
I’ve been exploring whether prompt compression — done before sending input to LLMs — can help cut down on token usage and cost without losing key meaning.
Instead of using a neural model, I wrote a small open-source tool that uses handcrafted rules + spaCy NLP to reduce prompt verbosity while preserving named entities and domain terms. It’s mostly aimed at high-volume systems (e.g. support bots, moderation pipelines, embedding pipelines for vector DBs).
Tested it on 135 real prompts and got 22.4% average compression with high semantic fidelity.
GitHub: https://github.com/metawake/prompt_compressor
Would love feedback, use cases, or critiques!