ForkMind

by Medhovarsh

2 177 downloads Not rated yet MIT

About

🧠 Local-first LLM state branching & debugging. Capture, visualize, branch, and regression-test LLM calls as a DAG. Free & local via Ollama, any OpenAI-compatible API, MCP for agents. Zero config.

Details

License
MIT

Explore

- Local-first LLM state branching and debugging.
- Conversation visualized as a Directed Acyclic Graph.
- Branch from any point with alternative prompts or models.
- Compatible with any OpenAI-compatible API or Anthropic.
- MCP server for AI agents to query their own history.
- Plain JSON storage, no database or telemetry.

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name ForkMind
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository


npx forkmind init
npx forkmind start

npm install -g forkmind
forkmind start

No npm registry needed either β€” ForkMind runs straight from the git link, and
the dashboard builds automatically on install:


npx github:medhovarsh/forkmind init
npx github:medhovarsh/forkmind start

ForkMind ships a Claude Code plugin (skill + /forkmind command) so Claude knows
when and how to drive it β€” same install flow as any marketplace plugin:

text
/plugin marketplace add Medhovarsh/forkmind
/plugin install forkmind

The plugin bundles:

- forkmind skill β€” Claude reaches for ForkMind whenever you ask it to debug
a prompt, compare models, branch from a past turn, or regression-test a call.
- /forkmind command β€” start / branch / test / mcp on demand.
- forkmind-debugger agent β€” runs model/prompt comparisons in an isolated
context and returns a compact verdict instead of dumping transcripts.
- MCP server, auto-wired β€” agents query their own .forkmind/ history
(recall attempts, trace lineage, self-correct) with zero manual config.

The CLI is still what runs the proxy + dashboard; the plugin is the glue that
teaches Claude to use it.

bash

ollama pull llama3

forkmind_recent

List the most recent captured LLM turns (newest first), compact. Use to recall what was just tried.

forkmind_get_node

Fetch one node by id with full request + response payloads.

forkmind_lineage

Return the full conversation path from the root to the given node β€” the exact context that produced it. Use to understand how a state was reached.

forkmind_children

List the alternative continuations (branches) that fork from a node. Use to compare what different prompts/params produced from the same point.

forkmind_search

Case-insensitive substring search across all captured requests/responses. Use to find prior attempts mentioning a term, error, or tool.

forkmind_stats

Summary of the conversation tree: totals, roots, leaves, providers.

forkmind_context_save

Offload conversation context into an immutable, encrypted DAG on disk. Pass the items to archive plus a short digest YOU write (the retrieval key you keep in your window; omit for private capsules). After the id comes back, verify with forkmind_context_digest, THEN drop the material from your working context β€” never before.

forkmind_context_list

Compact list of saved capsules (title, digest, size, age). Optional substring filter over title + digest.

forkmind_context_digest

Cheap probe: full digest and DAG structure for one capsule, no decryption of content. Use before restoring to decide whether you need the whole capsule or one segment. Also serves as the durability check after a save, before you compact your window.

forkmind_context_restore

Decrypt and return capsule content (integrity-verified first). Pass segmentIds for a partial restore β€” pull back only what you need.

forkmind_context_forget

IRREVERSIBLY destroy a capsule: its encryption key is shredded and the id tombstoned. You must echo the capsule id in `confirm`. Only call when the user explicitly asks to forget.

forkmind_context_stats

Aggregate stats across all capsules: count, bytes, estimated tokens freed from the window, how many have a digest, forgotten count, and replica health.

forkmind_context_export

Export a capsule as a passphrase-encrypted, self-contained bundle that can move to another project or machine β€” it carries its own key material and does not depend on this project's local master key. The passphrase is never stored in the bundle; the caller must keep it to import later. Returns the bundle JSON β€” write it to a file.

forkmind_context_import

Import a bundle produced by forkmind_context_export. Every segment is independently re-verified (id, hash, parent graph, acyclicity) before anything is written β€” the bundle is never trusted blindly. Re-wraps the capsule under this project's local master key.

forkmind_context_replicas

Status of redundant capsule storage: each replica target with reachability and coverage. Optionally sync (push all capsules + propagate tombstones) before reporting.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "forkmind": {
            "forkmind": {
                "command": "npx",
                "args": [
                    "-y",
                    "forkmind",
                    "mcp"
                ]
            }
        }
    }
}

McpServers

{
    "forkmind": {
        "command": "npx",
        "args": [
            "-y",
            "forkmind",
            "mcp"
        ]
    }
}

npm
License: MIT
CI
Node
PRs welcome
Contributing
Contributors
Live site

Local-first LLM state branching & debugging. ForkMind treats AI context
windows like a Git repository: it captures every LLM call into a local
.forkmind/ directory, visualizes the conversation as a Directed Acyclic Graph
(DAG), and lets you branch alternative prompts or model params from any point
in the history β€” all on your machine, no cloud, no account.

Works with any OpenAI-compatible API, defaulting to free, open-source
models
via Ollama. Also supports Anthropic and any
hosted free tier (Groq, OpenRouter, Together, vLLM, LM Studio).

ForkMind demo β€” clicking through the conversation DAG, inspecting a node, and opening the fork dialog

> Live demo: a conversation tree with a branch off the root, the node inspector
> (request/response, tokens, provenance), and the Fork from here dialog.

<details>
<summary>Static screenshot</summary>

ForkMind dashboard β€” conversation DAG with a branch, stream badges, and the node inspector

</details>

---

Why

Debugging agentic / tool-calling flows means re-running the same prompt with
tiny tweaks over and over. ForkMind records each run as a node, so you can:

- See the whole conversation tree, including tool calls and token usage.
- Branch from any historical turn β€” edit the prompt, swap the model, re-run.
- Compare outcomes visually instead of scrolling through terminal logs.

Everything is plain JSON on disk. No database. No telemetry.

---

Install

```bash

No reviews yet β€” be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.