A Plain-English Walkthrough of RAG, From In-Memory Demos to Milvus
Hallucination is the single biggest blocker for putting LLMs in front of real users. RAG is the cheapest, most controllable fix available today, and the tooling has settled enough that a working pipeline is a weekend project, not a research undertaking.
RAG splits into two distinct phases: an offline indexing step that chunks documents, embeds them, and stores the vectors, and an online query step that retrieves the closest chunks, stuffs them into a prompt, and hands the whole thing to the LLM. LangChain's document loaders, text splitters, and vector-store abstractions make the pipeline uniform whether the source is a PDF, a Word file, or a web page.
A basic example runs the entire flow against hard-coded story fragments using MemoryVectorStore, then an advanced example pulls a real .docx file through DocxLoader and RecursiveCharacterTextSplitter. The code is nearly identical; only the loader changes. The final section replaces the in-memory store with a local Milvus instance, showing how to search with cosine similarity and feed results back into a chat model.
Milvus coexists with a traditional database like MySQL rather than replacing it. The walkthrough covers Docker setup, the Attu GUI, and Node.js snippets for embedding, searching, and answering questions from persisted vectors.
The post treats RAG as a solved engineering pattern with a standard component menu, which signals that the Chinese developer community has moved past experimentation and into integration work.
Using a children's story as the demo corpus is a deliberate choice that makes retrieval failures immediately obvious to a human reader, sidestepping the need for formal evaluation metrics in a tutorial.
The jump from MemoryVectorStore to Milvus is presented as a straightforward configuration change, but in practice it introduces persistence, indexing strategy, and connection management that the tutorial's code snippets gloss over.