graph-mem CLAUDE.md

graph-mem CLAUDE.md is an instructions file for coding agents from quequiere/graph-mem. It costs 2,842 tokens per session, scanned B, original, Apache-2.0.

A project instruction file for graph-mem, a local Claude Code plugin that stores project knowledge as a connected graph instead of a simple list of notes. It describes the Python server, databases, language-model service, and development commands.

In plain words
What is it for?
Use it when developing, running, or debugging graph-mem, its graph database, its Graphiti service, its OpenRouter connection, or its Docker setup.
Why use it?
It gives coding agents the system context needed to work safely on a multi-service project. The architecture and setup details reduce confusion about how the parts communicate.

Instructions file

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/quequiere/graph-mem/claude-md
Clone the repo
git clone --depth 1 https://github.com/quequiere/graph-mem

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for graph-mem CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/quequiere/graph-mem/claude-md.svg)](https://agentmods.dev/instructions/quequiere/graph-mem/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/quequiere/graph-mem/claude-md"><img src="https://agentmods.dev/badge/instructions/quequiere/graph-mem/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 2,842 This file is loaded in full into every session.
When invoked 2,842 The same file — it is already loaded in full.
Security scan B 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.02842 $0.02842
Opus 5 $0.01421 $0.01421
Sonnet 5 $0.00568 $0.00568
Haiku 4.5 $0.00284 $0.00284

Measured 3d ago against content hash 1cc96d74cd0a, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade B, and why

graph-mem CLAUDE.md scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

Configured in `~/.claude/settings.json`:
CLAUDE.md · 228 lines

How it starts

The opening of the file, as written. The whole thing — 228 lines — stays where its author put it; the contents beside it link to each section on GitHub.

graph-mem - Project Tracking

Project Overview

graph-mem is a Claude Code plugin that provides persistent, intelligent memory using Graphiti's knowledge graph. Unlike flat memory stores, it leverages entity relationships, temporal awareness, and semantic search to build a rich understanding of the developer over time.

Current Status

Working end-to-end on branch feat/openrouter-graphiti-patch. Stack: Neo4j 5.26 + patched Graphiti + OpenRouter (gemma-4-26b + qwen3-embedding-8b).

Design Spec

Full design document: .docs/specs/2026-04-05-graph-mem-design.md

Architecture

Claude Code (stdio) → graph-mem MCP server (Python, local)
                          → Graphiti REST API (Docker, httpx over HTTP)
                              → Neo4j 5.26 (Docker)
                              → OpenRouter API (LLM + embeddings)
  • Language: Python, installed via pip install -e .
  • No graphiti_core dependency: pure REST/HTTP client
  • LLM backend: OpenRouter (configurable via .env)
  • Embeddings: qwen/qwen3-embedding-8b (4096 native, truncated to 1024 client-side)

Docker Stack

docker compose up -d --build   # from project root

Requires .env with OPENROUTER_API_KEY. See docker-compose.yml.

Patched files in graphiti/:

  • zep_graphiti.py — ExampleLLMClient (fixes schema echoing for Gemma/Qwen/Llama), configures embedder + cross-encoder from env vars
  • ingest.py — AsyncWorker catches exceptions instead of dying silently (upstream bug)
  • Dockerfile — extends zepai/graphiti:latest with patches

MCP Tools (current — minimal surface)

Only 3 tools exposed to keep model attention focused:

Tool Purpose
__IMPORTANT__graph_mem Workflow reminder — tells model how to use graph-mem
save_memory(content, scope) Save info. scope="user" or "project"
search_memory(query, scope) Search. scope="all", "user", or "project"

scope replaces the old group_id parameter — the server computes the correct group_id automatically from cwd's git remote URL. This prevents the model from inventing group_ids.

Read the full file on GitHub · 228 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 228 lines · 2,842 tokens per session scan B 1cc96d74cd0a

Subscribe to this mod's changes

graph-mem CLAUDE.md is an instructions file published in the GitHub repository quequiere/graph-mem (5 stars, last pushed 4mo ago), licensed Apache-2.0. It adds 2,842 tokens to every session, about $0.0142 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.