Extracting plain text alone breaks the structural links between table rows and columns, chart axes and legends, and mathematical formulas. This RAG-Anything overview introduces HKUDS’s multimodal RAG pipeline, which handles text, images, tables, and equations together. Built on LightRAG, the system indexes non-text elements directly as first-class retrieval targets.

Preserving Document Structure in a Graph

RAG-Anything parses PDF and Office files into text, image, table, and formula chunks, generating searchable descriptions and entity summaries for each item. It then merges the cross-modal graph and text graph around shared entities. When a query references a table or figure, retrieval combines structural graph relationships with semantic similarity to surface candidates. During answer synthesis, the pipeline passes both the text descriptions and the original visual crops to a vision-language model.

This design pays off when locating the exact cell where a fiscal year meets a line item in a financial statement, or when distinguishing axes and legends in multi-panel figures. Flattening a table into a single string strips out spatial relationships that the graph preserves.

Benchmark Results and Remaining Constraints

In the experiments cited by the post, RAG-Anything reached overall accuracy of 63.4% on DocBench and 42.8% on MMLongBench, compared with LightRAG’s 58.4% and 38.9% under the same setup. Those numbers reflect specific document QA benchmarks rather than a blanket guarantee across every RAG workload.

Performance gains widened on long documents, though clear limitations remain. Retrieval can still over-favor text chunks on questions that require visual evidence, and tables with merged cells or irregular column borders can confuse spatial parsing. Teams considering adoption should benchmark the pipeline against their own document layouts and query types first.

Summary

  • RAG-Anything links text, images, tables, and equations in a shared entity graph for joint retrieval.
  • The pipeline retrieves via generated text descriptions and passes original visual elements to a vision-language model at answer time.
  • Alongside benchmark gains over LightRAG, teams should test against failure modes on complex merged-cell tables.