Skip to main content

Introduction

In daily use, we often encounter scenarios like this: buying a new device but not knowing how to set up certain functions, and flipping through the manual is both time-consuming and inefficient. At this time, if there is an intelligent assistant that can directly answer questions, it will greatly improve the experience. For example, a user purchased a Nikon Z7 camera and wants to know “in which scenarios the electronic vibration reduction function is unavailable”. Asking LLM directly yields the following answer:
It can be seen that although the model can generate semantically smooth answers, due to the lack of real document support, it often produces “plausible but incorrect” results. To solve this problem, UltraRAG implemented a multi-modal retrieval-augmented Pipeline based on VisRAG. It no longer relies on cumbersome text parsing, but directly inputs “screenshots of relevant documents” into the vision language model, thereby achieving real document Q&A based on visual semantics.

Build Personal Knowledge Base

Take “Nikon User Manual” as an example. You can click here to download the PDF file. We use UltraRAG’s Corpus Server to convert this PDF directly into an image corpus:
examples/build_image_corpus.yaml
Execute the following command:
Modify parameters as follows:
examples/parameters/build_image_corpus_parameter.yaml
Run Pipeline:
After execution, the image corpus file will be automatically generated:
corpora/image.jsonl
Next, use the Retriever Server to perform vector encoding and indexing on the image corpus:
examples/corpus_index.yaml
Execute the following command:
Modify parameters:
examples/parameters/corpus_index_parameter.yaml
Run index construction:

VisRAG

Prepare user query file:
data/test.jsonl
Define VisRAG Pipeline:
examples/visrag.yaml
Execute the following command:
Modify parameters:
examples/parameters/visrag_parameter.yaml
Run this Pipeline:
Execute the following command to start Case Study Viewer:
The system will automatically display the screenshots of the retrieved manual pages: The answer generated by the model will be based on the real image content. Example follows:
Through visual semantic enhancement, the system can answer user questions more accurately, especially suitable for multi-modal scenarios such as manuals, textbooks, reports, etc.