kremis

TyKolt/kremis
13 starsApache-2.0Community

Install to Claude Code

This server doesn't publish a one-line install command. Follow the setup in the source repository.

Summary

kremis MCP server](https://glama.ai/mcp/servers/TyKolt/kremis/badges/score.svg)](https://glama.ai/mcp/servers/TyKolt/kremis) ๐Ÿฆ€ ๐Ÿ  ๐ŸŽ ๐ŸชŸ ๐Ÿง - Deterministic knowledge graph MCP server.

README.md

<p align="center"> <img src="docs/logo/icon.svg" alt="Kremis" width="120" height="120"> </p>

<h1 align="center">Kremis</h1>

<p align="center"> <strong>A deterministic knowledge graph MCP server. Local, single binary, no LLM in the loop.</strong> </p>

<p align="center"> A minimal, graph-based cognitive substrate in Rust.<br> Records, associates, retrieves โ€” but never invents. </p>

<p align="center"> <a href="https://github.com/TyKolt/kremis/actions/workflows/ci.yml"><img src="https://github.com/TyKolt/kremis/actions/workflows/ci.yml/badge.svg" alt="CI"></a> <a href="https://crates.io/crates/kremis-core"><img src="https://img.shields.io/crates/v/kremis-core.svg" alt="crates.io"></a> <a href="https://kremis.mintlify.app"><img src="https://img.shields.io/badge/docs-mintlify-0D9373.svg" alt="Docs"></a> <a href="https://dev.to/tykolt/i-spent-months-trying-to-stop-llm-hallucinations-prompt-engineering-wasnt-enough-so-i-wrote-a-4872"><img src="https://img.shields.io/badge/story-dev.to-0A0A0A.svg" alt="Background & Story"></a> <a href="LICENSE"><img src="https://img.shields.io/badge/license-Apache%202.0-blue.svg" alt="License"></a> <a href="https://www.rust-lang.org/"><img src="https://img.shields.io/badge/rust-1.89%2B-orange.svg" alt="Rust"></a> <img src="https://img.shields.io/badge/status-alpha-orange" alt="Status"> </p>

Alpha โ€” Functional and tested. Breaking changes may still occur before v1.0.

<p align="center"> <img src="assets/demo.svg" alt="Kremis Honesty Demo" width="800"> </p>

---

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 redb embedded database. Crash-safe by design |

Design Philosophy โ€” why these constraints exist.

---

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 /certify returns a reproducible Verifiable Query Certificate: a portable proof of a fact, or proof of its absence
  • Zero baked-in knowledge โ€” Kremis starts empty. Every node comes from a real signal
  • ACID persistence โ€” Default redb backend 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 validate each claim against the graph. Kremis labels every statement as [FACT] or [NOT IN GRAPH] โ€” 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.

---

Honesty Demo

Ingest a few facts, let an LLM generate claims, and Kremis validates each one:

[FACT]          Alice is an engineer.              โ† Kremis: "engineer"
[FACT]          Alice works on the Kremis project. โ† Kremis: "Kremis"
[FACT]          Alice knows Bob.                   โ† Kremis: "Bob"
[NOT IN GRAPH]  Alice holds a PhD from MIT.        โ† Kremis: None
[NOT IN GRAPH]  Alice previously worked at DeepMind. โ† Kremis: None
[NOT IN GRAPH]  Alice manages a team of 8.         โ† Kremis: None

Confirmed by graph: 3/6
Not in graph:       3/6

Three facts grounded. Three fabricated. No ambiguity.

python examples/demo_honesty.py            # mock LLM (no external deps)
python examples/demo_honesty.py --ollama   # real LLM via Ollama

---

Quick Start

Requires Rust 1.89+ and Cargo.

git clone https://github.com/TyKolt/kremis.git
cd kremis
cargo build --release
cargo test --workspace
cargo 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 server

In 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 (redb holds 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.db

---

Architecture

| 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 | kremis.mintlify.app/introduction | | Installation | kremis.mintlify.app/installation | | Quick Start | kremis.mintlify.app/quickstart | | Configuration | kremis.mintlify.app/configuration | | CLI Reference | kremis.mintlify.app/cli/overview | | API Reference | kremis.mintlify.app/api/overview | | MCP Server | kremis.mintlify.app/mcp/overview | | Philosophy | kremis.mintlify.app/philosophy | | The Name | kremis.mintlify.app/the-name |

---

Testing

cargo test --workspace
cargo clippy --all-targets --all-features -- -D warnings
cargo fmt --all -- --check

---

<!-- BENCHMARK-START -->

Benchmarks

Auto-generated on CI runners โ€” 2026-06-24.

| Operation | Linux | Windows | macOS | |-----------|------:|------:|------:| | Node insertion (100K) | 20.67 ms | 21.34 ms | 20.92 ms | | Signal ingestion (10K batch) | 8.34 ms | 10.13 ms | 8.28 ms | | Graph traversal (depth 50, 1K nodes) | 2.8 ยตs | 3.5 ยตs | 2.2 ยตs | | Strongest path (1K nodes) | 7.8 ยตs | 8.7 ยตs | 7.7 ยตs | | Canonical export (1K nodes) | 67.4 ยตs | 80.0 ยตs | 61.9 ยตs | | Canonical import (10K nodes) | 3.09 ms | 3.59 ms | 3.27 ms | | Redb node insertion (1K) | 360.48 ms | 15.5 s | 391.10 ms | <!-- BENCHMARK-END -->

---

License

Apache License 2.0

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.

---

<p align="center"> <strong>Keep it minimal. Keep it deterministic. Keep it grounded. Keep it honest.</strong> </p>

Related MCP servers

Browse all โ†’