This is an early release preview. You may encounter bugs.
Graph Memory logo
Unclaimed

Tool memory coding

Graph Memory

Builds a typed knowledge graph from agent conversations for compressed context and cross-session recall

B 77/100 GitHub score ? This grade is derived from GitHub signals, not user votes. Open for the full breakdown.
No votes yet

01 / About

What Graph Memory is.

Graph Memory is a memory plugin that bounds what an agent's model sees on each request while keeping the full history reachable. By default it keeps the newest five completed user turns in the model-visible context, replaces everything older with a single archive marker, strips completed reasoning and tool traces from later requests, and recalls relevant older or cross-session material automatically.

Extraction is limited to the user question and the final visible answer, taken through a strict structured tool contract rather than by ingesting reasoning or tool transcripts. The result is a graph of TASK, SKILL, and EVENT nodes that point back to the original messages, so a recalled hit travels with its exact source question and answer. Retrieval is query-first: vector top-K search with an SQLite FTS5 fallback, over a local SQLite database that persists across sessions and projects.

A measured 20-turn GLM-5.2 run compares the host runtime with and without the plugin:

Measure Native DSH With Graph Memory Change
Turn 20 first request 56,998 tokens 16,769 tokens -70.58%
Turn 20 model-visible messages 171 24 -85.96%
Turns 1-20 first-request context 532,451 tokens 257,656 tokens -51.61%
All measured tokens 2,487,776 2,401,512 -3.47%

The run records 20 of 20 scenario turns passing and 19 of 20 structured extractions succeeding, producing 42 nodes, 55 edges, and 42 vectors. Structured extraction depends on the model following the tool contract; an invalid extraction is quarantined instead of persisted, and the foreground conversation continues. Recall is bounded by a configurable top-K, so a broad multi-topic question can need a larger K or separate questions.

It runs on DeepSeek Harness through a native adapter and on OpenClaw through the Context Engine plugin slot, and needs Node.js 22.13 or newer. Embeddings are optional: point it at an OpenAI-compatible embedding endpoint, or leave it on the FTS5 path.

Features

  • Context takeover: a configurable number of newest completed turns stays visible; one archive marker replaces the older model surface
  • Lightweight extraction: only the user question and final answer are ingested, through a structured tool contract
  • Query-first recall: vector top-K with an FTS5 fallback, returning the exact source question and answer alongside graph hits
  • Durable local store: SQLite with stable provenance, recall across sessions and projects
  • Quarantined failures: invalid extractions are set aside rather than repaired or persisted, and never block the conversation
  • Agent tools: gmstatus, gmsearch, gmrecord, gmstats, gmmaintain, and gmretry_extraction, with automatic recall needing no tool call
  • Optional embeddings: any OpenAI-compatible embedding endpoint, configured by environment variables
  • Two hosts: a native DeepSeek Harness adapter and an OpenClaw Context Engine adapter

02 / Discussion CREDIBILITY-GATED

Discussion

Reading is open to everyone. Posting and voting need a verified identity or a GitHub grade of B or higher.

  • No discussions yet.

03 / Build

Build with Graph Memory.

Browse the catalogue for frameworks, tools, and harnesses, each scored on real GitHub credibility.

Get Graph Memory →

Browse the catalogue