Kremis
A deterministic knowledge-graph MCP server for storing facts, linking them, and answering queries with verifiable, non-fabricated proofs.
Ingest entities/attributes/values (
kremis_ingest) to grow the graph — it starts empty and only holds real signals.Look up an entity by ID (
kremis_lookup) and read all of its attributes (kremis_properties).Traverse the graph from a starting node, with optional
depth(default 2, max 10) andtop_khighest-weight edges (kremis_traverse).Find common connections between multiple nodes (
kremis_intersect).Find the strongest weighted path between two nodes, e.g. dependency chains (
kremis_path).Retract an edge by decrementing its weight — signal invalidation (
kremis_retract).Inspect graph state via stats (node count, edge count, density —
kremis_status) and the canonical BLAKE3 hash of the full graph (kremis_hash).Certify an entity lookup (
kremis_certify), returning a reproducible Verifiable Query Certificate proving a fact — or proving its absence, bound to the graph-state hash.
In short: build a local ground-truth memory layer for an AI agent, and get checkable proof for every answer and every unknown.
Allows validating LLM-generated claims against the knowledge graph using Ollama's local LLM inference, labeling statements as fact or not found.
Alpha — Functional and tested. Breaking changes may still occur before v1.0.
Why Kremis
Problem | How Kremis addresses it |
Hallucination | Every result traces back to a real ingested signal. Missing data returns explicit "not found" — never fabricated |
Opacity | Fully inspectable graph state. No hidden layers, no black box |
Lack of grounding | Zero pre-loaded knowledge. All structure emerges from real signals, not assumptions |
Non-determinism | Same input, same output. No randomness, no floating-point arithmetic in core |
Data loss | ACID transactions via |
Design Philosophy — why these constraints exist.
Related MCP server: Engineering Knowledge Graph MCP Server
Features
Deterministic graph engine — Pure Rust, no async in core, no floating-point. Same input always produces the same output
CLI + HTTP API + MCP bridge — Three interfaces to the same engine: terminal, REST, and AI assistants
BLAKE3 hashing — Cryptographic hash of the full graph state for integrity verification at any point
Canonical export (KREX) — Deterministic binary snapshot for provenance, audit trails, and reproducibility
Proof-carrying knowledge (KVQC) —
POST /certifyreturns a reproducible Verifiable Query Certificate: a portable proof of a fact, or proof of its absenceZero baked-in knowledge — Kremis starts empty. Every node comes from a real signal
ACID persistence — Default
redbbackend with crash-safe transactions
Use Cases
AI agent memory via MCP
Give Claude, Cursor, or any MCP-compatible assistant a verifiable memory layer. Kremis stores facts as graph nodes — the agent queries them, and every answer traces back to a real data point. No embeddings, no probabilistic retrieval.
LLM fact-checking
Ingest your data, let an LLM generate claims, then check each claim against the graph. Every response carries a grounding field — fact, inference, or unknown — and POST /certify turns an unknown into a certificate bound to a BLAKE3 hash of the graph state. No confidence scores, no ambiguity.
Provenance and audit trail
Export the full graph as a deterministic binary snapshot, compute its BLAKE3 hash, and verify integrity at any point. Every node links to the signal that created it. Useful for compliance workflows where you need to prove what data was present and when.
Fabrication Benchmark
A closed registry of 9 fictional services and 5 one-way dependencies. 24 questions of
the form "does A depend on B, directly or transitively?" — 8 have an answer, 16 do
not, and no answer exists for them anywhere. Nothing in the prompt asks any model to
invent: the facts are supplied and UNKNOWN is offered.
qwen3.5:4b, temperature 0, 5 runs:
System | False assertion | Answer accuracy |
Kremis ( | 0.00 % | 100 % |
LLM holding the entire registry | 0.00 % | 100 % |
LLM + naive retrieval | 0.00 % | 75 % |
LLM, no context | 0.00 % | 0 % |
On a world this small a capable model does not fabricate: given every fact it needs,
qwen3.5:4b matches the substrate here, answering all 8 answerable questions and
abstaining on the 16 that have no answer. But capability is not free with the year on the
model card — phi4-mini, a current local 4B from another lab, holds the identical
registry and still asserts marn-ledger -> quoll-auth, the reverse of a stated
dependency, on every run (12.50 %). Which model you run already decides it. Kremis stores
dependencies as one-way edges, so a reverse path is not there to find: it returns
grounding: "unknown" and /certify issues a certificate carrying no evidence, bound to
a BLAKE3 hash of the graph state. The zero is structural, not measured — and the
interesting failure is the long horizon below.
It is also not a like-for-like race, and should not be read as one. The LLM gets
English and has to find the services itself; Kremis gets strongest_path(42, 87) with
the ids already resolved. A graph of one-way edges cannot fabricate an edge — saying so
proves nothing. What is not free is the certificate: an absence bound to a hash, which
someone else can check without trusting the system that issued it.
The bottom row is the control: a model that answers UNKNOWN to everything fabricates
nothing and is useless. Abstention counts only alongside accuracy.
python benchmark/run.py --model qwen3.5:4b --runs 5
python benchmark/run.py --skip-llm # Kremis alone, no Ollama neededSo on the lookup the capable models (qwen3.5:4b, gemma4) score 0 while a weaker
current 4B (phi4-mini) still invents. The base world separates capable from weak — so
the benchmark ships a second one, where the answer no longer fits in a glance and even
the capable models start to fail.
Long horizon
420 services, 330 one-way dependencies, and the answer is a composition of up to 10
steps. The 60 questions with no answer come in two traps, 30 each: a chain with exactly
one link withheld (N-1 of the N links stated, one missing — no chain), and an intact
chain asked backwards (dependencies are one-way, so the reverse has no answer). The
model is handed all 330 dependencies anyway — what is missing is missing in the world,
not in the context.
Temperature 0, 60 questions with no answer, each model holding the entire registry:
Two local models you would actually run, two hosted at the extremes of the frontier:
System | False assertion | Answer accuracy |
Kremis ( | 0.00 % | 100 % |
| 0.00 % | 100 % |
| 3.33 % | 20 % |
| 1.67 % | 6.67 % |
| 61.67 % | 100 % |
Read the second row before the last. As of July 2026 a frontier model matches Kremis on every column of this benchmark — so "LLMs fabricate and Kremis doesn't" is not a claim this project makes in the present tense. What is left is narrower: that zero is one execution, and it arrives with nothing you can check. Kremis's is a property of a graph of one-way edges, and it certifies all 60 absences against a BLAKE3 state hash.
Capability is also not uniform — llama-3.3-70b (Meta, via NVIDIA) invents 37 of the
60 chains while answering every real one, and the two local 4B models fabricate less but
still fabricate (qwen3.5:4b 3.33 %, phi4-mini 1.67 %) while answering almost nothing.
None of them gives you a way to tell which answer you just got.
One caveat is ours, not theirs: 420 services is ~6.6k tokens, so the whole world fits
in the prompt. That is the single regime where an LLM can compete on this task at all.
--scale leaves it — the questions stay identical and only the prompt grows.
And it matters. At --scale 3000 (57k prompt tokens) gemma4 fabricates 1 / 60
where it fabricated 0 / 60 at the default size; the local qwen3.5:4b at
--scale 500 instead answers fewer questions (accuracy 20 % → 13.33 %) without inventing
more. The LLMs move with scale, in different directions; the parity in the table above is
a property of a small world, not of the model. Kremis is 0 / 60 with 100 % accuracy at
every scale measured.
python benchmark/run.py --world horizonCaveats, the counter-experiment, the noise in the curve, and the ground truth are in
benchmark/README.md.
Quick Start
Requires Rust 1.89+ and Cargo.
git clone https://github.com/TyKolt/kremis.git
cd kremis
cargo build --release
cargo test --workspacecargo run -p kremis -- init # initialize database
cargo run -p kremis -- ingest -f examples/sample_signals.json -t json # ingest sample data
cargo run -p kremis -- server # start HTTP serverIn a second terminal:
curl http://localhost:8080/health
curl -X POST http://localhost:8080/query \
-H "Content-Type: application/json" \
-d '{"type":"lookup","entity_id":1}'Note: CLI commands and the HTTP server cannot run simultaneously (
redbholds an exclusive lock). Stop the server before using CLI commands.
Docker
docker build -t kremis .
# MCP server (default) — pipe MCP stdio JSON-RPC; suitable for any MCP client
docker run -i --rm kremis
# HTTP API only — override the entrypoint
docker run -d -p 8080:8080 -v kremis-data:/data \
--entrypoint kremis kremis server -H 0.0.0.0 -D /data/kremis.dbArchitecture
Component | Description |
kremis-core | Deterministic graph engine (pure Rust, no async) |
apps/kremis | HTTP server + CLI (tokio, axum, clap) |
apps/kremis-mcp | MCP server bridge for AI assistants (rmcp, stdio) |
See the architecture docs for internals: data flow, storage backends, algorithms, export formats.
Documentation
Full reference at kremis.mintlify.app:
Topic | Link |
Introduction | |
Installation | |
Quick Start | |
Configuration | |
CLI Reference | |
API Reference | |
MCP Server | |
Philosophy | |
The Name |
Testing
cargo test --workspace
cargo clippy --all-targets --all-features -- -D warnings
cargo fmt --all -- --checkBenchmarks
Auto-generated on CI runners — 2026-11-09.
Operation | Linux | Windows | macOS |
Node insertion (100K) | 20.69 ms ±0.36 | 18.88 ms ±0.95 | 18.52 ms ±3.56 |
Signal ingestion (10K batch) | 13.99 ms ±0.85 | 10.16 ms ±1.52 | 7.35 ms ±0.62 |
Graph traversal (depth 50, 1K nodes) | 2.6 µs ±0.1 | 3.2 µs ±0.2 | 3.3 µs ±0.6 |
Strongest path (1K nodes) | 7.2 µs ±0.1 | 8.2 µs ±0.3 | 7.8 µs ±2.3 |
Canonical export (1K nodes) | 67.5 µs ±0.6 | 74.7 µs ±1.4 | 70.1 µs ±12.4 |
Canonical import (10K nodes) | 3.14 ms ±0.05 | 3.32 ms ±0.04 | 2.77 ms ±0.12 |
Redb signal ingestion (1K, one commit) | 4.50 ms ±0.10 | 10.77 ms ±3.01 | 4.54 ms ±1.37 |
Redb node insertion (1K, one commit each) | 299.04 ms ±6.34 | 10.0 s ±0.3 | 770.66 ms ±136.80 |
Redb traversal (depth 10, 1K nodes) | 6.2 µs ±0.1 | 8.9 µs ±0.7 | 5.2 µs ±0.5 |
The ± is criterion's deviation within a single run. Spread between runs on hosted CI is wider still, because the runners themselves vary: figures here have moved by tens of percent with no change to the benched code. Read them as orders of magnitude, not as a regression signal.
License
The brand assets in docs/logo/ (logo, icon, favicon) are proprietary and not covered by the Apache 2.0 license. See docs/logo/LICENSE.
Contributing
See CONTRIBUTING.md for guidelines. The architecture is still evolving — open an issue before submitting a PR.
Acknowledgments
This project was developed with AI assistance.
Available Tools
10 toolskremis_certifyA
Produce a Verifiable Query Certificate for an entity lookup: a reproducible proof of a fact, or a proof of absence when the entity is not in the graph
Inputs: entity_id (required).
kremis_hashA
Get the canonical BLAKE3 hash of the current graph state
Inputs: no named parameters.
kremis_ingestC
Add an entity or relation to the Kremis knowledge graph
Inputs: value (required), attribute (required), entity_id (required).
kremis_intersectB
Find common connections between multiple nodes
Inputs: nodes (required).
kremis_lookupB
Look up an entity in the graph by its entity ID
Inputs: entity_id (required).
kremis_pathC
Find the strongest weighted path between two nodes
Inputs: end (required), start (required).
kremis_propertiesB
Get all properties (attributes and values) of a specific node
Inputs: node_id (required).
kremis_retractB
Decrement the weight of an edge between two entities (edge invalidation / signal retraction)
Inputs: to_entity (required), from_entity (required).
kremis_statusA
Get current graph statistics (node count, edge count, density)
Inputs: no named parameters.
kremis_traverseC
Traverse the graph from a node to discover connected entities
Inputs: node_id (required), depth, top_k.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 10 tools
Each tool has a clearly distinct purpose: ingest adds data, lookup retrieves entities, properties gets attributes, traverse explores connections, intersect finds common neighbors, path finds weighted paths, retract adjusts edge weights, status shows statistics, hash computes graph hash, and certify produces proofs. No overlapping functionality.
All tools follow the consistent pattern 'kremis_<verb>' with clear action verbs (certify, hash, ingest, intersect, lookup, path, properties, retract, status, traverse), making the naming predictable and easy to understand.
With 10 tools, the server is well-scoped for a knowledge graph management and verification system. Each tool contributes meaningfully without being excessive or insufficient.
The tool set covers essential CRUD-like operations (ingest, lookup, retract), graph traversal and analysis (traverse, intersect, path), statistics, hashing, and certification. Missing explicit update or full delete tools, but these may be intentional given the focus on verifiable proofs and immutable facts.
Maintenance
Related MCP Connectors
Persistent memory, hybrid search and a goal graph for AI agents, over stdio or remote HTTP.
Agent-native MCP server over the public saagarpatel.dev corpus. Read-only, stateless.
Persistent memory, knowledge graph, task management and more for AI agents via MCP.
MCP server for OnceAsk, the AI-native current-address layer for people and agents.
Related MCP Servers
- AlicenseBqualityCmaintenanceA lightweight MCP server that enables querying a project's corpus (docs, decisions, issues, skills) with cited answers and typed refusals via stdio JSON-RPC 2.0.9MIT
- AlicenseNot gradedqualityDmaintenanceProvides a stdio MCP bridge for coding agents to query and record engineering knowledge locally, preserving debugging history, failed attempts, and verified solutions.3 npmMIT
- AlicenseNot gradedqualityDmaintenanceMCP server that grounds AI answers in a local, maintained knowledge base and optionally fills gaps from the web, fully local with SQLite.AGPL 3.0
- AlicenseBqualityCmaintenanceLocal-first knowledge system for reasoning agents, exposing facts, evidence, documents, retrieval, and audit history through a thin stdio MCP server.14MIT