A RAG System Reads 22 RAG Papers to Explain RAG, for Under a Dollar
I Fed 22 RAG Papers to a RAG System and Had the AI Explain RAG to Me
@[toc]
1. The 47th Day of 22 Papers Gathering Dust on My Hard Drive
Recently, I wanted to understand RAG (Retrieval-Augmented Generation), so I went on a downloading spree on arXiv. Twenty-two classic paper PDFs sat neatly in a folder—and then started gathering dust.
Why didn't I read them? A triple whammy:
- All in English, reading one paper drains two hours of mental energy. The original RAG paper, Self-RAG, CRAG, GraphRAG… finishing 22 papers would consume a month's worth of after-work hours;
- Read and forget, recall depends on luck. I finished Self-RAG yesterday, saw CRAG today, and thought, "Which one is which again?" Flipping back through the PDF meant scanning from the beginning again;
- Writing a survey requires cross-paper comparison, Ctrl+F jumping back and forth across 22 PDFs—"Which papers proposed a new retriever?" Manually pulling a comparison table made me want to smash my keyboard.
So what about asking a web-based large model directly? It hasn't read the details of this specific batch of papers in your hands, so its answers are generic and might even mix things up—after all, its training data isn't the complete text of these 22 papers on your hard drive.
What I needed was an assistant that reads all 22 PDFs, lets me ask questions in Chinese casually, and annotates answers with the source paper and page number.
Coincidentally, the technology to build this assistant is exactly what this batch of papers is about—RAG.
Pulling myself up by my bootstraps: I built a RAG system, had it read the RAG papers, and tell me what RAG is.
2. Solution: AnythingLLM + Lanyun MaaS, Zero-Code RAG
AnythingLLM: An Out-of-the-Box RAG Desktop Application
AnythingLLM is an open-source RAG desktop application. Its core selling points are threefold:
- Double-click to install, no Docker needed—Compared to RAGFlow/FastGPT, which often require half an hour of container orchestration tinkering, AnythingLLM works right after installation;
- Workspace = Knowledge Base—Drag PDFs in, automatic chunking and vectorization, Q&A with citations, all through a graphical interface;
- Data stored locally—Vector database and chat history are all local, no need to worry about document leaks.
Official website link:
https://anythingllm.com/
However, AnythingLLM is just the "skeleton"; the real determinant of answer quality is the backend large model. It supports connecting to various APIs. To read 22 English papers and answer fluently in Chinese, you need a cloud model with a long enough context window, strong reasoning, and a cheap enough price—which brings us to the second protagonist of this article.
Lanyun MaaS
For the paper-reading Q&A scenario, the inference service has three requirements:
- Standard Interface—AnythingLLM supports OpenAI-compatible interfaces; just fill in an address to connect;
- Pay-per-use—Reading papers is a low-frequency scenario, costing a few cents a day, more cost-effective than a monthly subscription;
- Chinese ↔ English Cross-lingual Capability—The corpus is English papers, the questions are in Chinese, and the answers need to be in Chinese, testing the model's multilingual understanding.
Lanyun MaaS hits all three:
- OpenAI-compatible interface:
https://maas-api.lanyun.net/v1, select Generic OpenAI in AnythingLLM and fill it in directly; - Pay-per-use + Multi-model marketplace: Mainstream models like DeepSeek, GLM, Kimi, Qwen are neatly lined up, billed per token, register and top up to use;
- Chinese questions → English literature → Chinese answers, perfectly leveraging the flagship model's cross-lingual ability.
According to AI Ping's benchmark data, the time-to-first-token and throughput performance of mainstream models on Lanyun MaaS are quite impressive:
RAG Principles Explained in One Diagram
Before starting the hands-on work, let's clarify RAG's workflow in 300 words—the diagram below encapsulates the core idea of those 22 papers:
Simply put: RAG = First vectorize and store documents, then when a question is asked, retrieve relevant passages and feed them to the large model to generate an answer.
Why do this? Because no matter how smart a large model is, its training data doesn't contain the complete text of the 22 PDFs on your hard drive. The core value of RAG is letting the large model "read" your private documents—retrieving relevant passages and placing them into the prompt. The model then answers based on these passages, resulting in naturally precise answers with cited sources.
Alright, principles explained, let's get started.
3. Preparation: Lanyun API + AnythingLLM Installation
Step 1: Get API Key from Lanyun Console
Go to the Lanyun console to register: Lanyun Official Website👇
https://console.lanyun.net/#/register?promoterCode=41c01378ce
After logging in, find API Management / Key Management in the left navigation bar, click "Create API Key", generate it, and copy it for safekeeping.
Step 2: Lock in deepseek-v4-flash in the Model Marketplace
Click 【Model Marketplace】 on the left, search for deepseek-v4-flash.
Why choose this one? The paper Q&A scenario consumes three things: English comprehension ability (RAG papers are mostly in English), Chinese generation ability (I want Chinese answers), long context (a single retrieval might recall thousands of tokens of passages). DeepSeek V4 Flash officially boasts a 1024k context window, with input priced at 1 RMB/million tokens and output at 2 RMB/million tokens—running this entire Demo from start to finish won't cost a single yuan.
Note the invocation name:
deepseek-v4-flash
At this point, the Lanyun-side trifecta is assembled:
| Configuration Item | Value |
|---|---|
| API Key | sk-xxxxxxxx (your own key) |
| Endpoint Address | https://maas-api.lanyun.net/v1 (OpenAI-compatible endpoint) |
| Model Name | deepseek-v4-flash |
Step 3: Download and Install AnythingLLM
Go to the official website to download the desktop version:
https://anythingllm.com/download
Installation packages are available for Windows / Mac / Linux. Download and double-click to install; the entire process is graphical, no tinkering required.
4. Core Configuration: Connecting Lanyun to AnythingLLM
Step 1: Configure LLM (Chat Large Model)
Open AnythingLLM, go to the left sidebar Settings (Preferences) → LLM Settings.
Fill in the following configuration:
- Provider: Generic OpenAI
- Base URL:
https://maas-api.lanyun.net/v1 - API Key: Your Lanyun API Key
- Chat Model:
deepseek-v4-flash - Model Context Window:
131072(131k, taking the context window supported by deepseek-v4-flash) - Max Tokens:
4096(Maximum tokens per single reply)
Save it.
Step 2: Configure Embedder (Vector Model)
The core link in RAG is vector retrieval: your Chinese question must first be vectorized, then used to search for similar English passages in the vector database. This requires a cross-lingual Embedding model—one that can map Chinese questions and English documents into the same vector space; otherwise, retrieval simply won't hit the target.
AnythingLLM comes with an out-of-the-box local Embedder, no need to find an extra service or pay an extra cent.
Go to Settings → Embedding Settings, select AnythingLLM Embedder, and choose the model multilingual-e5-small:
Why choose this one? Because it:
- Supports 100+ languages, capable of vectorizing both Chinese and English;
- Model size is 487MB, download once, use offline thereafter;
- Runs locally for free, not consuming Lanyun's Token quota.
This way, the entire RAG chain becomes: Embedding runs locally, Chat runs on Lanyun—each doing what it does best: vectorization runs locally at zero cost, inference is handed to the cloud large model, and Lanyun's Tokens are all spent where they matter most.
5. Feeding and Building the Database: 22 Papers Enter the Warehouse
Step 1: Create a New Workspace
Click the top left + New Workspace, name it "RAG Paper Research Institute" (or whatever you like).
Step 2: Drag in the 22 PDFs
Click the Upload button on the right side of the workspace, select your downloaded 22 RAG paper PDFs (select all and drag them in).
⚠️ A small pitfall here: My first attempt to drag all 22 in at once resulted in a large number of Failed:
Solution: Retry. I didn't change any settings, just dragged the failed files in again, and they all succeeded the second time. Suspected network jitter or temporary hiccup. If you encounter this, don't panic, just do it again.
Step 3: Save and Embed (Vectorization)
After the files are successfully uploaded, click the Save and Embed button on the right side, and AnythingLLM will start vectorizing:
22 papers will take a while to run (depending on your computer's performance). Wait until the progress bar finishes.
6. Live Test: The Paper Assistant on Duty
Now, the 22 papers are lying in the vector database. Next, I designed 6 progressive questions, covering the core capabilities of a RAG system: precise localization, concept understanding, cross-document comparison, full-database summarization, knowledge transfer, and reverse verification.
Each question is backed by a screenshot, let's see if this "RAG explaining RAG" assistant is up to the task.
Question 1: Single-Document Fact Query
Question: "In the original RAG paper, what is the difference between the RAG-Sequence and RAG-Token models?"
This question tests precise localization ability—can it accurately find the original RAG paper (Lewis 2020) among 22 papers and extract the core differences between the two models.
You can see that AnythingLLM used the @agent mode to call the rag-memory and document-summarizer tools, first retrieving documents, then generating an answer.
Result: The answer was precise, with the source cited on the right—01-RAG-Lewis2020.pdf, and it provided the core difference between the two models: RAG-Sequence retrieves only once for the entire sequence, while RAG-Token retrieves once for each token.
✅ Single-document fact query passed.
Question 2: Concept Tracing
Question: "What is the 'Lost in the Middle' phenomenon? What experiment did the paper use to prove it?"
This question tests comprehension + retelling ability—not only finding the paper but also understanding its core argument and expressing it clearly in Chinese.
Result: The answer was complete, not only explaining the "Lost in the Middle" phenomenon (information in the middle of long contexts is easily ignored by the model) but also retelling the experimental design where the paper used a multi-document QA task to prove this phenomenon. The source cited on the right was 12-Lost-in-the-Middle.pdf.
✅ Concept tracing passed.
Question 3: Cross-Document Comparison
Question: "Both Self-RAG and CRAG aim to solve the problem of unreliable retrieval quality. How do their approaches differ?"
This question tests cross-PDF synthesis ability—RAG's strongest suit. It needs to simultaneously retrieve both the Self-RAG and CRAG papers, extract their respective core ideas, and then compare them.
Result: The answer provided a detailed comparison table, summarizing the core differences effectively:
- Self-RAG: The model introspects on whether to retrieve (trained to judge when retrieval is needed)
- CRAG: Corrects retrieval results (performs confidence assessment and rewriting on retrieved documents)
The source citations on the right listed two papers: 07-Self-RAG.pdf and 08-CRAG-Corrective-RAG.pdf.
✅ Cross-document comparison passed, this is the core value of RAG.
Question 4: Full-Database Summarization
Question: "Among this batch of papers, which ones proposed new retrievers or Embedding methods? What are they called respectively?"
This question tests breadth of recall ability—it needs to scan 22 papers and summarize all those mentioning retriever/Embedding methods.
Result: The answer listed 6 papers and their proposed methods:
- DPR (Dense Passage Retriever)
- Contriever (Unsupervised Dense Retriever)
- BGE-M3 (Multilingual Embedding)
- Dense Passage Retrieval
- RETRO
- HyDE (Hypothetical Document Embeddings)
✅ Full-database summarization passed.
Question 5: Implementation Consultation
Question: "If I were to build a financial document Q&A system for an enterprise, what should I pay attention to based on these papers?"
This question tests knowledge transfer ability—not just regurgitating paper content, but combining paper knowledge to give practical implementation advice.
Result: The answer gave 6 pieces of advice, covering retriever selection, long context handling, retrieval quality assessment, multi-document fusion, performance optimization, and evaluation frameworks, each corresponding to ideas from specific papers (like Self-RAG's introspection mechanism, Lost in the Middle's long context pitfalls).
✅ Knowledge transfer passed, demonstrating value beyond being a mere repeater.
Question 6: Reverse Verification (No Hallucination)
Question: "Which paper discusses diffusion model image generation?"
This question is a reverse verification—there are absolutely no papers discussing diffusion models in the corpus. Will it honestly say "not found in documents", or will it fabricate an answer?
Result: The answer clearly replied "No relevant content found in the documents", and explained the corpus scope (RAG-related papers).
✅ Reverse verification passed, no hallucination.
7. Cost Review: 22 Papers + Dozens of Q&A Rounds, How Much Did It Cost?
Finally, let's do the math. I took a screenshot from the usage page in the Lanyun console:
Cost Breakdown:
- Embedding (Vectorization): Used AnythingLLM's built-in
multilingual-e5-smalllocal model, completely free; - Chat (Conversation): Used
deepseek-v4-flash, input at 1 RMB/M tokens, output at 2 RMB/M tokens.
From the screenshot, building the database with 22 papers + dozens of Q&A rounds cost a total of less than 1 RMB.
Compared to a monthly subscription, the advantage of pay-per-use is clear at a glance—reading papers for Q&A is a low-frequency scenario; paying only for what you use is far more cost-effective than a monthly plan.
8. Summary: You've Already Learned RAG Using RAG
Let's review the entire chain:
22 Paper PDFs → Chunking & Vectorization → LanceDB Vector Database → Chinese Question → Retrieve Relevant Passages → Lanyun deepseek-v4-flash → Chinese Answer (with citations)
You now have both the tool (a working RAG system) and understand the principle (this is exactly how RAG works).
More importantly, the applicable scenarios for this set of tools extend far beyond a paper assistant:
- Technical Documentation Q&A: Feed in your company's internal API docs and architecture design documents, and new hires will never have to ask "How do I call this interface?" again;
- Policy Document Retrieval: Vectorize hundreds of pages of policy documents and legal provisions, allowing lawyers/compliance colleagues to instantly search for clauses;
- Contract/Policy Assistant: Feed in historical contracts and insurance clauses, allowing sales staff to query "Which clause applies to this type of client?" at any time.
Change the corpus, and it's a new scenario.
If this article was helpful to you, feel free to like and bookmark it. See you next time.
Appendix: List of 22 RAG Papers
If you need these materials, you can leave a comment or send a private message.
| Paper | One-Liner Description |
|---|---|
| RAG (Lewis 2020) | The seminal work, origin of the term RAG |
| DPR | Foundation of dense passage retrieval |
| REALM | Pioneer of retrieval-augmented pre-training |
| FiD | Multi-document fusion decoding |
| RETRO | DeepMind's trillion-token retrieval |
| Atlas | Few-shot retrieval augmentation |
| Self-RAG | Model introspection on whether to retrieve |
| CRAG | Corrective retrieval augmentation |
| RAG Survey (Gao 2023) | The most cited panoramic survey |
| HyDE | Hypothetical document embeddings for improved retrieval |
| REPLUG | Black-box LLM with external retrieval |
| Lost in the Middle | Information loss in the middle of long contexts |
| RAPTOR | Tree-structured hierarchical retrieval |
| GraphRAG | Microsoft's knowledge graph RAG |
| Dense X | Proposition-level retrieval granularity |
| Rewrite-Retrieve-Read | Query rewriting |
| FLARE | Active retrieval during generation |
| RAGAS | RAG evaluation framework |
| Contriever | Unsupervised dense retriever |
| BGE-M3 | Multilingual Embedding |
| Adaptive-RAG | Adaptive retrieval based on question difficulty |
| kNN-LM | Nearest neighbor language model (prehistoric origin) |