Private semantic search for your knowledge

Rust / Open Source / Local-First / 2024

Terraphim AI builds knowledge graphs from your documents and searches them with sub-millisecond automata. Everything runs on your machine. Nothing leaves your control.

About

A 29-crate Rust workspace built for people who take both intelligence and privacy seriously.

Terraphim AI indexes your personal knowledge, team wikis, and public repositories through pluggable data sources called haystacks. Each haystack -- whether a local folder, a Confluence space, a Discourse forum, or an email inbox -- feeds into a role-specific knowledge graph.

The system uses Aho-Corasick automata for pattern matching, BM25 and graph-based relevance functions for ranking, and thesaurus-driven concept expansion for semantic recall. All computation happens locally. Built by Applied Knowledge Systems Ltd.

Capabilities
01
Knowledge Graphs

Rolegraph builds per-role knowledge graphs with concept nodes and semantic edges. Each role maintains its own graph, thesaurus, and relevance configuration. Personalised search without centralised profiling.

02
Haystack Sources

Pluggable indexers for local files (ripgrep), Atlassian Confluence, Jira, Discourse, JMAP email, Quickwit, and MCP protocol. Each source implements a common interface. Add your own in a single Rust file.

03
Automata Engine

Aho-Corasick automata compiled from thesaurus entries. LeftmostLongest matching. Autocomplete in under 5ms. Compiles to WebAssembly for browser deployment at roughly 200KB compressed.

04
Relevance Scoring

Three scoring strategies: TitleScorer for fast text matching, BM25Plus for statistical relevance, and TerraphimGraph for full semantic graph traversal with thesaurus expansion.

05
Secure Execution

Firecracker microVMs provide sub-2-second sandboxed execution. Untrusted code, web requests, and file operations isolated in ephemeral virtual machines. VM pooling minimises startup overhead.

06
MCP Integration

Model Context Protocol server exposes autocomplete, text processing, thesaurus management, and graph connectivity as tools. stdio for local development, SSE for production. OAuth optional.

Terminal
Interactive REPL with semantic search and AI chat
$ cargo run -p terraphim_tui --features repl-full # Terraphim AI v0.9 -- REPL terraphim> /search "automata text matching patterns" Role: Engineer | Scorer: TerraphimGraph Haystacks: local, confluence, discourse [1] Aho-Corasick Automata Design 0.96 ~/docs/architecture/automata.md [2] Pattern Matching in Rolegraph 0.89 confluence://arch/pattern-matching [3] Thesaurus-Driven Expansion 0.84 ~/notes/thesaurus-design.md 3 results | 28ms | 12,847 nodes terraphim> /commands list /search Semantic search across haystacks /chat AI conversation with context /vm Firecracker VM management /help Show all commands
29
Rust Crates
<5ms
Autocomplete
7
Haystack Types
0
Bytes Sent to Cloud