Graph Memory
Standalone, evidence-backed temporal memory for any LLM through MCP 2026-07-28.
The runtime talks directly to Neo4j. Its only direct Python dependencies are
Pydantic and the official Neo4j driver. No Graphiti server, embeddings,
agent framework, or Markdown lookup is required.
Transcripts become typed entities and evidence-backed relationships. Retrieval
recomputes current state by when a fact was observed or an event happened,
across sessions. Projects, people, organizations, technologies, decisions,
preferences, lessons, issues, and activities share the same graph and temporal
rules. Plans, contradictions, undated claims, and inferences remain distinguishable.
Transcript → durable episode → LLM extraction → Pydantic + quote validation
↓ atomic commit
Neo4j entities + facts + evidence
↓
current context / latest evidence by entity and relation
↓
Luna dream → separate candidate → validated insights
Run locally
Python 3.11+ and Neo4j 5.26+ are required. uv is a convenient installer; ordinary
pip install . also works. Docker Compose runs the full local system: Neo4j, the
background worker, and the MCP server. Neo4j Browser is published only with the
browser profile. See Docker setup for authentication and
mounted sources. Docker is optional for a Python-only installation.
cp .env.example .env
# Set NEO4J_PASSWORD, MEMORY_HTTP_TOKEN and your memory-bank path in .env,
# then authenticate Codex.
docker compose up -d --build
.env.example documents every variable the Compose files read. The personal
stack starts with the default password and token graph-memory, and its services
stop with instructions until you change both or set
MEMORY_ALLOW_DEFAULT_PASSWORD=1 for a throwaway graph. The transcripts stack has
no defaults.
The MCP endpoint is http://127.0.0.1:8765/mcp. serve defaults to stdio for
clients that launch subprocesses. See MCP requests and client setup.
The database requires a password, binds only to localhost and persists in a named
volume. Use a private network for a shared installation. The
operations runbook covers deploy, rollback, log reading,
journal maintenance, sizing and backup.
Extraction and dreaming with Terra
Log into your installed Codex CLI, then:
export MEMORY_LLM=codex
export MEMORY_MODEL=gpt-5.6-terra
export MEMORY_REASONING_EFFORT=low
uv run graph-memory --namespace personal ingest /path/to/session.jsonl --extract
uv run graph-memory --namespace personal recall Atlas
uv run graph-memory --namespace personal latest Atlas --relation decided
uv run graph-memory --namespace personal latest Atlas --relation resolved
The CLI adapter uses codex exec with isolated working directories, read-only
sandboxing, no inherited user configuration, no persistent session, every agent
tool and web search disabled, a minimal environment, and schema-constrained
output. A call that exceeds MEMORY_LLM_TIMEOUT is killed with its process group. The generated JSON Schema includes the event-time constraints enforced at commit.
A rejected schema or evidence candidate gets a bounded correction attempt. Present-tense state and plans use
the originating message time; event occurrences require their own time evidence.
Extraction failures remain visible and retryable.
Alternatively, MEMORY_LLM=compatible uses a configured chat-completions endpoint
(MEMORY_LLM_URL, MEMORY_MODEL, optional MEMORY_LLM_API_KEY). No provider SDK is
needed. The worker requires a configured model. MCP sessions only queue information;
Python and CLI retain the prepare/commit operations for engine integrations.
MCP tools
Every call carries all necessary identifiers. A server bound to a namespace
supplies it, and an unbound server requires it as an argument. No transport
session, initialize handshake, sampling callback, or agent host is required for
the 2026 protocol. Clients that still send the 2025 initialize request get a
stateless answer on both transports.