Skip to content

Instantly share code, notes, and snippets.

View machuwey's full-sized avatar
the clock is ticking

machuwey machuwey

the clock is ticking
  • Spain
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
@machuwey
machuwey / collect_code.sh
Created September 22, 2024 21:40 — forked from sullyo/collect_code.sh
Clones a github repo and puts all the code into a single text file perfect for LLMs
#!/bin/bash
# Check if a GitHub URL is provided as an argument
if [ -z "$1" ]; then
echo "Usage: $0 <github_url>"
exit 1
fi
# Store the GitHub URL
GIT_URL="$1"
# Appendix
The following sections contain reference material you may find useful in your
Cairo journey.
# Appendix A - Keywords
The following list contains keywords that are reserved for current or future use by the Cairo language.
There are three keyword categories: