graph-memory is a knowledge-graph context engine for OpenClaw agents that tackles three related problems: context explosion in long conversations, cross-session amnesia, and "skill islands" where an agent's learnings sit in disconnected notes. Instead of carrying raw history forward, it extracts structured knowledge from conversations into a typed property graph — TASK, SKILL, and EVENT nodes connected by edges like USEDSKILL, SOLVEDBY, and REQUIRES — stored in a local SQLite database. In the README's 7-round example, raw context grows to about 95K tokens while graph-memory stabilizes around 24K, roughly 75% compression.
Recall runs two parallel paths that merge: a precise path (vector/FTS5 search into seed nodes, community expansion, graph walk, then Personalized PageRank ranking) and a generalized path that matches the query embedding against LLM-generated community summaries. Personalized PageRank ranks nodes relative to the current query rather than global popularity, computed at recall time in a few milliseconds. Top-ranked nodes also pull in episodic traces — the original conversation snippets that produced them — so the agent sees the actual dialogue, not just triples. Extraction happens asynchronously after each turn via a configurable LLM; every few turns a maintenance cycle runs PageRank, community detection, and deduplication.
It installs as an OpenClaw plugin and must be registered as the context engine (plugins.slots.contextEngine) for the ingest/assemble pipeline to fire. It requires an OpenAI-compatible LLM endpoint for extraction; embeddings are optional but recommended (any endpoint implementing POST /embeddings works, including Ollama and llama.cpp locally — without one it falls back to FTS5 keyword search). Agents get gmsearch, gmrecord, gmstats, and gmmaintain tools for querying and maintaining the graph directly.
