Cross-vendor semantic memory: recall across Claude Code / Codex / Grok sessions by meaning.
This MCP server enables cross-vendor semantic memory by recalling across Claude Code, Codex, and Grok sessions by meaning. It is associated with Korg, described as a causally-ordered, rewindable, event-ledger approach for autonomous AI agents, using a hash-chained, tamper-evident recording model.
๐ ๏ธ Key Features
Cross-vendor semantic memory recall by meaning (Claude Code / Codex / Grok sessions)
Causally-ordered event ledger for autonomous AI agents
A causally-ordered, rewindable event-ledger for autonomous AI agents.Every step your AI agent takes, recorded in a hash-chained ledger you can independently verify โ tamper-evident, zero trust, no blockchain.
korg demo โ record, verify, and rewind an AI agent session as a hash-chained ledger
AI agents are black boxes. When they fail, you can't debug. When they succeed, you can't reproduce it.
When they do something wrong, you can't undo it.
Korg fixes this.
What Korg Does
NOTE
Universal Ingestion Integration Mode:
Korg v1 is an MCP-callable audit sink. Any MCP-compatible coding agent (Claude Code, Codex, etc.) can call korg's tools to record its session as a causally-linked, replayable, rewindable ledger. The agent must be instructed to log its actions โ typically via system prompt or MCP server configuration. Fully passive auditing without agent cooperation is on the roadmap for future versions.
WARNING
Trust Boundary & Deployment Scope:
Korg v1 is designed strictly for local, single-user workspaces. Multi-tenant and networked deployments require cryptographic authentication and permission bounds that are not yet shipped. Running the server on an untrusted or public network exposes workspace read/write access.
Korg is a cognitive hypervisor โ a runtime layer that sits beneath your AI agents and governs every decision they make.
It doesn't replace your LLM. It governs what the LLM does.
code
Foundation Model โ predicts, suggests, generates
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Korg Cognitive Runtime โ schedules, validates, isolates,
reconciles, replays, heals, governs
Every agent action is:
Appended to an immutable, cryptographically-signed ledger
Ordered with Hybrid Logical Clocks (causal, deterministic, globally consistent)
Replayable โ rebuild exact state at any point in history
Reversible โ rewind the ledger to any prior sequence point
Try the Time-Travel Demo
You can run the built-in sandbox demo to see cognitive time-travel in action. The demo sets up a temporary workspace with a buggy Python script, lets a simulated coding agent make a wrong edit, catches the test failure, rewinds the workspace and ledger to before the edit, and speculatively commits the correct fix:
bash
cargo run -- demo
You will see the complete, colorized time-travel sequence:
The crate is not yet published to crates.io; install from source:
bash
git clone https://github.com/New1Direction/korg
cd korg
cargo build --release
./target/release/korg --help
Python bridge (for korgex / korgchat)
bash
cd crates/korg-bridge
maturin develop # builds the PyO3 extension into the active venv
python3 -c "import korg_bridge; print(korg_bridge.__version__)"
Run your first campaign
bash
# Interactive TUI dashboard
korg campaign --tui --prompt "Refactor the auth layer to use JWTs"# Web cockpit at localhost:8080
korg campaign --web --prompt "Optimize the database connection pool"# Pure autonomous goal mode (--goal is a top-level flag)
korg --goal "Write and validate a full test suite for src/parser.rs"# Run the full multi-persona swarm on a REAL local model โ every persona# (Captain, Harper, Benjamin, Lucas, Evaluator) runs as a real worker# subprocess doing real, measured, attested work. Defaults to a hermetic# deterministic provider; `--provider ollama` makes it live.
korg --goal "Fix the failing test in src/lib.rs" --provider ollama --model qwen2.5:7b
# Preview without committing (dry-run; --preview is a top-level flag)
korg --preview "Refactor the main event loop"
Rewind & Verify
bash
# Rewind the capability journal to a specific ledger sequence point
korg rewind --seq 4
# Drive the honest pipeline on a fixture and emit a verifiable ledger
korg run-once "Fix the add function in src/lib.rs so it adds"# Same pipeline, but with a REAL local model (ollama) on an arbitrary task โ# the model writes the patch, Korg applies it, measures the real git diff +# `cargo check`, and attests only what actually changed.
korg run-once "Fix the bug in src/lib.rs: max() returns the minimum.
Output the COMPLETE corrected src/lib.rs:
\`\`\`rust
$(cat your-repo/src/lib.rs)
\`\`\`" --repo your-repo --provider ollama --model qwen2.5:7b
# Independently verify any korg-ledger@v1 journal (no trust in the producer)
korg-verify <path-to-ledger.jsonl>
Honest by construction, with any model. The default provider is a hermetic
deterministic stub (fixture-only, zero dependencies). --provider ollama runs
a real local model on arbitrary tasks โ Korg asks OpenAI-compatible providers
for strictly valid JSON (response_format: json_object), so even a small (7B)
local model lands a real patch reliably (measured 5/5 with qwen2.5:7b). Either
way the attestation is measured, never fabricated: when the model produces a
patch, the ledger attests the real git diff file count and changed paths; if
it declines or writes a non-compiling change, Korg reports it honestly (an
honest null โ zero changed, zero attested โ or a failed cargo check). The
pipeline cannot attest a number the worktree does not actually show โ that is
the guarantee, independent of model quality.
Verify it in your browser โ sends nothing. Zero-install, client-side
verifiers (Web Crypto) for any korg-ledger@v1 journal or Certificate:
verify a session ยท
verify a Certificate ยท
time-travel explorer.
They hash-chain, check the causal DAG, validate Ed25519 signatures, and
re-derive the human summary from the events โ all locally.
Speculative branch/fork and named checkpoints (korg fork, korg checkpoints list|restore) are planned, not yet shipped. The reversibility surface today is
korg rewind.
Cognition Modes
Korg adapts its intelligence tier based on task complexity. Modes are governed exclusively through the capability resolver โ every switch is ledger-logged.
You can inspect a real-world cognitive audit ledger produced by Korg. This NDJSON file records a live session where Claude Code was prompted to call Korg's MCP tools to refactor a function and rename all call sites, capturing the full HLC causal graph and actor_id recorder metadata:
CapabilityResolver โ the single authority for all runtime state. All reads and writes flow through it. No secondary state stores.
CapabilityJournal โ the append-only WAL. Every cognitive event is sealed here with an HLC timestamp, causation chain, and cryptographic signature.
ProjectionEngine โ pure state folds over the journal. Any read model can be rebuilt deterministically from the raw event stream.
ExecutionCheckpoint โ snapshot of {ledger_offset, projection_state, lease_map, workspace_tree_hash}. Restores full runtime state in O(1) without replaying the entire event stream.
CapabilityExecutor โ executes the physical effect DAG. Failures trigger automatic micro-healing before escalating.
Korg is in active development, built on a frozen korg-ledger@v1 spec with cross-language conformance (Rust + Python + JS). Test footprint: 300+ Rust tests across the workspace plus Python/JS conformance suites, CI-gated (build ยท tests ยท cross-language oracle ยท differential fuzz) and green on main.
Shipped:
Append-only, hash-chained cognitive ledger with HLC ordering
Deterministic replay and projection rebuilds
Reversible execution โ rewind the ledger to any prior sequence point (tamper-evident LedgerRewind)
Certificate (korgcert@v1) โ a public, independently-verifiable certificate of agent work, with zero-install in-browser verifiers
Honest pipeline (korg run-once) โ real patch โ real cargo check โ an attested mutation count that equals the real git diff; never fabricates (reports an honest null instead)
Live local model (--provider ollama) โ real per-persona work on arbitrary tasks
Multi-agent swarm (Captain, Harper, Benjamin, Lucas, Evaluator) โ genuine worker subprocesses doing real, measured, attested work with DAG data-flow between personas
Zero-config Claude Code capture (PostToolUse/Stop hooks โ verifiable per-session ledgers)
Micro-healing effect layer ยท TUI dashboard + Web cockpit