The open retrieval layer for AI agents — index code, docs, data. Search via MCP.
SaferSkills independently audited RTFM (MCP Server) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
<!-- mcp-name: io.github.roomi-fields/rtfm --> <div align="center">
*Retrieve The Forgotten Memory*
Index everything in your project — code, docs, PDFs, legal texts, research, data — and your agent finds the right context instantly. No hallucinations. No cloud. No API costs.
`Free · Local · Open Source · MIT`
<br>
RTFM vs vanilla Claude Code — same task, same model, who pays the bill?
<br>
</div>
<!-- ─────────── TIER 1 — Pain & promise ─────────── -->
Your AI agent is flying blind.
It greps through thousands of files, misses the doc that answers the question, invents modules that don't exist, forgets what you decided last session. The bigger the project, the worse it gets. You've added a smarter model. It didn't help. Because the bottleneck isn't intelligence — it's retrieval.
Code indexers (Augment, Sourcegraph, Cursor) only see code. But your project isn't just code. It's specs, PRs, architecture decisions, research papers, PDFs, regulations, vault notes — the context your agent needs to stop guessing.
I was writing a French tax article (~50 pages of regulatory text, cross-references between code articles, case law, administrative doctrine). Claude Code kept grep-ing the same directories in loops, running out of context, and producing confidently wrong citations. I'd added more memory, better prompts, a smarter model. None of it worked, because the agent wasn't reasoning badly — it just couldn't find the right paragraph in a 2,000-file legal corpus. So I stopped trying to make the model smarter and built the layer it was missing. That's RTFM.
RTFM indexes everything. One command, one SQLite file, one retrieval layer your agent queries before grepping.
pip install rtfm-ai && cd your-project && rtfm init30 seconds. Claude Code now searches your indexed knowledge base — code and docs and PDFs and whatever else you drop in — with full-text, semantic, or hybrid search. The agent sees 300 tokens of metadata first, then expands only what's relevant. Progressive disclosure instead of context dumps.
Free. Runs locally. No API keys. No cloud. Your data stays yours.
$ rtfm search "authentication flow" --limit 3
[1] src/auth/handlers.py > authenticate_user (p.2) score 9.12
src/auth/handlers.py:147 42 lines
[2] docs/architecture/auth.md > SSO flow (p.1) score 7.84
docs/architecture/auth.md:1 23 lines
[3] docs/ADR/0007-oauth.md > Decision (p.1) score 6.90
docs/ADR/0007-oauth.md:12 18 linesThree results, ~300 tokens. The agent decides what to read next with rtfm_expand(source, target_section) — not a context dump, a conversation.
In Claude Code (CLI or Desktop Code tab) :
/plugin marketplace add roomi-fields/claude-plugins
/plugin install rtfm@roomi-fieldsRTFM is distributed via the roomi-fields/claude-plugins marketplace, which also ships notebooklm-mcp for citation-backed Q&A. To grab both at once:
/plugin install notebooklm@roomi-fieldsThat's it. The plugin auto-initializes each project on first use:
.rtfm/library.db (one SQLite file)CLAUDE.mdNo `pip install` required. Pure Python, runs on Linux / macOS / Windows / WSL with Python 3.10+ already on PATH. The plugin bundles its own MCP server (no mcp SDK dep) and resolves python3 / python / py automatically.
Then say to Claude: "Find the authentication flow" — it uses rtfm_search instead of grepping.
The core plugin is dependency-free. Heavier optional extras (embedding model, PDF parsers) install on demand into an isolated venv inside the plugin's data directory — no pollution of your system Python, no PEP 668 conflicts:
/rtfm:install-embeddings # FastEmbed ONNX (~85 MB), semantic + hybrid search
/rtfm:install-pdf # pdftext only (~50 MB), fast text extraction
/rtfm:install-pdf-full # + marker-pdf + CPU-only torch (~1.5 GB), complex layoutsThe pdf-full install uses PyTorch's CPU-only index (no CUDA, no GPU needed) to stay around 1.5 GB instead of 5 GB.
Restart Claude Code after install for the extras to be picked up.
For clients without Claude Code's plugin system :
pip install rtfm-ai
cd /path/to/your-project
rtfm initThen point your MCP client at rtfm-serve (the entry exposed by the pip package). Optional extras via pip install rtfm-ai[embeddings,pdf].
<!-- ─────────── TIER 2 — Positioning & buzz ─────────── -->
| RTFM | Augment CE | Sourcegraph | Code-Index-MCP | MemPalace | |
|---|---|---|---|---|---|
| Code indexing | ✅ (AST-aware) | ✅ | ✅ | ✅ | Shallow (char-chunk) |
| Docs, specs, markdown | ✅ (header-parsed) | Partial | ❌ | Limited | Verbatim chunks |
| Legal / regulatory | ✅ (XML, BOFiP) | ❌ | ❌ | ❌ | ❌ |
| Research (LaTeX, PDF) | ✅ | ❌ | ❌ | ❌ | ❌ |
| Custom parsers | ✅ (~50 lines) | ❌ | ❌ | ❌ | ❌ |
| Knowledge graph | ✅ (file/code links) | ❌ | Partial | ❌ | Entity graph (people) |
| File version history | ✅ (unlimited) | ❌ | ❌ | ❌ | ❌ (purge-and-replace) |
| MCP native | ✅ | ✅ | ✅ | ✅ | ✅ |
| Runs locally | ✅ | Cloud | Enterprise | ✅ | ✅ |
| Open source | MIT | ❌ | Partial | ✅ | MIT |
| Price | Free | $20-200/mo | $$$/mo | Free | Free |
RTFM is the only open-source option that indexes multi-domain content with structural parsing, a code-level knowledge graph, and unlimited per-file history. That's the niche.
Different from MemPalace specifically: MemPalace is an entity-level memory for conversations (who/project/decision triples in SQLite, plus verbatim chunks in ChromaDB). RTFM is a retrieval layer for artefacts — parsed by format, linked at the file level, versioned over time. The two are stackable, not competing.
For a deeper breakdown of the design choices behind any RAG (chunking, retrieval, augmentation, integration, freshness, storage), see [RAG Fundamentals — the 6 axes →](docs/rag-fundamentals.md)
Between sessions, most agents forget. RTFM indexes Claude Code's own memory files across every project on your machine, with full version history.
rtfm memory # Manual snapshot
rtfm memory --install-hook # Auto-snapshot on every SessionEnd~/.rtfm/memory.db sees every ~/.claude/projects/*/memory/ directory on your machine. Ask rtfm_search("OAuth auth decisions") and get hits from all 18 of your projects.rtfm_history <slug> returns the full evolution.RTFM is the retrieval layer for the Karpathy LLM Wiki pattern. Karpathy himself wrote: "at small scale the index file is enough, but as the wiki grows you want proper search." This is proper search.
cd /path/to/your-obsidian-vault
rtfm vault.obsidian/, proposes a folder → corpus mapping[[wikilinks]] following Obsidian rules → stored as graph edges_rtfm/ with Obsidian-native navigation (index, graph with Mermaid, hubs, orphans, Dataview frontmatter)_rtfm/
├── index.md # Hub: corpus list, top connected documents
├── graph.md # Hub documents, orphans, broken links, Mermaid
├── recent.md # Recently modified files
└── corpus/ # Per-corpus indexesThe LLM still writes your wiki. RTFM handles the retrieval that index.md can't scale to.
[Full Obsidian guide →](docs/obsidian-vault-guide.md)
RTFM pairs naturally with notebooklm-mcp. NotebookLM caps you at 50 queries/day per notebook; RTFM removes that ceiling by indexing answers locally — ask once, retrieve forever, offline, in milliseconds.
notebooklm-mcp's /batch-to-vault endpoint writes citation-backed Q&A as {slug}.md (markdown with frontmatter) plus {slug}.json (structured nblm-answer-v1 sidecar). Both are guaranteed to coexist. Two integration paths, both ship today:
rtfm sync. The default markdown parser slices each answer into question / answer / per-citation chunks automatically. No mapping, no schema, no code.nblm-answer.yaml mapping into .rtfm/mappings/. Each .json answer file produces typed chunks with notebook_id, source_name, citation_marker queryable via SQL, plus cites edge candidates between answers and sources.Use Path A unless you specifically need to filter or graph by structured citation fields.
[Full NotebookLM recipe →](docs/notebooklm-integration.md)
I ran two kinds of benchmarks. The honest picture is nuanced — retrieval helps most on tasks that are actually solvable and where the agent is spending time looking for things.
Writing a ~50-page regulated article from a corpus of legal code, case law, and administrative doctrine. Same agent (Claude Code + Sonnet 4), same prompt, eight configurations tested.
| Configuration | Duration | Cost | Tokens |
|---|---|---|---|
| Baseline (no RTFM) | 8m 16s | $22.61 | 8.21 M |
| With RTFM (FTS default) | 6m 58s | $11.14 | 3.22 M |
Δ : −51 % cost, −61 % tokens, −16 % duration — with better factual accuracy. This is the use case RTFM was built for: navigating a large multi-domain corpus where grep misses the right paragraph.
11 tasks, 3 repos of varying size, 4 conditions (A = standard prompt with file paths; B = discovery, no paths; C = RTFM FTS; D = RTFM hybrid), 3 runs each.
| Repo | Size | Where RTFM helps |
|---|---|---|
| metaflow | 620 files | Everyone resolves — RTFM adds no measurable gain |
| astropy | 1,119 files | All conditions 25–30 % F2P pass; none fully resolve |
| mlflow | 8,255 files | All conditions 0–5 % F2P pass; none fully resolve |
On a single smaller-scope run (test_stub_generator on metaflow), RTFM cut agent time by −37 % vs the no-paths baseline. On the larger repos, the tasks themselves were too hard for Sonnet 4 to resolve inside a 20-minute timeout regardless of retrieval.
grep is enough and RTFM adds overhead.RTFM measurably wins when the bottleneck is "find the right paragraph in a 2,000-file corpus". It doesn't magically make unsolvable tasks solvable. The model still has to do the work — RTFM just makes sure it has the right context to do it with.
RTFM works anywhere your project isn't just code:
<!-- ─────────── TIER 3 — Technical depth ─────────── -->
/plugin install rtfm@roomi-fields/rtfm, auto-init per projectmcp SDK / pydantic / native binariespip install rtfm-ai for Cursor, Codex, Claude Desktop chat, any other MCP clientNeed to index a format nobody supports? Write a parser in ~50 lines.
from rtfm.parsers.base import BaseParser, ParserRegistry
from rtfm.core.models import Chunk
import json
from uuid import uuid4
@ParserRegistry.register
class FHIRParser(BaseParser):
"""Parse HL7 FHIR medical records."""
extensions = ['.fhir.json']
name = "fhir"
def parse(self, path, metadata=None):
data = json.loads(path.read_text())
for entry in data.get('entry', []):
resource = entry.get('resource', {})
yield Chunk(
id=resource.get('id', str(uuid4())),
content=json.dumps(resource, indent=2),
book_title=f"FHIR {resource.get('resourceType', 'Unknown')}",
book_slug=resource.get('id', 'unknown'),
page_start=1,
page_end=1,
)Drop it in your project, restart Claude Code, your medical AI agent now understands FHIR records.
For JSON-based formats specifically, RTFM offers a second extensibility path that doesn't need any Python:
| Level | What you do | What you get |
|---|---|---|
| 1. Generic | Nothing. Just index the file. | Each top-level key becomes a chunk. Full-text search works on values. |
| 2. Mapped | Drop a YAML mapping in .rtfm/mappings/ (~30 lines). | Typed chunks with declared metadata, custom titles, foreach extraction over arrays, edge candidates. The producing project (NotebookLM, Linear, Notion, OpenAPI…) ships the mapping; RTFM stays generic. |
See JSON schema mappings for the full reference, and RTFM × NotebookLM for a concrete recipe.
| Parser | Extensions | Strategy |
|---|---|---|
| Markdown | .md | Split by headers, YAML frontmatter extraction |
| Python | .py | AST-based: each class/function = 1 chunk |
| LaTeX | .tex | Split by \section, \chapter, etc. |
| YAML | .yaml, .yml | Split by top-level keys |
| JSON | .json | Split by top-level keys or array elements |
| TOML | .toml | Top-level tables; emits depends_on edges (PEP 621, Cargo, Poetry) |
| Shell | .sh, .bash, .zsh | Function-aware chunking |
.pdf | Page-based (pip install rtfm-ai[pdf]) | |
| Legifrance XML | .xml | French legal codes (LEGI format) |
| BOFiP HTML | .html | French tax doctrine |
| SQLite | .sqlite, .sqlite3, .db | Schema + sample rows per table; FK edges (read-only) |
| Jupyter | .ipynb | Group cells by markdown heading; outputs dropped |
| CSV / TSV | .csv, .tsv | Header + sample rows + lightweight type inference |
| XLSX | .xlsx | Per-sheet schema + sample (pip install rtfm-ai[xlsx]) |
| Plain text | .js, .ts, .rs, .go, ... | Line-boundary chunks (~500 chars) |
| Tool | What it does |
|---|---|
rtfm_search | Search the index (FTS, semantic, or hybrid) |
rtfm_context | Get relevant context for a subject (metadata-only) |
rtfm_expand | Show all chunks of a source with full content |
rtfm_discover | Fast project structure scan (~1s, no indexing needed) |
rtfm_books | List indexed documents |
rtfm_stats | Library statistics |
rtfm_sync | Sync a directory (incremental) |
rtfm_ingest | Ingest a single file |
rtfm_tags | List all tags |
rtfm_tag_chunks | Add tags to specific chunks |
rtfm_remove | Remove a file from the index |
rtfm_graph | Show dependency graph for a source (imports, links) |
rtfm_history | File version history and memory snapshots |
# Search
rtfm search "authentication flow"
rtfm search "article 39" --corpus cgi --limit 5
# Sync
rtfm sync # All registered sources
rtfm sync /path/to/docs --corpus docs # Specific directory
rtfm sync . --force # Force re-index
# Source management
rtfm add /path/to/docs --corpus docs --extensions md,pdf
rtfm sources
# Obsidian vault
rtfm vault # Initialize for cwd vault
rtfm vault /path/to/vault # Specific vault
rtfm vault --regenerate # Regenerate _rtfm/ files
# Cross-project Claude memory
rtfm memory # Manual snapshot
rtfm memory --install-hook # Auto-snapshot on SessionEnd
# Status & info
rtfm status
rtfm books
rtfm tags
rtfm history path/to/file.md # Memory version history
# Semantic search
rtfm embed # Generate embeddings (one-time)
rtfm semantic-search "tax deductions" --hybrid
# MCP server
rtfm servefrom rtfm import Library
lib = Library("my_library.db")
# Index
stats = lib.ingest("documents/article.md", corpus="docs")
result = lib.sync(".", corpus="my-project") # SyncResult(+3 ~1 -0 =42)
# Search
results = lib.search("depreciation", limit=10, corpus="cgi")
results = lib.hybrid_search("amortissement fiscal", limit=10)
# Export for LLM
prompt_context = results.to_prompt(max_chars=8000)
lib.close()RTFM isn't a task manager. It's not an agent framework. It's the knowledge layer your agent needs underneath whatever you're already using.
┌─────────────────────────────────┐
│ GSD / Taskmaster / Claude Flow │ ← Orchestration
├─────────────────────────────────┤
│ RTFM │ ← Knowledge (you are here)
├─────────────────────────────────┤
│ Claude Code │ ← Execution
└─────────────────────────────────┘Without RTFM, your orchestrator drives an agent that hallucinates. With RTFM, the agent knows what it's building on.
Adding a parser is the easiest way to contribute — and the most impactful. See CONTRIBUTING.md.
Found a bug? Have an idea? Open an issue.
MIT — use it, fork it, extend it, ship it.
Romain Peyrichou — @roomi-fields
<div align="center">
Code indexers see your code. RTFM sees everything.
⭐ Star on GitHub if RTFM saves your agent from hallucinating.
Curious how it works under the hood? See the Architecture — SQLite + FTS5, the parser registry, and the priority-queue worker (ingest → embed → OCR).
</div>
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.