Skip to main content
Glama
Kremis
by TyKolt

Alpha — 功能已实现并经过测试。在 v1.0 之前可能会有破坏性变更。


为什么选择 Kremis

问题

Kremis 的解决方案

幻觉

每个结果都可追溯到真实的输入信号。缺失数据会返回明确的“未找到”——绝不捏造

不透明度

完全可检查的图状态。没有隐藏层,没有黑盒

缺乏基础

零预加载知识。所有结构均源自真实信号,而非假设

非确定性

相同的输入,相同的输出。没有随机性,核心中没有浮点运算

数据丢失

通过 redb 嵌入式数据库实现 ACID 事务。设计上具备崩溃安全性

设计哲学 — 为什么存在这些约束。


Related MCP server: agent-fact-system

特性

  • 确定性图引擎 — 纯 Rust,核心无异步,无浮点运算。相同的输入总是产生相同的输出

  • CLI + HTTP API + MCP 桥接 — 同一引擎的三种接口:终端、REST 和 AI 助手

  • BLAKE3 哈希 — 完整图状态的加密哈希,用于随时进行完整性验证

  • 规范导出 (KREX) — 用于溯源、审计追踪和可重现性的确定性二进制快照

  • 零内置知识 — Kremis 启动时为空。每个节点都来自真实信号

  • ACID 持久化 — 默认使用 redb 后端,支持崩溃安全的事务


使用场景

通过 MCP 实现 AI 代理记忆

为 Claude、Cursor 或任何兼容 MCP 的助手提供一个可验证的记忆层。Kremis 将事实存储为图节点——代理查询它们,每个答案都可以追溯到真实的数据点。没有嵌入,没有概率检索。

LLM 事实核查

摄入你的数据,让 LLM 生成声明,然后根据图谱验证每个声明。Kremis 将每个陈述标记为 [FACT](事实)或 [NOT IN GRAPH](图中不存在)——没有置信度分数,没有歧义。

溯源与审计追踪

将完整图谱导出为确定性二进制快照,计算其 BLAKE3 哈希,并随时验证完整性。每个节点都链接到创建它的信号。适用于需要证明数据存在时间及内容的合规性工作流。


诚实演示

摄入一些事实,让 LLM 生成声明,Kremis 会验证每一个:

[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

三个事实已建立基础。三个是捏造的。没有歧义。

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

快速入门

需要 Rust 1.89+ 和 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

在第二个终端中:

curl http://localhost:8080/health
curl -X POST http://localhost:8080/query \
  -H "Content-Type: application/json" \
  -d '{"type":"lookup","entity_id":1}'

注意: CLI 命令和 HTTP 服务器不能同时运行(redb 持有排他锁)。在使用 CLI 命令之前请停止服务器。

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

架构

组件

描述

kremis-core

确定性图引擎(纯 Rust,无异步)

apps/kremis

HTTP 服务器 + CLI (tokio, axum, clap)

apps/kremis-mcp

用于 AI 助手的 MCP 服务器桥接 (rmcp, stdio)

查看 架构文档 了解内部细节:数据流、存储后端、算法、导出格式。


文档

完整参考请访问 kremis.mintlify.app:


测试

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

基准测试

在 CI 运行器上自动生成 — 2026-05-10。

操作

Linux

Windows

macOS

节点插入 (100K)

21.30 ms

22.06 ms

18.67 ms

信号摄入 (10K 批次)

6.98 ms

9.78 ms

8.12 ms

图遍历 (深度 50, 1K 节点)

2.6 µs

3.1 µs

2.3 µs

最强路径 (1K 节点)

7.6 µs

8.7 µs

6.1 µs

规范导出 (1K 节点)

68.2 µs

74.4 µs

56.6 µs

规范导入 (10K 节点)

3.09 ms

3.97 ms

3.38 ms

Redb 节点插入 (1K)

358.19 ms

14.6 s

489.02 ms


许可证

Apache License 2.0

docs/logo/ 中的品牌资产(标志、图标、favicon)为专有资产,不受 Apache 2.0 许可证保护。请参阅 docs/logo/LICENSE。

贡献

请参阅 CONTRIBUTING.md 获取指南。架构仍在演进中——在提交 PR 之前请先开启一个 issue。

致谢

本项目是在 AI 的辅助下开发的。


Available Tools

10 tools
kremis_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

    A3.6/5.0

    Scored across 10 tools

    Disambiguation5/5

    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.

    Naming Consistency5/5

    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.

    Tool Count5/5

    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.

    Completeness4/5

    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

    ActivityActive
    ResponsivenessUsually handled

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables coding agents to keep a local knowledge graph across sessions and checkpoints, restoring project context after tabs or model changes, and to ground every answer with an explicit verdict from the graph. Runs entirely on the user's machine over MCP/stdio or local JSON-RPC with no third-party runtime dependencies.
      12
      Apache 2.0
    • A
      license
      Not graded
      quality
      B
      maintenance
      An MCP stdio bridge that lets compatible agents query a local, provenance-first memory graph, fetch source-versioned text, inspect retrieval, check service health, and report usefulness feedback.
      1
      MIT