Observe Your Knowledge

Terraphim AI is a local-first semantic search engine built in Rust. It constructs knowledge graphs from your documents, matches patterns with compiled automata, and ranks results through graph traversal. Every computation happens on your machine.

5
Haystacks
12,847
Graph Nodes
28ms
Avg Latency
0 B
Cloud Egress
About

A search instrument calibrated to your knowledge

Terraphim indexes documents from multiple sources -- local files, Confluence wikis, Jira tickets, Discourse forums, email inboxes -- and builds a knowledge graph unique to each role you configure. The graph captures concepts and their relationships, extracted through Aho-Corasick automata.

Search queries are expanded through a thesaurus, scored by your chosen relevance function (TitleScorer, BM25Plus, or TerraphimGraph), and returned with sub-millisecond latency. The entire 29-crate Rust workspace compiles to native binaries, WebAssembly, and Tauri desktop applications. Built by Applied Knowledge Systems Ltd.

Core Systems
I

Rolegraph Engine

Each role maintains its own knowledge graph. Concept nodes are extracted from indexed documents. Semantic edges encode relationships. The thesaurus provides synonym expansion for improved recall. Graph path connectivity verification ensures coherent search results.

II

Automata Compiler

Aho-Corasick automata built from thesaurus entries perform simultaneous multi-pattern matching in a single text pass. LeftmostLongest matching strategy. The engine compiles to WebAssembly at approximately 200KB compressed, enabling browser-based autocomplete with identical matching behaviour.

III

Haystack Orchestration

Seven pluggable data source types: ripgrep for local files, Atlassian for Confluence and Jira, Discourse for forums, JMAP for email, Quickwit for log analysis, MCP for AI tool integration, and Atomic Server for linked data. Each implements a common indexing interface.

Console
$ terraphim-agent # Terraphim AI v0.9 -- Observatory Console # Local-first semantic search terraphim> /search "Firecracker VM isolation patterns" Scorer: TerraphimGraph Haystacks: local, confluence, discourse, jmap, quickwit [1] Firecracker MicroVM Architecture 0.95 ~/docs/security/firecracker-design.md [2] VM Pooling and Startup Optimisation 0.91 confluence://infra/vm-pooling [3] Sandboxed Execution Patterns 0.86 discourse://security/sandboxing-thread [4] Sub-2s Boot Time Analysis 0.79 ~/benchmarks/vm-boot-times.md 4 results | 31ms | 12,847 nodes traversed All data processed locally terraphim> /vm list Active VMs: 0 | Pool: 3 warm | Boot: ~1.8s terraphim> _
Architecture

Persistence

Multi-backend storage with transparent cache warm-up. Memory, DashMap, SQLite, and S3 backends ordered by speed. Zstd compression for objects over 1MB.

Async Runtime

Tokio async throughout. Bounded channels for backpressure. Structured concurrency with scoped tasks. Non-blocking operations. Zero runtime garbage collection.

Security

Firecracker microVMs for untrusted execution. Knowledge graph validation before operations. 1Password CLI integration. Zero telemetry. Full source auditability.

MCP Server

Model Context Protocol exposes autocomplete, text matching, thesaurus management, and graph connectivity. stdio and SSE transports. Optional OAuth bearer tokens.

AI Integration

Ollama for local inference. OpenRouter for cloud models. Provider-agnostic LlmClient trait. Document summarisation, intelligent descriptions, context-aware chat.

Deployment

Native binaries. WebAssembly modules. Tauri desktop. Svelte frontend with Bulma CSS. Multi-platform Docker builds for linux/amd64, arm64, and arm/v7.