Skip to content

Instantly share code, notes, and snippets.

View IamAegon's full-sized avatar

Aegon IamAegon

View GitHub Profile

MindRAG: A Prompt Template That Reads Between the Lines

Most RAG systems retrieve what matches the words. This one retrieves what produces understanding.

The idea is simple: before retrieving anything, the system figures out what you actually need. Then it retrieves what the answer will fail without — not just what matches your keywords. Then it writes an answer that pre-answers your follow-up questions so you don't have to ask them.

Three steps of "mind-reading" before a single word of answer is written:

  1. Intent Reader — figures out what you actually need vs. what you literally typed
  2. Smart Retriever — finds what the answer will break without, ignores what looks relevant but isn't