Terraphim

A privacy-first AI assistant with semantic search, powered by knowledge graphs, running entirely on your device.

What it does

Privacy as architecture

Every search, every index, every inference runs locally. There is no cloud, no telemetry, no data leaving your machine. Privacy is not a setting -- it is the design.

Knowledge graphs for semantic depth

Build structured relationships between concepts using custom thesauri and Aho-Corasick automata. Queries expand through synonyms and graph paths, surfacing results that keyword search misses.

One search, many sources

Index local folders, Confluence wikis, Discourse forums, email via JMAP, and task trackers. Results blend into a single ranked list using BM25, title scoring, or graph-based relevance.

Role-based context switching

Each role carries its own knowledge graph, data sources, and relevance preferences. Switch between engineering, research, and operations views without reconfiguring.

Optional AI augmentation

Connect local Ollama models or OpenRouter for summarisation, chat, and intelligent document descriptions. The AI layer is additive -- the system works without it.

Rust for reliability

Built with async Rust on Tokio for memory safety and performance. Desktop via Tauri, terminal via REPL, HTTP API for custom integrations. WASM support for browser-based autocomplete.

The best search tool is the one that understands your domain as well as you do -- and never shares what it learns.
Terraphim design philosophy

How it works

Connect your sources

Point Terraphim at your local folders, wikis, email, or task trackers. Each source becomes a haystack -- a searchable index with its own configuration.

Build your knowledge graph

Define thesauri mapping synonyms and related concepts. Terraphim compiles them into Aho-Corasick automata for sub-millisecond matching across your entire corpus.

Search with intent

Queries expand through your knowledge graph, finding documents connected by concept paths. Choose BM25 for precision, TitleScorer for speed, or TerraphimGraph for semantic depth.

Refine and share

Export configurations, share role definitions with your team, or extend the system with custom haystack integrations. The architecture is modular by design.

Installation

Requires Rust toolchain. Clone, build, and run.

git clone https://github.com/terraphim/terraphim-ai cd terraphim-ai cargo build --release cargo run --release -- --config terraphim_engineer_config.json