SuperAPIAI Directory

rtfm

github.com · AI coding

RTFM is an open-source retrieval layer for AI coding agents, designed to solve the problems of agents repeatedly searching, missing key information, or hallucinating due to insufficient retrieval capabilities in large projects. It can index various types of content in a project, such as code, documentation, PDFs, legal texts, and research materials, and provides precise context snippets to agents via the MCP protocol through full-text search, semantic search, and hybrid search. RTFM runs entirely locally, requires no API keys or cloud services, and is free and open source (MIT license).

Open website Alternatives
PricingOpen source开源项目(可免费自部署)
PlatformsmacOS · Linux

About this tool

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_expand to 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.
Up/Down to navigate · Enter to open · ESC to closeBrowse all tools