r/Rag • • Sep 02 '25

Showcase 🚀 Weekly /RAG Launch Showcase

38 Upvotes

Share anything you launched this week related to RAG—projects, repos, demos, blog posts, or products 👇

Big or small, all launches are welcome.


r/Rag • • 1h ago

Discussion RAG Evaluation

1 Upvotes

I’m spinning up a new RAG project and want to make sure I’m thinking about retrieval evaluation the right way before I get too deep into tweaking chunking or embedding models.

How do you guys typically set this up from scratch? I'm trying to figure out the best way to handle:

  1. Generating test data when you don't have real user queries yet.
  2. Creating the ground truth and measuring if a retrieved result is actually relevant for example, do you check if it came from the right document/page, match exact chunks, or just ask an LLM if it helps answer the question?
  3. Which tools you actually stick with vs. what ends up being unnecessary overhead.

Any advice on what a simple, practical "day one" setup looks like would be hugely appreciated!


r/Rag • • 1h ago

Showcase Semantic Chords Geometry: an experiment in high semantic information density

1 Upvotes

I started with a question about my own thinking. Sometimes I can see how several things fit together before I have the words to explain it. Later, working on a completely different problem, I recognize the same relationship. What would it take for a language model to remember something in that form?

I’m exploring that question through Semantic Chords Geometry (SCG), part of my ModelMemory project. I’m using Nemotron Ultra to build a graph of relationships it proposes, expressing each one as a compact structure called a semantic chord. The aim is high semantic information density: preserving how concepts relate in a compact form that can be inspected and composed with other ideas.

A chord has two nodes and a bridge. Each is a small group of terms. The nodes identify what is being related, and the bridge tells you how to read them together. Choosing a different bridge between the same nodes expresses a different idea.

Each node also has a tension relative to the bridge: + for alignment or attraction, − for opposition or repulsion, and null when the tension is unspecified. Both nodes can align with a bridge; a chord can express a mutually supportive relationship as well as a conflict.

For a simple illustration:

  • First node (tension: −): autonomy, discretion
  • Bridge: standardization, procedure, protocol
  • Second node (tension: +): consistency, predictability

Under this reading, standardization limits individual discretion and supports consistent outcomes. We could examine that relationship in settings as different as organizational procedures and software protocols. The signs belong to this particular interpretation of the relationship.

This is the compression I’m interested in: a few groups of terms preserve a way that concepts fit together, leaving room to recognize that relationship in another situation. The model’s explanation can be stored alongside the chord to preserve its intended reading.

The graph now contains roughly 35,000 chords. To build it, I used BaryGraph, a separate graph built from Kaikki dictionary data, with a hierarchy formed algebraically. It gave Nemotron Ultra starting points and an extended lexicon. From those seeds, Nemotron proposed relationships, selected terms for the two nodes and bridge, and assigned their tensions. The resulting chords preserve the ideas it expressed as structures that can be inspected, compared, and searched.

The name describes three parts of the project. The semantics come from the terms in each group. The chord’s structure comes from the roles those groups play. The geometry comes from composing the vectors of the first node, bridge, and second node through an ordered Kronecker tensor product, stored as a compact tensor sketch. This makes role order part of the vector used to search for similar relationships. The tension labels preserve how each node relates to the bridge. Once a chord is stored, it becomes a possible neighbor for the next search. How well that geometry captures useful similarities across different vocabularies is something I want to test.

The same idea works one level up. In a meta-chord, each node is itself a chord, and a third chord serves as the bridge. This gives the graph a hierarchy of relationships built from other relationships. A higher-level idea remains connected to its components, so it can be opened up to examine the specific ideas it was built from.

One meta-chord from the latest run connects fractal curves with fast numerical algorithms. Each item below contains a complete child chord, written as [first node] → [bridge] → [second node]:

  • First node (meta-tension: +) [fractalesque, fractalated] + [iterated function system, space-filling curve, recursive construction] + [gosper curve, peano curve, hilbert curve, flowsnake]
  • Bridge (meta-tension: —) [recursion, quines, fixed point, y combinator, self-reference] + [hofstadter, strange loop, fractal, iteration, self-similarity] + [l-system, recursive structure, fractal, iteration, self-similarity]
  • Second node (meta-tension: +) [numerical linear algebra, computational fluid dynamics] + [strassen algorithm, schĂśnage-strassen algorithm, toom-cook algorithm] null [scientific computing, applied mathematics]

The parenthetical signs give the tension at the meta-chord level. The three child chords retain their own internal tension pairs: (+, +), (+, +), and (+, null), respectively.

The resulting idea is that recursive organization can appear both as a geometric pattern and as a way of structuring a computation. Nemotron expressed that connection by composing three existing chords, each of which remains available to inspect.

This is what I mean by high semantic information density: a small structure can organize relationships between concepts whose detailed explanation spans many pages. Unpacking this meta-chord’s mathematical background, constructions, and connections could take tens of pages. The chord preserves the relational organization, while a model or reader draws on existing knowledge to develop the full explanation.

What I want to test is how much relational meaning survives in this compact form, and how reliably another model or person can recover the intended idea.

I’m looking for people who’d enjoy building or testing this with me. If two situations from your field come to mind that use very different vocabulary but turn on the same relationship, I’d love to hear the pair. That would give us something concrete to try.


r/Rag • • 9h ago

Showcase NornicDB - v1.5.4 - New Lands - PQC encryption and FGAC- MIT Licensed.

1 Upvotes

For both transport and at-rest encryption, New Lands brings us into alignment with new NSA/NIST-compliant standards.

The addition of XChaCha20 is in anticipation of a potential AES break. I have heard from multiple sources that any encryption that uses 2048 bit encryption hasn’t been broken, but I have it in good authority that the cost to break it has been reduced to GPU rental costs for, and the rest is conjecture: an algorithm designed by AI that is GPU accelerated to brute force the encryption for RSA and ECC.

These are wild times!

MIT Licensed,
Research-backed,
930+ stars and counting

features include FGAC (Fine-Grained-Access-Control) out of the box now as well, and new docs site and app UI. check it out here

if you like it give us a star!


r/Rag • • 20h ago

Showcase I built Pagelore: An open-source RAG backend with Graph RAG, hybrid search, reranking, and source citations

7 Upvotes

Hey everyone!

I've been working on Pagelore, an open-source RAG backend built with FastAPI and PostgreSQL, and I'd love to share it with the community.

The idea came from working with RAG systems and realizing how much effort goes into building and maintaining the retrieval layer itself: document ingestion, parsing, chunking, embeddings, vector databases, hybrid search, reranking, citations, and permissions.

I wanted to bring these pieces together into one flexible backend that any AI application can use.

What is Pagelore?

Pagelore turns your documents, websites, S3 buckets, and raw text into searchable, citation-ready knowledge.

It exposes a REST API that your chatbot, AI agent, or application can use to retrieve relevant passages, complete with their original sources and locations.

Some of its key features:

  • Flexible ingestion: 24 loaders supporting 266 file extensions, including PDFs, Word documents, spreadsheets, code, emails, audio, and video.
  • Multiple retrieval strategies: Vector search, BM25 keyword search, and hybrid search.
  • Reranking: 13 reranker integrations to improve retrieval relevance.
  • Knowledge Graph / Graph RAG: Extract entities and relationships to discover connections beyond traditional similarity search.
  • Query rewriting: Support for HyDE, query expansion, sub-questions, and more.
  • Context-aware chunking: 12 chunking strategies, including semantic, code-aware, Markdown, table, and JSON chunking.
  • Source citations: Preserve page numbers, sections, slides, timestamps, and other source locations.
  • Flexible infrastructure: 9 vector database backends and 18 embedding providers.
  • Access control: API keys with different scopes and per-document permissions.
  • Built-in evaluation: Generate test questions and compare retrieval configurations using metrics such as MRR, nDCG, recall, and precision.

One design decision I made

Pagelore is intentionally the retrieval layer, not an end-to-end chatbot.

It doesn't generate answers using an LLM. Instead, it retrieves the most relevant passages and returns them with citations.

This means you're free to use whichever LLM, agent framework, or application architecture you prefer.

Tech stack

  • Python / FastAPI
  • PostgreSQL
  • Qdrant (default vector database)
  • Configurable embedding and reranking providers
  • Docker Compose

Getting started

git clone https://github.com/saqrianoo/Pagelore.git
cd Pagelore
./run.sh --extras sentence-transformers

The API will be available locally, with interactive documentation at /docs.

GitHub: https://github.com/saqrianoo/Pagelore

Documentation: https://saqrianoo.github.io/Pagelore/

It's MIT licensed, and contributions are welcome!

I'd genuinely appreciate your feedback:

  1. What do you think is missing from the current RAG ecosystem that a project like this should address?
  2. Which retrieval techniques or integrations would you like to see added?
  3. If you're already building RAG applications, what does your current retrieval stack look like?

Would love to hear your thoughts!


r/Rag • • 17h ago

Discussion graph rag with just python and sqlite, no graph db. anyone else doing it this way?

4 Upvotes

a teammate at supermemory wrote a graph rag tutorial that skips the graph db, it's plain python and sqlite (neo4j is an optional last step).

say you want to know which european suppliers make parts for one scooter model. no single chunk has that. it's spread across a parts list, two purchase orders, a list of countries and an email. so you store facts as triples like (supplier) SUPPLIES (part) and walk them: scooter, parts, suppliers, countries.

the part i'd copy: only keep a triple the llm pulled out when the relation is one you defined, and the evidence it gives shows up word for word in the source. in their example that drops a HEADQUARTERED_IN leipzig edge the llm inferred but the text never said.

how are you doing entity resolution, rules, embeddings or another llm call?


r/Rag • • 17h ago

Tutorial How do you combine BM25 and vector search? A small worked example with reciprocal rank fusion

3 Upvotes

BM25 nails exact strings like ERR-482 but doesn't know "car" and "automobile" mean the same thing. vector search gets the paraphrase but can blur PROD-SKU-7842X and PROD-SKU-7842Y. so run both and merge the lists.

you can't just add the scores (BM25 has no fixed range, cosine sits between -1 and 1), so reciprocal rank fusion uses positions: each doc gets 1/(60 + rank) from each list. k = 60 is from Cormack et al., 2009. for "payment failed with ERR-482" (vector order assumed for the example):

| article | BM25 | vector | RRF |

|:-|:-|:-|:-|

| the ERR-482 article | 1 | 2 | 0.0325 |

| "why payments fail" | - | 1 | 0.0164 |

| an ERR-481 article | 2 | - | 0.0161 |

the right article wins because both lists found it.

did weighting one list beat plain RRF for you?

disclosure: i work for supermemory, and this is from a teammate's guide.


r/Rag • • 12h ago

Discussion Need help for LLM-powered Natural Language to SQL converter.

1 Upvotes

So, I am building an NL-to-SQL converter, but I don't know how to build a RAG system for it.

Problems:

What if RAG is unable to retrieve an important table required to build the query?

What if we need 6 tables to build a query, but K = 5?

What's the best way to create documents and generate embeddings for this use case?

I added a description for better retrieval and it looks like this

{ Table , Column: { Name, Constrain: // pk, Isnullable, Default, } Relationship: // fk only, Description, }


r/Rag • • 1d ago

Showcase Across 65 parsers and 1,753 table pages, general vision models now beat dedicated PDF parsers on almost every kind of table

21 Upvotes

Tables are notoriously difficult to parse out of PDFs and many people still default to dedicated document parsers when building RAG pipelines. I've been following ParseBench 2, an open benchmark from LlamaIndex that is probably the most active and rigorous document-parsing benchmark out right now, evaluating 65 parsers across 4,317 real enterprise pages. 1,753 of those pages are tables split across five categories, so I broke down the rankings inside each table type to see what actually holds up best.

Table typePages#1 overallVision models in top 5Best dedicated PDF parser
General tables500GPT-6.2 sol (medium) at 97.2%4 out of 5#5 LlamaParse Agentic Plus (96.3%)
Financial tables319GPT-6.2 sol (medium) at 96.7%5 out of 5#6 LlamaParse Agentic (94.9%)
Insurance filing tables412Gemini 4 neon (low) at 96.0%5 out of 5#6 LlamaParse Agentic (93.7%)
Dense tables373Gemini 4 neon (low) at 95.4%4 out of 5#2 LlamaParse Agentic Plus (94.6%)
Complex table headers149LlamaParse Agentic Plus at 91.4%4 out of 5#1 LlamaParse Agentic Plus (91.4%)

Looking at the combined table score across all 65 parsers, 6 of the top 7 are general-purpose vision models (Gemini 4, GPT-6.2, and Claude Opus 5.5). Financial tables and insurance filings are completely swept by vision models in the top 5 before a single dedicated PDF parser shows up at #6. Complex multi-level headers are the only table type where a dedicated parser takes #1, with LlamaParse Agentic Plus beating #2 Gemini 4 argon by nearly 4 points (91.4% vs 87.6%). On the open-weight side, the first self-hosted model doesn't show up until #21 (OCRia-1 and Infinity-Parser2 Pro, both at 86.3%).

The big catch here is cost. Those top-ranked vision models run anywhere from 2.3¢ to 6.5¢ per page. By comparison, dedicated parsers like Reducto r-1 (1.00¢/page), Datalab Accurate (1.00¢/page), and LlamaParse Agentic (1.25¢/page) sit only a few points behind on tables at a fraction of the price, while also beating vision models on the rest of the benchmark (charts, forms, and formatting), which is why dedicated parsers still lead overall.

None of this breakdown by table type or individual page is available on the official ParseBench website, which only shows the top-level averages. LlamaIndex does publish all the raw per-page parser outputs on Hugging Face though, so I downloaded them, re-ran ParseBench's own scorer and put it into a simple web viewer at https://parsebench.hashiromer.com/?dim=tables. You can sort all 65 parsers by any of the five table subsets, click into any parser's worst pages to see the original PDF next to the parsed output and exact scoring errors, or compare two parsers side by side.


r/Rag • • 1d ago

Showcase Single-PDF accuracy (80-93%) drops to 43% avg in an 84-PDF room: 1,026 blind Qs across FinanceBench, LegalBench-RAG, and Legal RAG Bench

6 Upvotes

Most document QA demos test one pre-selected PDF. In real M&A data rooms, analysts drop dozens of annual reports and over a hundred merger agreements into one shared folder and ask questions without specifying which file holds the answer.

We just published a 9-page empirical report measuring what breaks at that scale across 1,026 blind questions on six public financial and legal corpora: https://kulmin.ai/research

Kulmin builds verifiable, 100% EU-sovereign document analysis infrastructure for high-stakes decisions, embeddable via EU API or zero-export EU VPC, and deployed first as an AI deal room for M&A.

Three numbers from the benchmark stood out when moving from single-file evaluation to full shared rooms:

  1. Unified 84-PDF financial room (FinanceBench, >12,000 pages, >15M tokens, N=150, zero document hints)
  • On a single pre-selected filing in-context, live frontier baselines score 80.0% to 93.3% strict.
  • Merge all 84 filings into one shared room under standard top-16 retrieval and live frontier baselines fall by 30.7 to 53.3 percentage points, averaging 43.2% strict (range 26.7% to 62.7%; best full N=150 baseline reaches 62.7% strict / 67.3% lenient).
  • Across that 84x corpus expansion, Kulmin 100% EU Sovereign retains 94.8% of its single-filing strict accuracy (90.7% to 86.0% strict, 92.7% lenient, +23.3 pp over the best N=150 frontier baseline), with 100.0% document recall (150/150), 95.3% peak page recall, and 98.3% word-for-word verified citations (516/525). Kulmin Deep IC-Grade retains 96.3% (87.3% strict / 93.3% lenient).
  1. Legal boilerplate collision on 150 M&A merger agreements (LegalBench-RAG / MAUD, 52.7M chars, N=194 blind queries)
  • Across 150 real SPAs full of overlapping Material Adverse Effect, Go-Shop, and Fiduciary-Out boilerplate, a flat specialized commercial legal retriever with reranking drops to 13.1% character recall at 16 and 51.5% document recall (40.9 min corpus indexing).
  • Searching all 150 contracts blindly after 18s corpus setup, Kulmin reaches 81.7% recall at 4 (17.6% precision), 88.6% at 8, and 92.4% at 16 (96.4% span hit, 99.5% document recall). That is 7.0x the flat legal baseline and +26.0 pp above the pre-filtered Oracle-Doc legal baseline (66.4% at 16).
  • Across all four LegalBench-RAG suites (776 blind queries, 714 contracts: MAUD, CUAD, ContractNLI, PrivacyQA), macro averages are 99.7% document recall, 97.8% span hit, and 96.2% char recall at 16 (89.9% at 4 vs. 54.4% lexical baseline).
  1. Zero-hint 2026 legal corpus (Isaacus Legal RAG Bench, arXiv:2603.01710, 100/100, 4,876 passages, k=5, unmodified eval.py)
  • Important scope note: this compares Kulmin as an end-to-end system vs. standalone Kanon 2 Embedder baseline (86.0%) evaluated in Isaacus's reference stack under the same corpus, k=5 budget, and official judge protocol.
  • Kulmin achieves 97.0% exact single-passage Retrieval Acc@5 (+11.0 pp vs. standalone Kanon 2 Embedder baseline at 86.0%, 0/100 retrieval failures), 94.0% correctness, and 98.0% groundedness (100.0% groundedness with 0/100 unsupported claims in strict grounding mode).

Real trade-offs we report openly in Section 7:

  • Median uncached latency is 9.8s (EU Fast, 81.3% strict / 89.3% lenient) to 19.4s (EU Sovereign, p90 30.9s) and 23.0s (Deep IC-Grade). Too slow for interactive autocomplete; aimed at diligence queries where a wrong figure costs hours of manual review.
  • Public benchmarks use clean digital PDFs. Low-DPI scanned annexes, handwritten markups, and messy multi-tab Excel workbooks still drive upstream OCR and parsing errors in real VDRs.

Verification: the full evaluation archive is sealed locally under SHA-256 05a8b5a4497d5017c06623c370e5a00133bf6d364b85bad26349a3f25910a66f, with verifiable 3 to 5 question spot-checks available on request (we do not republish bulk third-party non-commercial corpora).

Curious what retrieval failure modes others here hit most when scaling past 50+ near-identical financial or legal PDFs in a single workspace.


r/Rag • • 23h ago

Showcase What we learned converting 12 messy public documents (forms, papers, scans, Word, PowerPoint) to Markdown for RAG

0 Upvotes

We're FedSignals Data. We built a hosted document-to-Markdown converter, so we're biased, but most of this applies whatever you use.

We ran 12 real public documents through it: IRS forms and publications, an arXiv paper, a W3C table example, a scanned 1960s memo, US government Word templates, a PowerPoint deck, a Wikipedia page, a spreadsheet and a broken link.

What we found:

  • Tables: 47 came out as Markdown tables (23 from PDFs, 24 from Word, PowerPoint and HTML). In PDFs we find tables from their ruling lines, so borderless tables come out as plain text, and merged header cells get flattened.
  • Forms are the hard case. Multi-column and form-style pages (tax forms) interleave text from neighbouring columns when you read line by line. Plan to clean these or skip them.
  • Keep page markers. We write <!-- page: N --> (and <!-- slide: N --> for PowerPoint) into the Markdown. After chunking (1,500 chars, 150 overlap) we got 741 chunks, and 96% carried a heading path, so answers can cite a page and a section.
  • OCR is slow and only as good as the scan. Tesseract at 300 dpi took about 14-15 seconds per dense page on one CPU core. The 1960s memo returned 637 characters of noisy text.
  • Fail cheaply on junk. The spreadsheet and the 404 were rejected up front instead of producing empty chunks.

If you can self-host, free libraries like Docling, Marker or MarkItDown may be all you need.

If you'd rather not run it yourself, ours runs on Apify: $0.005 per document (first 10 pages included), $0.001 per extra page and $0.01 per OCR page. Apify's free plan includes $5 of usage a month. https://apify.com/fedsignals/documents-to-markdown

What's working for you on borderless tables? That's our weakest spot.


r/Rag • • 1d ago

Discussion the silent failure is the one with a plausible reason to be right

1 Upvotes

I run a local index over a codebase, and the failures that actually cost time were never the crashes. They were the answers that had a reason to be right. The record that was never written gets found. The revision that quietly moved does not.

Numbers below are from one repository, one machine, static analysis over roughly five weeks - 930 files, 6701 symbols, 92409 edges, and a little over 1400 revisions.

The two-day stale answer.

After a file changed, my index kept answering from the old revision, and the answer read as current. No error, no log line, nothing looked off. I only noticed because the behavior shifted - "the tests pass but the answer changed" - and I chased it backward to a reindex that had never run. Two days, found by reasoning about a subtle difference, not by any signal the system produced.

The fix was not a smarter staleness check. It was making the revision part of the answer itself. Every fact now carries the revision it was served from, and if the file changed after indexing, the index refuses to answer and returns a stale status instead of a fact. A stale answer stopped being a confident wrong answer and became a named state.

Why "not found" needs a reason.

The same logic applies to emptiness. My index returns three kinds of "no": absent (not in the corpus), stale (the file moved and I will not answer until reindexed), and out-of-scope (the corpus was never meant to cover it). Only absent is a real "no". Before I split them, all three looked like an empty list, and the model could not tell "there is nothing" from "I would not look here".

The split matters because the three have different fixes, and because a system that collapses them is honest-sounding and useless - it abstains on everything and calls it correctness.

The assertion that caught more than any score.

The worst regression I had looked like a model downgrade: 90% to 60% on a fixed task set. It was not the model. The local build was answering nothing - every task returned empty, and the harness scored the empty result as a normal answer. One assertion changed that: a model call must have happened and returned non-empty output before the score counts. Two lines per task, and it caught more breakage than any quality metric, because silence in an agent stack is usually indistinguishable from a confident answer.

Where it broke, and the rule that replaced the average.

Once, a change made the answers shorter and more readable, and dropped the addresses. The score went up, because the text read better. The thing I needed - the ability to open the file and confirm - disappeared silently. That is the exact shape of the failure I am describing: a plausible reason to be right, hiding a broken thing.

The rule that replaced the average is "no previously passing case may fail". On 14 fixed navigation tasks, one flaky case moved the average by 7 points and hid two regressions. A threshold passes while a regression hides; a prohibition does not.

The uncomfortable part: none of these are model work. They are about refusing to serve an answer that cannot say what it was served from, and refusing to score a run where the model did not run. The silent failure is the one with a plausible reason to be right, and the only defense is to make the reason explicit and checkable.


r/Rag • • 1d ago

Showcase my open source parser on claude haiku 5.5 beat reducto on 6 of 14 benchmark scores. lost on 4. here are all of them

1 Upvotes

been building an open source document parser on claude haiku 5.5 (sonnet 5.5 only kicks in for handwritten pages). ran it against reducto's hosted api on the public benchmarks. same pages, each benchmark's own grader, no llm judging anything

out of 14 scores: ahead on 6, basically tied on 4, behind on 4

where it beat reducto

  • olmocr-bench overall (1,403 pages): 85.4 vs 80.9
  • multi column pages: 80.9 vs 65.6. biggest gap by far
  • long tiny text: 94.1 vs 84.2
  • old scans: 52.9 vs 49.0 (both still bad tbh)
  • omnidocbench text, 1,651 pages (edit distance, lower is better): 0.050 vs 0.095
  • reading order: 0.142 vs 0.161

basically tied

  • rd-tablebench, which is reducto's own table set: 88.84 vs 88.85 lol
  • omnidocbench tables: 88.1 vs 87.9
  • headers and footers: 90.3 vs 90.1
  • funsd forms: 77.4 vs 78.6

where it loses

  • olmocr tables: 89.8 vs 92.7
  • formulas: 0.152 vs 0.133
  • layout, block type right: 83.4 vs 84.6. block found: 64.4 vs 67.2
  • speed. 20-50 sec a page vs about 4. not close at all

cost is $0.003-0.005 a page vs their $0.010 list price, you bring your own anthropic key

results and the scripts are all in the repo so you can rerun any of it. if you need speed its not for you yet

what docs break your parser the most? would rather add a set where it fails than another one where it wins


r/Rag • • 1d ago

Showcase Does offline RAG run in your phone's browser? Open study: tap one button, paste the result (no personal data)

0 Upvotes

I'm running an open, non-profit study on a simple question: **can an ordinary phone run source-grounded AI with no internet, in the browser?** Phones improve every year and in some countries they're probably already good enough, so I want real numbers from many devices, and I'll repeat the measurement every three months.

The app: https://figueand.github.io/OKP/

  • It downloads a small knowledge pack (exercise, safe water and emergencies, mountain safety) plus a model (Llama 3.2 1B or Qwen 2.5 1.5B via WebLLM/WebGPU). After that it works in airplane mode.
  • Every answer cites the card it comes from. If the cards don't cover the question, it says so instead of making something up.
  • If the model doesn't load, "search only" mode still shows the right card with its source.

**How to help (2 minutes):**

  1. Open the link, pick a topic and "Liviano" (light) as the model. Close other apps first.
  2. Ask one or two questions.
  3. Tap **"Contar cĂłmo anduvo en mi telĂŠfono"** at the bottom, copy the text and paste it here as a comment.

The text includes the phone model, browser, RAM as reported by the browser, GPU, whether the model loaded, tokens/s and time to first token. **No questions, no answers, nothing personal.** Nothing is sent automatically. If your phone froze, that's a useful result too: reopen the app and the report will say so.

What I know so far: in-browser AI froze a mid-range Android twice in Chrome; search mode worked fine in Firefox. Retrieval on the test sets: hit@3 92–96 %, correct "I don't know" 71–100 % depending on the pack. Natively (PocketPal), Gemma 3 1B ran at 9.9 tokens/s on an 8 GB Moto G.

Protocol (written before collecting data), data and analysis scripts are public: https://github.com/figueand/OKP/tree/main/investigacion ¡ Apache 2.0, data CC BY 4.0.

Results will go back to this thread.


r/Rag • • 1d ago

Discussion How are you handling changes to documents in your RAG systems?

4 Upvotes

We're working on dynamic content ingestion, allowing businesses to connect their existing knowledge sources and automatically update the information their AI assistants rely on.

Something we've been considering is how to handle updates efficiently, especially when only a small part of a large document has changed.

Reprocessing and embedding the entire document every time could become expensive, particularly when you're managing knowledge sources for multiple businesses.

There's also the question of how to ensure retrieval doesn't return outdated information while an update is taking place.

For those running RAG systems with frequently changing knowledge sources, are you reprocessing entire documents or identifying and updating only the parts that have changed?

How are you handling retrieval while those updates are taking place?


r/Rag • • 2d ago

Showcase Chunk Size in RAG: Too Big vs Too Small (and How to Test It)

7 Upvotes

A support assistant gets asked: “Can I still get a refund?” It answers, “Yes — within fourteen days.” Confident, polite, and incomplete: refunds only apply if no projects have been exported.

The model is not the only suspect. In RAG, documents are split into chunks before retrieval, and the split decides what the retriever can even find:

• Chunks too big — the refund rule sits in one chunk with billing, cancellations and FAQs. Similar is not the same as correct; retrieval drags in noise.

• Chunks too small — the deadline lands in one chunk, the export condition lands in another. All the pieces are there; the meaning is not.

What helps in practice: keep related information together (rule + condition + short explanation), use overlap at boundaries as a tool rather than a fix, and test like an engineer — collect real questions, run retrieval with different strategies, inspect what comes back, check whether answers are supported, refine.

Two clarifications that come up often: chunking is not the model's tokenizer (it is a separate splitting decision made during preparation), and there is no universal chunk size — it depends on your documents, your questions and your embedding model.

I put the full walkthrough into a 3-minute video — the refund example, the pipeline, both failure modes, and the testing loop.

🎥 Watch here: https://www.youtube.com/shorts/yuJ0812OEH0

I'd appreciate honest technical feedback.


r/Rag • • 1d ago

Discussion DOYNA beat Big AI Labs in biggest Benchmark

0 Upvotes

DOYNA (disclosure: our product, closed source): a company's private AI on its own server. Onyx scored it 83.99 on EnterpriseRAG-Bench (13th of 47): 500 questions over ~500K synthetic internal company docs (Slack, Gmail, Jira, Drive, HubSpot and more). Our run was fully local on one RTX 5090 with Qwen 3.8 27B; the same model in haiku.rag's entry scores 73.11. Limits: synthetic, English-only, no ERP data. Leaderboard: https://huggingface.co/spaces/onyx-dot-app/EnterpriseRAG-Bench-Leaderboard. Happy to talk about where it fails.


r/Rag • • 1d ago

Showcase I built a lightweight, 100% self-hosted FastAPI engine to strip "AI Slop" from scraped docs and cut RAG token costs by ~59%

1 Upvotes

Hey r/Rag,

While indexing scraped web articles into vector databases, I kept running into the same issue: modern web text is full of repetitive LLM filler (*"In today's fast-paced digital landscape..."*, *"It is important to note..."*, *"game-changer"*). Indexing this fluff pollutes embeddings and wastes context tokens without adding any factual signal.

To clean datasets without sending proprietary company data to third-party APIs, I built **AI Slop Cleaner**—a Dockerized Python/FastAPI service that runs 100% on your own infrastructure.

**How it works:**

* **3-Layer Hybrid Detection:** Combines **Perplexity** scoring, **Goh-BarabĂĄsi Burstiness** variance analysis, and a zero-latency offline **Heuristic Engine** (EN/TR).

* **Zero Data Retention:** Everything runs in-memory on your own server.

* **Built-in ROI Analytics:** Tracks exact tokens saved and cost reduction per request via `/v1/usage`.

**Real Test Output (Sample):**

* **Input:** *"In todays fast-paced digital landscape, artificial intelligence plays a pivotal role in transforming modern businesses. It is important to note that this paradigm shift is a game-changer. At 09:15 AM, turbine pressure dropped from 4.8 bar to 3.1 bar due to a cracked valve."*

* **Cleaned Output:** *"At 09:15 AM, turbine pressure dropped from 4.8 bar to 3.1 bar due to a cracked valve."*

* **Result:** Stripped 2 filler sentences (`0.8624` AI probability) and reduced tokens from **66 → 27 (59% token savings)** while keeping the actual sensor data untouched.

If you want to drop this directly into your ingestion pipeline via Docker, you can grab the compiled, ready-to-deploy production bundle here:

👉https://coreraglabs.gumroad.com/l/ai-slop-cleaner

Happy to answer any technical questions about the burstiness windowing or heuristic scoring


r/Rag • • 2d ago

Discussion Older Claude models with RAG beat newer Claude Chat services at legal reasoning

4 Upvotes

Here’s a little hopium if you’re building legal AI tools, or if you’re a practising lawyer concerned about the major AI labs encroaching on the market:

Anthropic’s older, supposedly inferior models running on a basic RAG pipeline consistently outperform its newest models running in Anthropic’s own flagship chat app on Legal RAG Bench.

TL;DR: A nearly one-year-old Sonnet 4.6 on a basic LangChain RAG pipeline scores 86% on Victorian criminal law questions, while Opus 5.5 in the Claude app, Anthropic’s “new leading model”, scores 81%. Older models using RAG won across every family (Opus, Sonnet, and Haiku), even though the chat app had internet access. Most of the chat misses came from picking the wrong legal rule, and the older RAG models got most of those right, usually with the right passage sitting in their top five results.

RAG vs. Chat

Late last year, while working on my legal reasoning benchmark Legal RAG Bench, I noticed a major disparity between how LLMs performed inside a RAG environment and how they performed in the labs’ chat services. In my informal testing across the three major closed-source model families, Gemini, Claude and GPT all performed better at legal reasoning in a simple LangChain legal RAG pipeline, including with distractor passages and a mixed legal corpus, than their flagship chat counterparts did.

Even when I sabotaged my own RAG pipeline and gave the chat services more contextual clues (full access to the internet, plus leads to use the Victorian criminal law bench book that Legal RAG Bench is based on), the chat versions of the models would consistently underperform their RAG counterparts.

As new model versions came out, I couldn’t detect a noticeable improvement in chat performance relative to what I remembered from late last year. Eventually, I gave in to my curiosity and decided to run some proper tests on the progress of Anthropic’s models. Sure enough, my intuition was right.

The results

I got Claude Chat, with chat memory off, internet access on and Medium effort, to answer the 100 test questions in Legal RAG Bench. They’re all about Victorian criminal law, were handwritten with input from legal experts, and are based on the Victorian Criminal Charge Book. The chatbots were given a simple instruction to answer the questions, with a context clue that they were all about Victorian law.

I then compared this to the performance of the same model families, but from an earlier generation, running on a simple LangChain RAG pipeline that used Kanon 2.5 Embedder to retrieve passages at k=5. No reranker was used. GPT‑6.2 Sol judged every answer against the same benchmark references at high reasoning effort. The data is on Hugging Face and the eval code is on GitHub. Both the data and code are open source, so you can try them yourself. (Disclosure: I work at Isaacus, which makes the embedder I used.)

Here were the results:

FamilyRAG modelAccuracyClaude Chat modelAccuracyRAG lead
OpusOpus 4.6 (Feb 2026)88%Opus 5.5 (Sep 2026)81%+7 pts
SonnetSonnet 4.6 (Feb 2026)86%Sonnet 5.5 (Sep 2026)79%+7 pts
HaikuHaiku 4.5 (Oct 2025)79%Haiku 5.5 (Oct 2026)60%+19 pts

Across every model family, Anthropic’s earlier-generation models perform better in RAG than its newest models perform in chat. Remarkably, Haiku 4.5 with RAG scores 19 points higher than Haiku 5.5 in chat, despite being a full year older, the biggest gap in time of any pair. I’d have liked to push the generations back even further, but I unfortunately wasn’t able to benchmark Opus 4.5 and Sonnet 4.5 via Anthropic’s public API.

Nevertheless, the effect seems pretty clear... an older Claude in a basic RAG setup beats a newer Claude in Anthropic’s own chat service. The question remains whether it’s the retrieval, the newer models themselves, or the non-determinism and variable effort of chat that makes most of the difference.

What Claude Chat got wrong

To explore this question, I went through the 80 answers the LLM judge marked wrong across the three chatbots, and classified each one into one of the following failure modes to work out where the disparity lay:

  1. Wrong legal rule: the chatbot used the wrong legal test, classification or term
  2. Omission: the chatbot left out a necessary point, or missed the source or wording the question explicitly asked for
  3. Added a wrong condition: the chatbot added a condition the law doesn’t require, and it changed the answer
  4. Hedged: the chatbot gave the right answer but undercut it with caveats, added contingencies or extra alternative theories
Failure modeOpus 5.5Sonnet 5.5Haiku 5.5TotalShare of misses
Wrong legal rule1013214455%
Omission46142430%
Added a wrong condition42178.75%
Hedged10456.25%
Total incorrect answers19214080100%

The largest source of inaccurate responses was applying the wrong legal rule, followed by omissions. Both are what you’d expect poor retrieval to cause: if a model is working from the wrong kind of authority, it’ll apply the wrong rule, and if it’s working from irrelevant material, it’ll leave things out.

I didn’t measure hallucinations, but Opus 5.5 and Sonnet 5.5 made far fewer wrong-rule and omission errors than Haiku 5.5. That suggests the bigger models may have better legal intuitions to fall back on when their sources let them down.

To get a better sense of whether poor retrieval was to blame, I took the 44 misses from the first failure mode and checked how the older RAG model from the same family answered each one. It got 26 of the 44 right. In 24 of those 26, the benchmark’s supporting passage was among the five retrieved, suggesting that when retrieval is sound, these models do much better. Looking at Opus 5.5 on its own, at least one of the three RAG runs got 17 of its 19 misses right.

You be the judge

I’ve collected some holdout questions that Opus 5.5 chat got wrong in my runs. You can try these questions yourself and see how your chatbot responds. I unfortunately don’t have access to any legal corpus MCPs or connectors, so I couldn’t try that out, but that would be interesting to test too and share here.

For the lawyer-friendly version of the Legal RAG Bench questions, the original Legal RAG Bench post has an interactive explorer that lets you read the question-answer pairs alongside each RAG pipeline's retrieved passages. If you'd like a quick sample, try the holdout questions below and see what your chatbot gives you when compared to the answer.

1. Commenting on an accused’s silence

Question

Sarah is tried for armed robbery. She does not give or call any evidence. In closing, the prosecution avoids mentioning her silence directly but repeatedly stresses that “only the prosecution’s account is supported by evidence.” Is this submission by the prosecution permissible?

Answer

Yes, on the facts given. The prosecutor can describe which account has evidentiary support, provided the argument stays focused on the evidence before the jury.

Actual results: Opus 5.5 in Chat answered “Probably not,” citing s 20(2) of the Evidence Act and Azzopardi. It assumed only Sarah could have contradicted the prosecution, a fact the question never gave. All three Chat models missed it. The stronger Sonnet 4.6 and Opus 4.6 with RAG got it right.

2. Comparison evidence vs. recognition evidence

Question

In an armed robbery trial, a shop assistant who has served the accused every week for years is shown still images from CCTV and says, “Based on how he looks, that’s the same customer who comes into my store.” What type of identification evidence is this an example of?

Answer

Comparison evidence. The assistant is comparing the person in the stills with someone they already know.

Actual results: All three Chat models called it recognition evidence, and Opus 5.5 and Sonnet 5.5 both leaned on Smith v The Queen. All six runs missed this question, including all three RAG runs, which had retrieved the supporting passage.

3. Dangerous driving vs. culpable driving in Victoria

Question

While driving late at night, Jerry fails to see a cyclist and runs him over, killing him instantly. Jerry was not drunk, reckless or negligent. Why does it matter to the prosecution that Jerry knew his headlights were broken before driving?

Answer

Because it allows the prosecution to argue that Jerry was driving dangerously, which is a separate offence to culpable driving. As the bench book explains, in assessing the elements of dangerous driving ‘the jury may also consider the question of whether, in all the circumstances, the accused should have been driving at all. In making this determination, the jury can take into account factors such as the condition of the vehicle.’ In this case, Jerry was not reckless or negligent, but his decision to drive while his headlights were broken could be proof of Jerry driving dangerously.

Actual results: Opus 5.5 mentioned dangerous driving, then also suggested recklessness and gross negligence, which the question had already ruled out. Sonnet 5.5 and Haiku 5.5 skipped dangerous driving entirely and argued recklessness or gross negligence. All three RAG runs got it right. All three Chat runs missed it. Victoria is quite idiosyncratic in its distinction between dangerous driving and culpable driving, so this is a good use case on the value of good context engineering and retrieval.

What I’d take from this

It's always fascinating to see even the most advanced models fail at relatively simple tasks. From these failures, we can learn a lot about what our value add is as human in a post-AI world. To me, some safe inferences we can draw are that, at least in law, organisational knowledge, context engineering and custom RAG pipelines still add a lot of value in shaping full-stack legal intelligence. So...

If you’re a lawyer or practitioner, it’s important that you guard your strategic assets: your client data and your firm’s institutional knowledge. If you’re in a mature enough firm, designing a bespoke RAG app is probably your best bet for creating a durable competitive advantage, both against your law firm competitors and against other players along the AI stack.

If you’re in a legal tech company, or already have an existing RAG pipeline, it’s worth weighing the diminishing marginal returns of more expensive, slower and bigger models against what better retrieval, encoder and NLI solutions like Jev can provide for law. With better retrieval and context engineering, you can outperform your competitors, and even Anthropic’s own chat app, in the direct B2C market.

More broadly, I don't see iterative improvements to frontier generative models improving this retrieval bottleneck problem. There are always a couple of months' lag between a new model release and the training data that model saw. Good law, especially in common law jurisdictions like Australia, US, UK, etc. depends highly on ever-changing headwinds. A single landmark Supreme Court/High Court ruling can entirely invalidate years of common law precedent, such as what we saw with Dobbs. Even in civil law jurisdictions, regulations in sensitive areas like AI, online privacy, consumer law, etc. see constant revisions or repeals.

Some caveats

Chat services don’t let you tweak temperature, so their responses are non-deterministic. I made sure to deactivate memory for these runs, but did allow internet access (to simulate some permutation of Anthropic’s idea of RAG). When I experimented with higher effort levels, I found much worse stability in the answers. Here’s a question you can try yourself, where I’ve consistently gotten mixed results across effort levels:

Question

Police have detained and taken DNA samples from three of four full siblings in a carjacking investigation: Chloe (female, 24), Sam (female, 23), and Joseph (male, 22). The fourth sibling, Kyle (male, 22), was not detained or sampled. Mitochondrial DNA testing of a crime scene sample links all three sampled siblings to the scene. Y-STR testing (which examines Y-chromosome DNA passed from father to son) links Joseph to the scene. Nuclear DNA testing also links Joseph to the scene. Is this information sufficient to reasonably link Joseph to the crime scene?

Answer

No. This information is insufficient. Joseph and Kyle are both 22-year-old males, so they may be identical twins. If they are, nuclear DNA testing would not distinguish between them, and both would match the crime scene sample. Without knowing whether Kyle is Joseph’s identical twin, we do not have sufficient information to uniquely link Joseph to the scene.

At Medium effort, Opus 5.5 and Sonnet 5.5 actually got this one right in Chat, whereas bizzairely higher effort levels of Opus and Astra only intermittently get this answer right and in many cases they try to gaslight me that they are right to link Joseph to the scene, even though we have pretty established caselaw on the 'evil twin' SODDI defence in Australia.

I'm curious to see what other people's chatbots say, so feel free to post it here.


r/Rag • • 2d ago

Discussion Cloud vs office rig vs hosted bare metal for 4x RTX PRO 6000

0 Upvotes

We're a small team, 4 to 6 of us depending on the week, running 70B+ models and long context agents side by side (Qwen on SGLang with RadixAttention) and I spent way too long going back and forth on where a 4x RTX PRO 6000 box should actually live

cloud was the easy answer at around $2 a GPU hour, so $8/hr for all four, and at our ~60% usage that's about $42k a year. but cold starts were driving everyone nuts and keeping it warm 24/7 pushes it closer to $70k, with nothing to show for it after

the office rig is ~$104k all in and four passive 600W cards pull ~2.4kW before the CPUs even count, so it turns into an electrician and cooling and ventilation and noise problem in a room that was never meant for it

What made hosted bare metal work for us was not having to find $104k at once. we went through B3IQ which does rent to own, so it was 30% down, about $31k, and the rest paid off monthly at 8% while the box sits in their Oregon facility. we hold the root SSH keys and the hardware is ours, it's just financed like a car instead of paid like a server. the tradeoff is we can't touch it, a dead drive means a ticket and a wait, and if concurrency goes past what 384GB of VRAM can handle we still spill over to APIs, so it's a weird middle ground but it's the one that actually fit our cash


r/Rag • • 2d ago

Showcase How our adaptive routing outperforms leading LLM routers on quality and cost

0 Upvotes

TL;DR

You shouldn't have to trade quality for cost for your LLM calls. Weflayr's Adaptive Router gives you both, with two optimisation modes: Best Quality scores +20 quality points at 71% lower cost than Opus 5.5, and Same Quality +5 points at 89% lower cost.

Against OpenRouter's best router (Auto Router, xhigh), they score +22 and +7 points respectively, at 25% and 72% lower cost.

Most LLM routers rely on classifiers trained on generic data, which poorly predict how models perform on a specific use case. On top of that, switching models is risky: a model that scores higher on public benchmarks can still degrade an agent's behavior.

We address both problems with an approach we call Adaptive Routing. It benchmarks candidate models on a use case's past requests, then routes each new request based on how each model performed on similar requests. Teams can review each model's results on their own workloads before switching any production traffic.

The dataset and results are available on Hugging Face.

1. One model for every request is expensive

Hundreds of AI models are available, each with different strengths. Yet most AI products still send every request to one model, because choosing a model per request without sacrificing quality is hard.

The most cost-effective model varies from request to request, and only a product's own requests can show which model performs best for each one.

Most off-the-shelf routers rely on classifiers trained on generic data to predict which model to send requests to. At the same time, teams often rely on public benchmarks to compare and select models, even though these measure performance on someone else's tasks. Neither tells teams how the models will actually perform on their own requests. As a result, switching to a model that looks better on paper can still degrade an agent's behavior.

We built Weflayr's router around that missing signal. It first benchmarks candidate models on a use case's own requests, against the model(s) it uses today. It then routes each new call based on how each candidate performed on similar calls, according to the team's predefined cost and quality objectives.

Unlike generic classifiers, the router learns each use case's specific instructions, tools and recurring patterns, allowing it to focus on the request-specific signals that matter most for model selection. We call that Adaptive Routing.

2. Adaptive Routing in more detail

First, we benchmark models using a sample of a use case's calls. Then, the router applies what it learned to route every new call.

Model benchmarking

The benchmarking phase evaluates candidate models across all reasoning levels. The candidate models are chosen based on their prices, to meet pre-defined cost objectives. Based on these results, it iteratively explores different model combinations using the router (described below) to identify the mix that maximizes quality.

Judging the quality of an answer

  1. We generate specialized evaluation criteria by parsing the agent's requests to identify its instructions, tools, response formats and recurring patterns, focusing on the business context. PS: In the product, users can review these criteria and add their own.
  2. We compare candidate model answers side by side with the baseline's answer, so every result is relative. For each benchmark call, the judge sees the request, the baseline model's answer and the candidate model's answer, then decides whether the candidate is better, equivalent or worse than the baseline.

This is a deliberate choice. Absolute grading ("is this answer correct?") is often unreliable in real-world applications, even when compared against a ground truth. Answers can be partially correct, omit information or include unnecessary details, making even human experts disagree on how to grade them. Side-by-side comparison makes evaluation more reliable for LLMs and more relevant to routing: it tells us whether switching models improves or degrades the result, regardless of whether the baseline answer itself is good or bad.

Side-by-side relative grading also shows better where a candidate improves or degrades production behaviour, helping teams decide whether switching is worthwhile.

3. A single judge can introduce provider-specific bias, favoring answers generated by models from its own provider. To mitigate this, we use a panel of judges from three different providers.

Router

For every incoming call, the router finds the benchmark calls most similar to it and looks at how each candidate model performed on those calls. By aggregating their verdicts, weighted by similarity, it estimates which models are most likely to match or beat the baseline model's quality for that specific request.

Finding similar calls

To identify similar calls, the router combines two signals:

  • Semantic: embeddings capturing what the request is about, such as the latest message or tool definitions.
  • Structural: features such as request length, number of turns and tool calls, capturing the shape of the call.

Predicting each model's quality relative to the baseline

For each candidate model, the router looks at how it performed on the most similar benchmark calls, giving more weight to calls that are closer to the incoming request.

This produces a quality score per model: an estimate of the likelihood that its answer will be as good as or better than the current model's.

Choosing which model to call

The router selects a model according to the chosen quality-cost objective:

  • Best quality: selects the model with the highest predicted quality score, using the cheapest model to break ties.
  • Same quality: selects the cheapest model whose predicted quality meets or exceeds the baseline's.

3. Experiment & results

Experimental setup

We evaluated our Adaptive Router on 1,177 test calls across 11 use cases: 10 from the public SOPBench and τ²-bench benchmarks, and one from anonymised production traffic. Each use case shares the same system prompt across its requests. We used 5-fold cross-validation: for each use case, the router was benchmarked on 80% of the calls and tested on the remaining 20%, rotating the split so that every call was tested exactly once and never seen during benchmarking. The dataset and results are available on Hugging Face.

We compared our method against two alternatives:

  • Claude Opus 5.5 alone (default reasoning): the quality baseline.
  • OpenRouter's routing solutions: Auto Router and Jev Router, both included as relevant market references. Jev-based routing has attracted significant attention, making it particularly interesting to evaluate its actual performance.

The candidate model pool considered by the routers comprised 18 models across 9 providers:

  • OpenAI: GPT-6 Luna, GPT-6 Sol, GPT-6.1 Sol
  • Anthropic: Claude Opus 5.5, Claude Sonnet 5.5
  • Google: Gemini 3.8 Flash, Gemini 3.5 Flash-Lite, Gemini 3.1 Pro Preview
  • xAI: Grok 4.7
  • Moonshot: Kimi K3
  • Alibaba: Qwen 3.8 Max, Qwen 3.8 27B, Qwen 3.8 Flash
  • Z.ai: GLM 5.3
  • DeepSeek: DeepSeek V4 Pro, DeepSeek V4.1 Flash
  • Mistral: Mistral Medium 3.5, Mistral Small 2603

Methodology

We measured quality as the percentage of calls where a strategy's answer is judged better than Opus 5.5 minus the percentage where it is judged worse. Ties count as neither. A positive score therefore indicates a net quality improvement over Opus.

Answers were evaluated by GPT-6 Luna and Claude Haiku 5.5, with Gemini 3.8 Flash resolving disagreements.

For all costs, we assumed zero cached tokens to avoid bias.

Results

Weflayr achieves a stronger quality-cost trade-off across both routing modes:

  • Our best quality mode outperforms both Opus 5.5 (+20 points, 71% lower cost) and OpenRouter's best-performing Auto Router configuration, xhigh (+22 points, 25% lower cost), on quality and cost.
  • Our same quality mode slightly exceeds Opus 5.5's quality (+5 points) at 89% lower cost, making it by far the cheapest option that preserves baseline quality.

Comparison with LLMRouterBench, an official benchmark

We evaluated Weflayr on LLMRouterBench (Li et al., 2026), a public benchmark providing model outputs, accuracy scores and costs across 10 tasks. Its released results cover 13 models and six published routing methods across different configurations, including OpenRouter's Auto Router.

We followed the benchmark's evaluation protocol: for each task, we used 70% of the prompts to benchmark and calibrate our router, then evaluated it on the remaining 30% using pre-annotated model results to determine whether each selected model gives a correct answer, repeating the process across five different splits and using GPT-5 as the strongest single-model baseline.

  • Best quality: Weflayr achieves 5.4% higher accuracy than GPT-5 at 10% higher cost, outperforming the best published router, Avengers-Pro (+4.0%), but at a 12.2% higher cost.
  • Same quality: Weflayr matches GPT-5's accuracy (+0.3%) while reducing cost by 40%, compared with 30% for Avengers-Pro.

Across both quality modes, Adaptive Routing consistently delivers a better quality-cost trade-off than the routing alternatives tested. The gains are larger on our main benchmark, where the router is calibrated on a single use case. That's because Weflayr isn't built to find the best model in general, but the best model for your application, by learning its specific request patterns and quality requirements.

Beyond model selection, Weflayr is purpose-built for production AI

Adaptive Routing is only part of what it takes to run AI models reliably in production. Weflayr also gives teams fine-grained control over how their models are used.

Caching-aware optimisation & routing

During benchmarking, Weflayr analyses historical calls to identify each model's optimal caching configuration and breakpoints, which can then be enforced in production.

At runtime, Weflayr reuses the same model across requests sharing the same cache, maximizing prompt-cache hits to reduce latency and cost. Teams can configure when Weflayr is allowed to break the cache when the current model is unlikely to meet the required quality. This avoids a common limitation of other routers: locking an agent into a cheaper model after an easy request, even when a subsequent, more demanding request needs a stronger one.

Control and reliability

Teams can define granular routing rules based on quality, cost and business-specific requirements, including customer-level context and economics.

Weflayr also automatically adapts requests to each model to preserve consistent behaviour across providers, and "self-heals" to avoid 400 errors (e.g. when passing temperature to a model that doesn't support it). If a model is unavailable or unhealthy, requests are automatically routed to a fallback.

Developer-friendly workflows

Weflayr can be configured either through the UI or directly through coding-agent skills. Whether connecting your application, benchmarking calls, inspecting results or defining routing strategies, everything is designed to be straightforward and accessible.


r/Rag • • 2d ago

Tools & Resources A Python package for a visual report of your RAG chunking, fully offline and framework-agnostic

8 Upvotes

While building a RAG pipeline over a set of internal technical docs, I kept running into the same question: what did my chunker actually do to my documents?

Bad chunking fails silently. A table gets split from its header, a code block is cut in half, a paragraph falls between two chunks, a chunk is longer than the embedding model's limit and gets truncated. Retrieval metrics don't point you to any of this; you just get worse answers. My "workflow" was printing a few chunks to the terminal and scrolling.

So I built chunkscope, an open-source Python package that turns the output of any chunker into a single offline HTML report.

What it shows

  • Every chunk highlighted in place in the source document, with overlaps and gaps (text that ended up in no chunk)
  • A chunk map of each document and the size distribution, in characters or in tokens of your embedding model
  • 17 checks: chunks over the token limit, split tables and code blocks, mid-word and mid-sentence cuts, heading-only chunks, duplicates…
  • Side-by-side comparison of several chunking strategies or sizes
  • Optional retrieval overlay: pass the scores for a query and see which chunks ranked where, in context

How it works

pip install chunkscope

import chunkscope
chunks = splitter.split_documents(docs)   # whatever you already use
chunkscope.report(chunks, source=text)    # writes and opens the report

It works with LangChain, LlamaIndex, Haystack, Chonkie, Docling and Unstructured output, or plain strings and dicts, without importing any of them. No dependencies.

The report is one HTML file with no network access (blocked by a Content-Security-Policy), no CDN and no telemetry, so it's safe to use on confidential documents. There is also a CLI with --fail-on error if you want chunking checks in CI.

Live example report and docs: https://belarif.com/chunkscope

GitHub: https://github.com/spydersy/chunkscope

PyPi: https://pypi.org/project/chunkscope

Honest limitations

It's an alpha (0.2) and my first published package.

  • It shows the extracted text your chunker received, not the original PDF page.
  • Docling and Unstructured support is based on their documented output and not yet tested on real PDFs.
  • The checks are most useful on Markdown-like technical docs.
  • I haven't tried it on very large corpora yet.

What I'd love feedback on

  • How do you inspect your chunking today?
  • Would checks in CI be useful to you, or is this something you only look at while tuning?
  • What breaks when you run it on your data?

Issues and brutal feedback welcome.


r/Rag • • 2d ago

Discussion How are people handling RAG for math/STEM PDFs? (Looking for tools, GitHub repos, or thoughts)

1 Upvotes

I'm working on a project around building a better RAG pipeline for STEM documents.

If you just drop a single math or science PDF directly into an AI chat, it can usually read the equations and diagrams fine. The issue starts when you actually try to build RAG over a collection of these docs. Standard OCR and text chunking tend to scramble formulas, miss charts and tables, and split proofs or multi-column layouts in weird places.

I'm looking into a more vision-first, layout-aware retrieval approach instead of the usual text-only pipeline, and wanted to get some input from people here:

- Are there any platforms, tools, or resources you'd recommend trying out for extracting and retrieving STEM content properly?

- Are there any good open-source projects or GitHub repos already doing this? I'd love to check out existing code first, and if there isn't much out there, I'm planning to build it myself.

- Is this something people are actually interested in or actively trying to solve right now?

Would really appreciate any pointers, repo links, or experiences from anyone who has dealt with this. Thanks!


r/Rag • • 2d ago

Discussion Does increasing chunk size actually improve retrieval quality?

3 Upvotes

Smaller chunks seem better for retrieving specific information, but larger chunks preserve more context.

Has anyone found a good balance between the two, or does it really come down to the type of documents you're working with?


r/Rag • • 2d ago

Tools & Resources Ever built a private LLM for a law firm?

0 Upvotes

The most common architecture question we got on a recent AM100 corporate practice deployment was why the system checks permissions before retrieval instead of filtering afterward.

The firm didn't move off a cloud AI tool out of a blanket preference for on-prem—the workflow forced it:

  • Pre-retrieval ACL enforcement: Most RAG setups retrieve by semantic relevance and filter results afterward. Here, access is checked before anything enters the pipeline. Once a restricted document hits the context window, it has already been accessed—UI-level filtering doesn't undo that.
  • Separate citation verification pass: A secondary check validates whether the source exists, whether it actually supports the claim, and whether the quote matches. It adds latency, which is an intentional trade-off.
  • Firm-controlled infrastructure: Private hosting allowed the firm to define retention policies, audit logging, and internal visibility, with mandatory attorney review baked in as a permanent design assumption rather than temporary training wheels.

Results a quarter after launch:

  • Rework dropped from 83% to 24%
  • Usage shifted from 32% mandatory to 72% voluntary after the mandate was lifted
  • Eliminated roughly $1.7M/year in cloud spend, and the internal team extended the system themselves after handover

(Disclosure: Already Built AI built this system, so weigh the takeaways accordingly.)

For anyone else building RAG pipelines in strict permission environments—how are you handling document-level ACLs without tanking retrieval latency?