SuperAPI AI Directory

shadowgraph

Local-first decision memory for AI agents: stores choices, rejected alternatives and reasons, failed attempts, outcomes, provenance and review conditions.

Open website

About this tool

ShadowGraph is a local-first decision memory system for AI agents developed by LiLara-AI, currently in technical preview/early access. The problem it solves is: chat memory remembers only conversations but loses decisions. For example, three months later, when asking the agent why the project uses SQLite, the choice may remain in a summary, but the rejected alternatives and their reasons will not be preserved; after a fact changes (such as deployment moving from single-user to multi-user), there is no mechanism to reopen that decision; failed attempts are not recorded as failures, causing the same approach to fail again.

In terms of main capabilities, ShadowGraph stores reasoning as structured, inspectable data rather than prose text, including: the chosen option, rejected alternatives and their reasons, the assumptions and evidence behind them, failed attempts, outcomes, sources, confidence history, and the conditions that should trigger rethinking. Decision memory supports recording the chosen approach, rejected alternatives with reasons, assumptions, evidence, and structured reopenWhen rules, and outcomes (success, mixed, failure, unknown) feed back into confidence. The reconsideration feature evaluates reopening rules through review() based on stored facts, so after a restart it works without the caller needing to re-provide what changed, and review signals persist and can be confirmed. Failed attempt memory records the approach, outcome, environment, and lessons. Sources are auditable, and every claim carries a sourceClass (agent_claimed, tool_observed, human_confirmed, or production_verified); ordinary tool input cannot create verified, and a separate Ed25519 verifier must be configured. Scoped memory and temporal backtracking store preferences, profiles, goals, instructions, procedures, episodes, and notes via remember()/recall() by project and optional userId/agentId/runId; facts, memories, and relationships are bitemporal, allowing queries of what was true at a past moment. Retrieval fuses lexical, vector, graph-distance, and temporal signals, and declares which signals are unavailable. Explainable retrieval exposes raw scores, rankings, and reasons, and every bounded response declares the total count, page count, and omitted scope.

In terms of usage, Node.js 20+ is required (the optional SQLite backend uses node:sqlite on Node 22.5+). There are no runtime npm dependencies, no build step, no account, and no network calls. ShadowGraph is not published to npm; during the technical preview it must be installed from the repositoryinstallation; a global install puts shadowgraph into PATH for use by MCP clients. Installing the current main branch as development build 0.42.0-dev.0; if installing the technical preview version, use github:LiLara-AI/shadowgraph#v0.41.0. Each command accepts a single JSON argument, and quote handling varies by shell. Use setup to initialize storage (creating .shadowgraph/data.json in the current directory), and doctor to check Node compatibility, storage read/write, graph validity, and the MCP entry point. Each command runs in a new process and reopens storage from disk, so search results are returned across real restarts. The built-in demo can show a "decision that reopens itself" within three commands: first record a decision, then the world changes (such as becoming multi-user), and after a restart, ask again with only the project name; ShadowGraph reads the stored facts, matches the saved rule, and presents the alternative that was rejected because its reason no longer holds.

A read-only dashboard is also provided http://127.0.0.1:8787/dashboard,仅与同本地源通信,输入的令牌只保留在页面内存中。存储方面,JSON is the zero-dependency default, storing the versioned graph at .shadowgraph/data.json, relocatable via SHADOWGRAPH_FILE; on Node 22.5+, setting SHADOWGRAPH_STORAGE=sqlite enables a WAL-backed relational adapter. Storage writes at schema 7, schemas 1 through 6 remain readable, and downgrading creates a copy at schema 5 or schema 6. State and logs are written atomically, backups take a consistent snapshot, and recovery verifies domain and log consistency beforehand.

On local-first and privacy: everything is local files, the HTTP server binds to 127.0.0.1 and rejects non-local browser origins, there are no cloud services, no accounts, no telemetry, no analytics, and no outbound network requests are made unless explicitly configured. Options that may send data off the machine are all off by default: embeddings have no configured endpoint, a local OpenAI-compatible server is usable once configured, and remote endpoints additionally require SHADOWGRAPH_ALLOW_REMOTE_EMBEDDINGS=1; extraction sends eligible redacted captures through the supported first-party Claude subscription path, limited to Windows and specific Claude Code versions; Markdown export writes a plaintext copy you control, which ShadowGraph cannot later find or delete; host delivery is inert until installation hooks are installed and activated, and after activation delivered records enter the Claude Code session transcript, from which ShadowGraph cannot remove them. Capture, extraction, and delivery each require their own activation flow. For shared local use, set a Bearer token, with each request carrying Authorization: Bearer plus a random token of at least 16 characters; this is defense in depth for local deployments, not a public-network security model.

On MCP, compact mode is recommended, advertising 16 workflow tools while the full graph, memories, facts, alternatives, and outcomes are still stored at full fidelity. The 16 compact tools include shadowgraph_context, shadowgraph_review_context, shadowgraph_expand, shadowgraph_remember, shadowgraph_recall, shadowgraph_record_decision, shadowgraph_record_attempt, shadowgraph_record_fact, shadowgraph_record_outcome, shadowgraph_retrieve, shadowgraph_search, shadowgraph_review, shadowgraph_validate, shadowgraph_maintain, shadowgraph_ack_review, and shadowgraph_reconsider. Full mode advertises 35, including owner tools such as backup, restore, and purge; shadowgraph_bind and shadowgraph_attribute only propose and change nothing. Tool metadata follows the revision negotiated during initialize. CLI commands include setup, doctor, serve, mcp, stats, list, search, retrieve, recall, remember, markdown-sync, context, review, maintain, signals, ack, validate, repair-plan, backup, restore, decision, attempt, fact, outcome, status, link, traverse, redact, supersede, purge-preview, purge, journal, rebuild, confidence-evidence, review-context, deliver, capture, install-hooks, uninstall-hooks, activate, deactivate, extract, quarantine, reconsider, migrate, downgrade, bind, attribute, request-access, issue-access, delegate-access, revoke-access, discard-access, access-status.

The applicable scenario is developers building agents on MCP, CLI, or the local HTTP API who need important decisions to persist across sessions and remain explainable, reviewable, and reconsiderable. Limitations include: it is in technical preview and not published to npm; installation must be done from the repository; some features (extraction) are limited to Windows and specific Claude Code versions; pattern redaction cannot guarantee removal of all secrets; copies from Markdown export and host delivery cannot be deleted by ShadowGraph; and more details require consulting the relevant documentation.