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アシスタントという3つのインターフェースを同一エンジンで提供

  • 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

3つの事実は根拠あり。3つは捏造。曖昧さは一切なし。

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/ 内のブランド資産(ロゴ、アイコン、ファビコン)はプロプライエタリであり、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