RTFM (Retrieve The Forgotten Memory) is an open-source retrieval layer designed for AI coding agents. The core problem it solves is: as projects grow larger and content types become more varied, agents relying only on grep and file reading struggle to find the right context, leading to repeated searches, context exhaustion, and even fabricating content that does not exist. RTFM indexes various materials in a project so that agents can quickly and precisely obtain the information they need.
Key Capabilities
- Multi-format indexing: Built-in 24 parsers, covering Markdown, Python (AST), LaTeX, YAML, JSON, TOML, Shell, PDF, XML, HTML, SQLite, Jupyter, CSV/TSV, XLSX, EPUB, MOBI/AZW, FB2, DJVU, DOCX, ODT, RTF, MIDI, audio tags (MP3/FLAC/OGG/M4A/WAV/AIFF, etc.), and plain text.
- Multiple search modes: Supports FTS5 full-text search (zero configuration, works out of the box), semantic search (optional embedding model, no GPU required), and hybrid mode (combining both and ranking by relevance).
- Metadata-first and progressive disclosure: Search results first return file paths and scores (about 300 tokens), and the agent then uses
rtfm_expandto expand specific snippets on demand, avoiding context flooding. - Knowledge graph: Resolves wikilinks and Python import relationships into graph edges, supporting hub detection and centrality ranking.
- Cross-session memory: Indexes Claude Code's own memory files, supports cross-project retrieval and unlimited version history, and can automatically snapshot via the SessionEnd hook.
- Obsidian vault mode: Detects the
.obsidian/directory, parses[[wikilinks]], and generates Obsidian-native navigation files (index, Mermaid diagram, hubs, orphan notes, Dataview frontmatter). - NotebookLM integration: Can index NotebookLM Q&A results locally, breaking through daily query limits, and supports two integration paths: Markdown and JSON sidecar.
- 15 MCP tools: Including search, context, expand, graph, history, sync, tags, and more.
- CLI and Python API: Scriptable for pipelines.
Usage
Recommended approach: Claude Code plugin
In Claude Code (CLI or Desktop Code tab), install via the roomi-fields/claude-plugins marketplace. The plugin automatically initializes each project on first use: creates .rtfm/library.db(a single SQLite file), injects search instructions into CLAUDE.md , pre-authorizes MCP tool permissions, and indexes the project on the first prompt, then incrementally re-indexes on each subsequent prompt. No pip installation is required; it is a pure Python implementation, requires Python 3.10+ to be in PATH, and supports Linux, macOS, Windows, and WSL.
Optional extensions (semantic search, PDF parsing) are installed on demand into an isolated virtual environment within the plugin data directory, without polluting the system Python. The full PDF installation uses PyTorch's CPU-only indexing, about 1.5 GB. Claude Code must be restarted after installation.
Manual installation (Cursor, Codex, Claude Desktop chat, and other MCP clients)
Install via pip install rtfm-ai , then point the MCP client to the rtfm-serve entry point. Optional extensions are installed via pip install rtfm-ai[embeddings,pdf] Installation.
Applicable Scenarios
- LegalTech: code + tax law + regulatory norms, with built-in Legifrance XML and BOFiP parsers.
- Research: code + LaTeX papers + datasets, with built-in LaTeX and PDF parsers.
- FinTech: code + financial regulations + XBRL reports (you can write your own XBRL parser).
- HealthTech: code + medical records (HL7/FHIR) + clinical guidelines.
- Independent developers of large projects: avoid agents repeatedly searching thousands of files in every session.
- Obsidian / personal knowledge management users: enable AI to truly search your note library.
- Any regulated industry: applicable whenever a project mixes code with domain documents.
Limitations and Considerations
- In small repositories (fewer than 1000 files), grep is sufficient; RTFM instead adds overhead.
- The official benchmark is based on a single model (Sonnet 4) and a single agent (Claude Code), and is not statistically bulletproof.
- FeatureBench measures code modification rather than information retrieval, making it not an ideal benchmark for retrieval tools; more suitable benchmarks (RepoQA, SWE-QA, LocAgent) are on the roadmap.
- RTFM is highly effective in bottleneck scenarios such as "finding the right paragraph in a 2000-file corpus," but it will not make unsolvable tasks solvable.
- Semantic search and PDF parsing are optional extensions requiring additional installation.
- The project is under the MIT license; it can be freely used, forked, extended, and distributed.