RAG is more than just Retrieval-Augmented Generation
A RAG system is the data source, the parser, the chunker, the embedding, the vector database, and the language model. Poor parsing leads to poor chunks, poor chunks lead to poor retrieval, and poor retrieval leads to a wrong answer.
DocParser is the parser. It turns a document into text that keeps tables, charts, and mixed layouts.
Parser
A good parse writes each fact so a question can land on it. The person, the column name, and the number stay on one line, and the table is named.
A normal markdown table keeps the headers in one row and the values in another. A retrieved row can be numbers with no label.
Chunker
A good chunk is one subject: a heading with the text under it, or a table that is still a table. The cut follows the parser boundary, from a heading or from a table start marker to its end marker.
An LLM reads each chunk and writes keywords: names, abbreviations, and the terms a person would type. Vector search is weak on those exact strings. Full-text search on the keywords is merged with the vector score.
The chunk also keeps a reference to the file and the page, so the answer can point back to the source.
Query
For the best retrieval, use an LLM to extract keywords from the question, then search those words in the keywords field. Merge that full-text score with the vector score.
The result
The same parsed page can answer a simple question from one chunk, a table question that picks a row and a column, or a cross-chunk question that combines more than one section.
How does RAG work?
A document is parsed, split into chunks, embedded, and stored in a vector database. A question is embedded, the nearest chunks come back, and a language model writes the answer from those chunks. DocParser is the parser step.
Why is a fact per row better for RAG than a markdown table?
The person, the column name, and the number stay on one line, so a retrieved piece can answer by itself. A markdown table keeps the headers in a different row, so the retrieved row can be numbers with no label.
Why store keywords on each RAG chunk?
An LLM extracts names, abbreviations, and terms from the chunk. Vector search is weak on those exact strings. Full-text search on the keywords is merged with the vector score so the right chunk ranks higher.
How should a RAG query use keywords?
Use an LLM to extract keywords from the question, search those words in the keywords field, and merge that score with the vector score.
If you want to build your own RAG system, contact me for the details.