Suppose a maintenance team has a set of equipment manuals. Someone asks, “The workshop door is locked. Where’s the spare key?” The person on duty wants two things: the cabinet number and a page they can open to verify it. In the small local document Q&A example, we manually divided one page into passages. The program found the passage containing B17 and passed it to the model. With dozens of PDFs, who identifies the cabinet number in the table? After the model answers, who gives the operator the right page?
On July 14 I read 网络极客侠’s “2024年十大开源RAG框架” (“Ten open-source RAG frameworks for 2024”) and opened the first four entries: Haystack, RAGFlow, txtai, and STORM. The article describes composing document processing steps in Haystack, preconfigured workflows in RAGFlow, and semantic search, document processing, and custom workflows together in txtai.1 STORM gathers material about a topic and produces a long report with citations.2 The other three can all handle manual Q&A, but I found myself opening very different things: RAGFlow’s knowledge base settings and PDF parser, Haystack’s Python project configuration, and txtai’s Workflow docs. That afternoon I returned to RAGFlow for tutorials on local deployment and building a knowledge base. Let’s compare the three approaches using one fictional manual.
Keep one page with a known answer
Suppose page 12 of the 2025 Workshop Equipment Manual contains a table. One row says “workshop spare key | B17”, and the next “replacement filter | D42”. If the reader attaches the second cabinet number to the first row, downstream software may confidently and fluently answer D42. To locate the mistake, stop at three points:
- Inspect the source after parsing. The parser turns PDF pages into text or tables. Check that “spare key” and “B17” still belong to the same row in the extracted output.
- Inspect what retrieval found. The program divides a long document into passages that can be retrieved individually, called chunks. An embedding model turns each chunk into a sequence of numbers, a vector, for finding material with a similar meaning. Check whether “the door is locked, where’s the spare key?” retrieves the row and whether its chunk still has the filename and page number.
- Verify the source after generation. Give the retrieved chunks and question to a chat model and ask it to answer from the source. This retrieve-then-generate pattern is retrieval-augmented generation (RAG). During acceptance testing, open the citation and confirm it takes you to page 12 of the 2025 edition.
The survey raises a natural question, “我为何不能直接使用LangChain?” (“Why can’t I just use LangChain?”). Its answer includes “LangChain可以用于实现RAG系统。” (“LangChain can be used to implement a RAG system.”)1 In this manual example the distinction is straightforward. Looking up page 12 and then answering is the RAG approach. Reading the file, doing the lookup, and delivering the source sentence to the model can be implemented with several tools.
With RAGFlow, what can I check before asking the model?
Start with a running RAGFlow instance connected to a model service. Create a knowledge base named “Workshop manuals 2025”, choose an embedding model, and upload the PDFs. The knowledge base holds documents that can be searched together. In this version, changing the embedding model after chunks exist requires clearing the chunks: different models may map the same sentence into different coordinate systems.3
Choose how to read page 12 before deciding how to split it. In the knowledge base settings choose a PDF-compatible chunking method such as General to reveal the PDF parser menu. Scanned pages need text recognition, and cabinet numbers in tables also need row and column reconstruction. The default at the time, DeepDoc, handled text recognition, table structure, and page layout. For a PDF consisting entirely of plain text, Naive skips those steps. Start parsing, then open the file to see the generated chunks. If “spare key” was joined to D42, you can catch it here. Asking the question again would just reread the same bad material.43
Next, test retrieval by itself. Enter “the workshop door is locked, where’s the spare key?” in the knowledge base retrieval test and inspect the returned chunks. At the time, ordinary document retrieval could consider both keyword matches and vector similarity. Exact spelling helps when searching for B17. Rephrase it as “the door won’t open, where do I get another key?” and check whether semantically similar passages rise to the top. The official guide states the objective clearly: “check whether the intended chunks can be retrieved.”5
Only then build the chat assistant. Connect it to the knowledge base, choose a chat model, enable Show quote, and ask the same question. If the retrieval test found the right chunk but the answer says D42, inspect the chunks actually sent to the model and the answer instructions. Add a question the manual doesn’t cover, such as “Who last took the key?”, and check for invented names. Empty response configures a reply when no material is retrieved. If the assistant retrieves related text that doesn’t answer the question, the generated answer still needs checking.6
With Haystack, how do I bring back the page number with a retrieved passage?
Suppose the maintenance team already has a search page and just needs a backend for “look up the manual”. Divide Haystack’s components into two pipelines, one run on upload and another when someone asks a question. A pipeline connects one step’s output to the next step’s input.78
On upload, PyPDFToDocument can read a PDF with a text layer and attach the manual version. Then split by page with DocumentSplitter, starting with one chunk per page on a small sample to verify the source. The splitter records the original document ID (source_id) and starting page (page_number) on each chunk. The chunk from page 12 now contains text and can be traced to its manual. Use an embedding model to compute vectors and write text, vectors, and source metadata to the document store. If the parser scrambled a table, replace the parsing step in this ingestion pipeline.910
At query time, embed the question with the matching model and give the vector to the retriever. Haystack’s in-memory retriever, for example, returns document objects. Print each object’s content and page number first. Then have PromptBuilder combine the question and retrieved text into instructions for the chat model. To let users click back to the PDF, the app can map the document ID to a specific file version and open it at the chunk’s page number. Even if the chat model changes, you can still trace page 12 through the retrieval result.78
At the time I also followed links from the Haystack repository to pyproject.toml and its release notes directory. The former lists Python version requirements and dependencies. The PDF converter’s source prompts you to install pypdf if it’s missing. Taking ownership of this pipeline involves installing the parser dependencies you actually use, alongside choosing components.911
With txtai, how do I attach Q&A to existing file-processing scripts?
Suppose someone already has a script that collects revised manuals nightly. A txtai Workflow can turn “read files, extract chunks, index them” into sequential tasks. Tasks can call existing Python functions. The workflow operates in batches and runs only when the program iterates its output. If all you have are PDFs, txtai’s Textractor provides extraction and segmentation, with a working file conversion backend required for PDFs. If an existing program already reads the page 12 table reliably, let it keep doing that and preserve the file, version, and page number in its output.1213
Given the chunks, txtai’s official Q&A example first creates a content-storing index with Embeddings(content=True), then uses RAG to connect the index, model, and prompt template. For our manual, search the index first and check whether the returned text contains “workshop spare key | B17” before sending it for generation. The example takes a collection of strings. If you index only lines of text that way, the model can read B17 but the app still won’t know which PDF to open. Assign stable chunk IDs on ingestion and store each ID’s mapping to file version and page number. The answer interface can create citations from the IDs actually retrieved.14
Which one should I try first with the same manual?
| What you already have | What to try first | First check using page 12 |
|---|---|---|
| A batch of PDFs whose maintainers need to inspect parsing directly | RAGFlow provides a knowledge base, chunk inspection, retrieval testing, and chat with citations out of the box.36 | Find the key and cabinet number in the chunk view, then return to the source from the answer citation. |
| An existing business app interface that needs custom parsing or a version filter during lookup | Haystack lets the app wire ingestion and Q&A separately and inspect document objects between steps.107 | Print the matched document’s text, version, and page number, then check that the interface opens the same edition. |
| Existing Python batch scripts whose files should also be searchable and available for Q&A | txtai Workflow can reuse processing functions, and its content index and RAG component connect retrieval to generation.1214 | Spot-check a chunk written by the script and confirm its search result points back to the source record. |
One problem often disappears in a demo: the old manual says D42 and the new one B17, and both passages resemble the question. Which one should reach the model? That depends on whether retrieval can restrict the version and how result IDs link to the original. I take up the question in After Faiss finds similar vectors, where does the text live? When is PostgreSQL’s pgvector extension a better fit?
References
Footnotes
-
网络极客侠. (2025, January 10). 2024年十大开源RAG框架. 知乎专栏. 两处引文见“我为何不能直接使用LangChain?”小节标题及首段;项目介绍见后文第 1–4 项。 ↩ ↩2
-
Stanford OVAL. (2025, May). STORM. GitHub. 检索、拟大纲和带引文的写作步骤。 ↩
-
InfiniFlow. (2025, July). Configure knowledge base. RAGFlow, GitHub. 分块方式与嵌入模型;上传、解析和检查片段。 ↩ ↩2 ↩3
-
InfiniFlow. (2025, July). Select PDF parser. RAGFlow, GitHub. Procedure,第 1–2 步及其选项。 ↩
-
InfiniFlow. (2025, July). Run retrieval test. RAGFlow, GitHub. 引文见标题下首段,混合检索说明见同页第 14–19 行。 ↩
-
InfiniFlow. (2025, July). Start AI chat. RAGFlow, GitHub. 创建助手、设置空答复、显示引用和限制送入模型的片段数。 ↩ ↩2
-
deepset. (2025, July). InMemoryEmbeddingRetriever. Haystack, GitHub. 示例中的文档嵌入、问题嵌入与检索结果。 ↩ ↩2 ↩3
-
deepset. (2025, July). PromptBuilder. Haystack, GitHub. 将命中文档与问题传给提示模板。 ↩ ↩2
-
deepset. (2025, July). PyPDFToDocument. Haystack, GitHub. 解析依赖;读取 PDF 时附上元数据。 ↩ ↩2
-
deepset. (2025, July). DocumentSplitter. Haystack, GitHub. 输入、输出以及溯源字段。 ↩ ↩2
-
deepset. (2025, July). pyproject.toml. Haystack, GitHub. Python 版本要求与项目依赖。 ↩
-
NeuML. (2025, July). Workflow. txtai, GitHub. 任务、按批处理和迭代输出的示例。 ↩ ↩2
-
NeuML. (2025, July). Textractor. txtai, GitHub. 提取步骤和转换后端。 ↩
-
NeuML. (2025, July). RAG. txtai, GitHub. 用内容索引、问题和上下文运行问答。 ↩ ↩2