fff-search
Fast, typo-resistant file search SDK for Rust with fuzzy matching, frecency ranking, and content grep.
Repository Health
Technical Analysis
fff-search (FFF, the Fabulous & Fast File Finder) is the Rust core of a file search toolkit designed for both humans and AI agents. It provides typo-resistant path and content search, frecency-ranked file access, a background filesystem watcher, and a lightweight in-memory content index, all engineered to stay fast when the same working tree is searched repeatedly.
Unlike spawning a CLI such as ripgrep or fzf on every query, fff-search keeps an index in memory inside your long-running process, delivering sub-10ms queries even on very large repositories. The crate powers file search across editors, Neovim, and AI harnesses, and is exposed to C, Node/Bun, Python, and MCP clients through additional bindings in the same workspace.
What You Get
- Typo-resistant fuzzy path search powered by SIMD matching
- Frecency-based ranking so frequently and recently used files surface first
- A background filesystem watcher that keeps the index current in real time
- An in-memory content index for fast repeated grep-style searches
- A core that also backs C FFI, Node/Bun, Python, and MCP bindings in the same repo
Common Use Cases
- Embedding fast file search in an editor, IDE, or terminal UI
- Giving AI agents and MCP clients low-latency file and content lookup
- Ranking file-open suggestions by frecency in a long-running application
- Running repeated content searches over a large repository without re-scanning each time
Under The Hood
Architecture - The fff-search crate (in crates/fff-core) is organized around an in-memory index (index/, types.rs, stable_vec.rs) fed by a parallel filesystem scanner (scan.rs, walk/) and kept current by a watcher/. Matching and ranking live in score.rs, file_picker.rs, and simd_path.rs/simd_string_utils/, with content search in grep/ and query interpretation delegated to the sibling fff-query-parser crate. Git awareness (git.rs, git_status_worker.rs) and persistence via LMDB (dbs/) round out the core, which sits alongside fff-grep, fff-c, fff-python, fff-nvim, and fff-mcp in a Cargo workspace.
Tech Stack - Written in Rust (edition 2024) with a performance-focused dependency set: rayon for parallelism, neo_frizbee for fuzzy matching, memchr/aho-corasick/memmap2 for fast scanning, heed (LMDB) for frecency storage, notify for filesystem watching, git2 for VCS status, and optional mimalloc and zlob backends. The library builds as rlib, staticlib, and cdylib to support every downstream binding.
Code Quality - The workspace enforces shared lint configuration, a pinned rust-toolchain.toml, typo checking (_typos.toml), and extensive benchmarks (parse_bench, bigram_bench, memmem_bench, grep_bench, and more). A dedicated tests/ tree plus per-crate benches indicate a project built around measured performance and correctness.
API Design - fff-search exposes a library-first API centered on building an index and issuing repeated queries, deliberately trading the simplicity of a one-shot CLI for the speed of an embedded, stateful searcher. Rich documentation on docs.rs and multiple language bindings show an API meant to be consumed from many host environments.