AI LUKE.
EN
Build apps · Guide & explainer

Local RAG: inspect the path from document chunks to a grounded answer

Keep indexing and chatting distinct so a retrieval failure can be separated from a model response problem.

Luke Byrne
Luke ByrneAI Luke · Luke Byrne | AI & Tech
Video published 16 Feb 2025· 4 min read

Video in English

Watch on YouTube ↗

Use the retained code and identify the two programs

The February 2025 lesson presents a local document-chat system with DeepSeek-R1 and ChromaDB, without API keys for the demonstrated route. The code resource is https://github.com/lukejbyrne/n8n-rag/tree/main. The source identifies app.py and chat.py at 0:39, then requirements at 4:46 and virtual environments at 11:47.

Treat the two files as separate parts to inspect: preparation of searchable documents and the later question-answer path. A program running on your machine and a complete privacy assessment are different things; inspect the actual dependencies and connections before introducing sensitive material.

  1. Open the retained repository and identify app.py and chat.py.
  2. Follow the recorded requirements and environment setup.
  3. Choose a small document with a known answer for the first test.

Inspect document processing before asking the model

Database interactions with ChromaDB and SQLite appear at 15:10, sentence-transformer setup at 20:07 and document processing at 25:54. The source names files, chunking and metadata, making the indexed material part of the evidence to inspect.

Check whether the text has been extracted correctly and divided into useful pieces. A missing or poorly separated passage can prevent a good answer even when the model itself runs successfully. Keep file identity and metadata attached so a retrieved passage can be traced back to its document.

  1. Inspect the text prepared for indexing.
  2. Check chunk boundaries and the metadata identifying their source.
  3. Follow the main-app demonstration at 34:24 and confirm that the intended document is represented.

Trace the chat question through retrieval

Automation and running begin at 38:20, chat.py at 42:33, models and parameters at 48:36, and the agent demonstration at 52:18. Use a question whose supporting passage you know, then inspect what the system retrieved and how the answer uses it.

A fluent answer without the relevant passage is not proof of successful retrieval. Compare the response with the actual document and distinguish missing indexing, weak retrieval and unsupported generation. The troubleshooting section at 57:17 is part of the lesson rather than evidence that every hardware configuration will perform identically.

  1. Ask the known question and inspect its retrieved context.
  2. Compare the final answer with the source passage.
  3. Repeat the same question after a specific correction to see whether the relevant stage improved.

Keep the alternative routes separate

The source links an API-based route at https://youtu.be/H6PDzAZOZxo and an n8n route at https://youtu.be/C_vrM_pnH3A. Those are alternatives, not hidden dependencies to assume in the local example. Preserve the selected model and data path when comparing them.

The takeaway

Check the indexed text, retrieved passage and final answer separately; local execution alone does not establish factual grounding or complete privacy.

About this article and its sources

Written companion prepared 2 November 2026 from this exact published video description and its chapter sequence. The full recording was not independently watched or transcribed for this article, and the products and reported results were not retested. Checklists are editorial adaptations of the documented workflow. Model availability, interfaces, prices and offers may have changed since publication; use the retained original resources for current requirements.

Original YouTube source ↗