r/Rag • • 11h ago

Showcase Finance and Sales walked into Monday's review $290K apart on Q3 revenue from the exact same database, and there was no SQL bug

0 Upvotes

Monday 9:05 AM quarterly review. slide 4 of the Sales deck showed $4.18M for Q3 revenue. Two minutes later, Finance pulled up $3.89M. Both slides had the exact same footer citing our production orders table. then scenically, the room went quiet, everyone turned toward the data team....

so it took about 90 minutes of tracing to see what happened, nobody had done anything sloppy on purpose. Sales had exported a CSV from an older self-service workbook and dropped it into an AI chat to build a quick summary chart for the slide. That older workbook still summed gross amount and never filtered out status IN ('refunded', 'chargeback') or internal QA test accounts. finance was reading from the updated net-revenue definition

fixing the two slides took ten minutes, the harder realization was that telling non-technical teams to stop exporting CSVs and wait three days for an analyst ticket never sticks. Ops, Sales, and Finance want fast self-service answers, and increasingly they want to ask questions in natural language and tweak chart layouts themselves without waiting in a BI backlog; finally, what indeed has cut down the Monday number arguments was separating metric logic from chart layout into two distinct layers

1st
moving canonical business definitions (net revenue, active customer, refund exclusions, fiscal calendar rules) out of individual workbooks and ad-hoc prompts into one version-controlled semantic and context layer. That way, whether someone opens a chart, connects a BI tool, or asks an AI assistant in plain English, the query has to resolve through the governed metric definition instead of guessing column math on raw tables.

2nd
giving non-technical stakeholders guided self-service apps rather than raw table access. Most business users have no interest in writing SQL joins or wrestling with rigid BI grids. tools like Hex, Sigma, Metabase's guided questions, or Cube Apps (where you start from governed workbook reports, let an agent generate a custom page, and non-tech users click directly on a title or chart to ask for a bar-vs-line tweak with one-step undo) work much better because the underlying math stays locked even when someone changes how the page looks.

by the way (a catch!) no tool fixes organizational disagreement on its own. someone still has to get Sales and Finance in one room, agree on the exact written definition of net revenue, and commit it to Git. Without that step, AI-powered BI tools just help teams generate conflicting slides faster.

now would like to ask teams giving non-technical stakeholders genuine self-service (especially with natural-language dashboards), how are you preventing metric drift without turning analysts into a bottleneck for every chart tweak?


r/Rag • • 4h ago

Tools & Resources I made a tool that splits long PDFs into sections so RAG answers can cite the section and pages

3 Upvotes

Say your team loads a 583-page software manual into a RAG assistant, and someone asks "how do I make a pivot table?"

Many pipelines cut the PDF into fixed-size pieces. Here's a real 1,500-character piece from the free LibreOffice Calc Guide 26.2, shortened:

ice Base. For more information, see Chapter 12, Linking Data.
Using shortcuts
If you frequently use pivot tables in Calc, navigating through the built-in menu paths might feel inconvenient.
...
Creating a pivot table
...
After making a selection, create the pivot table in one of three ways:
• Use Insert > Pivot Table on the Menu bar.
330 | Calc Guide 26.2
• Use Data > Pivot Table > Insert or Edit on the Menu bar.
• Click the Insert or Edit Pivot Table icon on the Standard toolbar.
...
See Chapter 15, Calc as a D

It starts and ends in the middle of a word, mixes two topics and has a page footer in the middle of the steps. The last step is in the next piece, and nothing says which chapter or section any of it belongs to.

This is just a personal project and an experiment: I wanted to directly retrieve RAG chunks as sections for LLM reasoning as well as citations.

Section Anything is an open-source Python library that splits a PDF into its real sections. Every piece it returns keeps its chapter, section and pages. Here's the same part of the guide:

['Chapter 10 Using Pivot Tables', 'Introduction', 'Creating a pivot table'] 330 331
If you want Calc to automatically determine the full extent of the raw data list, then select a single cell within this list. ...
After making a selection, create the pivot table in one of three ways: • Use Insert > Pivot Table on the Menu bar.
• Use Data > Pivot Table > Insert or Edit on the Menu bar. • Click the Insert or Edit Pivot Table icon on the Standard toolbar. ...
Click OK on the Select Source dialog to display the Pivot Table Layout dialog, which is described in the next section.

The piece is exactly that section, with all the steps and no footer. The answer can cite "Chapter 10, Creating a pivot table, pages 330 to 331".

Install it with pip install "section-anything[anthropic]" and set ANTHROPIC_API_KEY. The code that printed it:

from section_anything import section

tree = section("CG262-CalcGuide.pdf", mode="quick", model="claude-haiku-5-5", max_pages=600)
for chunk in tree.chunks(max_chars=1500):
    print(chunk.heading_path, chunk.page_start, chunk.page_end)
    print(chunk.text)

There are also integrations for LangChain, LlamaIndex, Haystack and LightRAG.

That was quick mode, where a model double-checks which lines are real headings, using your own API key. On this manual it made 7 calls to Claude Haiku 5.5, cost $0.08 and took about 7 minutes. In my tests on 905 research papers it matched the real outlines best of the three modes. Paid runs are estimated before they start and capped at $0.50 per document unless you raise the cap.

Free mode needs no model. It reads the PDF's bookmarks, table of contents, fonts and numbering, runs on your own machine in seconds and costs nothing. But this manual's bookmarks stop one level higher, so free mode filed these steps under "Introduction".

It only reads the text layer, so scanned PDFs need OCR first. Tables and figures aren't structured, so their text just sits inside the section.

In an October test of an earlier version on Qasper, 707 questions about 200 short research papers, section chunks found the passage with the answer more often than fixed-size chunks, mostly because they were smaller, but the answers didn't get any better. Write-up: https://github.com/Omniwot/section-anything/blob/main/docs/rag-qasper.md

I'd most like to hear about PDFs where it gets the sections wrong (a link plus what you expected helps a lot), and which RAG framework I should support next.

Repo, with a short demo of quick mode at the top: https://github.com/Omniwot/section-anything

Try it: https://huggingface.co/spaces/Omniwot/section-anything


r/Rag • • 6h ago

Showcase What I learned building a GraphRAG that reads documents as rendered pages (open source, benchmarks vs RAG-Anything, LightRAG, GraphRAG)

15 Upvotes

Disclosure: I built this, and it's open source (Apache-2.0).

At work, documents pile up from every department, each in its own formats and its own way of laying things out: specs in Word, test records in Excel, review decks in PowerPoint, scanned PDFs, and the mail that carries them. Most RAG pipelines flatten these into text, so the tables, pictures and charts are gone before retrieval starts. If you work with a lot of different people, you probably know the feeling. Here is what worked for me.

A 30-second demo (a spreadsheet, a slide and a contract, each answer's source highlighted on the page) is at the top of the README: https://github.com/ToBeSuperior/Graph-Me-Maybe

Read the page, not the text. Every format is rendered to page images first. A VLM reads the outline off each page: which heading holds which paragraph, which label belongs to which figure, which rows a table really has. Styles and font sizes are not trusted, because half the documents at work don't use them.

Make the outline the graph. Instead of extracting entities and relations from every chunk, the graph is each document's own hierarchy (sections and the units under them), plus links between documents that cite or resemble each other (a memo naming a spec, copies and versions of one file). That keeps indexing cheap and the graph small.

Retrieve graph chunks cut along the outline. Search is hybrid (vector + full-text, fused with weighted RRF) over chunks that follow the outline, and the answer gets each chunk's pictures where they stand in the text, so it can read a value off a chart. Every claim cites the page, slide, cell or paragraph, highlighted on the original.

Benchmarks. Same documents, same answering model (Claude Haiku 5.5) for every system, graded by Claude Opus 5.5, on MMLongBench-Doc and DocBench:

systemMMLongBench-DocDocBench
Graph-Me-Maybe72.0%83.1%
RAG-Anything67.5%78.1%
LightRAG58.8%79.1%
Text RAG49.8%62.5%
HippoRAG 246.1%64.7%
Microsoft GraphRAG44.4%55.0%

It is also the fastest graph-based system to index on both sets (1.2-1.9x faster than GraphRAG's fast mode, 17-21x faster than RAG-Anything) and keeps the smallest graph (1.2-1.8x less than the next, 5-7x less than RAG-Anything). Setup, cost, time and per-type scores: https://graphme.io/benchmarks/

It's a desktop app (macOS, Windows, Linux). The graph (its own Neo4j, no Docker), the search (a local embedding model) and your files stay on your machine; pages are read and answers written with an OpenAI, Anthropic or Gemini API key, or a Claude, ChatGPT or Gemini subscription you already have (advanced option). It also works as an MCP server for Claude Code and Cursor.

Repo: https://github.com/ToBeSuperior/Graph-Me-Maybe · live demo, no install: https://graphme.io/demo/en/

Happy to go into the outline pass, how tables split across pages are joined, or how pictures are placed in the answer's context.


r/Rag • • 10h ago

Discussion Building desktop application with rag

2 Upvotes

I want to build an ai app for windows that can learn from files or the documents and store or memorize that answers that got given before

If anyone can help me with links articles or files to learn how to make it work I'll appreciate it


r/Rag • • 10h ago

Discussion Product RAG where half the data lives in PDFs (spec sheets, catalogs, price lists). How are you handling it?

1 Upvotes

For some domains (industrial parts, electronics, B2B catalogs) the real product data is in PDF spec sheets and price lists, not clean HTML. Those get added to a RAG index and the answers on numeric specs come out unreliable.

For anyone who's dealt with this:

- plain text extraction, layout-aware parsing, or a vision model on the PDF?

- how do you keep tables and units intact from a PDF?

- do you re-extract when a new revision of the spec sheet drops, and how do you notice?