Memgraph Context Graph
Connect coding agents and SDK applications to Context Graph. This package provides the CLI, runtime adapters, event routing, and MCP server; graph components store the activity and memory.
For an overview of what you can do with it, start with the Context Graph guide.
Installation
For coding agents, the installer sets up the CLI, connectors, and agent wiring together. To install them yourself:
uv tool install 'memgraph-context-graph[mcp]' \
--with 'skills-graph[memgraph-context-graph]' \
--with 'actions-graph[memgraph-context-graph]' \
--with 'sessions-graph[memgraph-context-graph]'
memgraph-context-graph setup
The mcp extra provides the MCP server that memgraph-context-graph mcp uses to serve recall and memory to agents.
For a Python application, install the extra for your SDK and the graph components you need; see Memory for SDK apps.
Setup
memgraph-context-graph setup claude-code codex
memgraph-context-graph setup cursor --project-dir ~/work/billing
memgraph-context-graph setup --plan
memgraph-context-graph doctor --runtime codex
Setup connects to your configured Memgraph, or starts its own Docker container, writes your identity and connection settings, wires the selected agents, and checks the result. Claude Code and Codex use user-wide plugins; the other runtimes use project-local hooks and user-level MCP registrations.
memgraph-context-graph update codex # upgrade and refresh wiring
memgraph-context-graph uninstall codex # remove wiring; choose what else to remove
Restart running agents after an update. On a terminal, uninstall asks separately whether to delete setup's graph, the config, and the tool; those choices default to keeping them. Without a terminal it removes only wiring unless you supply removal flags. uninstall --all deletes all three, including the graph's data.
See runtime setup for the full lifecycle, manual wiring, and health checks.
Memory for SDK apps
Apps built with the Claude Agent SDK or OpenAI Agents SDK can use the same memory as coding agents, in-process. The SDK integration adds capture, memory context, and recall/memory tools.
from memgraph_context_graph.sdk import ContextGraphMemory
memory = ContextGraphMemory(user_id="alice")
SDK quick starts cover installation, wiring each SDK, and ending sessions.
Recall: memory for the harness's model
The recall tool retrieves dated conversations and facts from the user's history. The agent's model answers from that evidence. You can also query it from the terminal:
memgraph-context-graph recall "What did we decide about the deploy window?"
See recall and memory for search settings, output, and runtime behavior.
Memory: Context Graph as the harness's memory
Opt in to storing the agent's curated memory in Context Graph:
memgraph-context-graph setup codex --memory-backend context-graph
memgraph-context-graph setup codex --memory-backend native
The setting is user-wide. Setup imports supported existing memory before switching, then exposes the graph-backed memory tool and a session-start memory index. Import and hand-back behavior varies by agent; see the memory guide.
Configuration
Hooks read values from ~/.config/context-graph/config.toml. CONTEXT_GRAPH_CONFIG can select another file; connection settings and API keys are read from that file, rather than environment variables.
memgraph-context-graph config show
memgraph-context-graph config set identity.user_id "your-name"
memgraph-context-graph config set memgraph.url "bolt://my-host:7687"
memgraph-context-graph config set memgraph.password # prompts
The configuration guide covers connectors, extraction, recall, and optional LLM settings.
Capture privacy
Capture strips <private>…</private> text and redacts recognized credential patterns before storage. You can exclude projects or tools and add your own redaction patterns. Pattern matching cannot catch every secret. See capture privacy.
Forgetting sessions
memgraph-context-graph forget project . --dry-run
memgraph-context-graph forget session <session-id>
Forgetting deletes the session's captured activity and derived data that no other source supports. Explicit memory files remain. See forgetting sessions for deletion scope and protection against recapture.
Architecture
Runtime adapter → shared Event Protocol → graph connectors → Memgraph
Adapters translate runtime-specific activity. Connectors decide what to persist and live in the package that owns the graph schema. Runtime plugins distribute the hooks and MCP wiring.
| Read more | Covers |
|---|---|
| Claude Code plugin | Marketplace install and plugin specifics |
| Codex plugin | Marketplace install, hook trust, and tool approval |
| Command-hook reference | Payloads, generated files, and runtime differences |
| Architecture and extensions | Events, custom connectors, and runtime registrations |
| Actions Graph | Tool calls, messages, and subagents |
| Skills Graph | Skill definitions and usage |
| Sessions Graph | Memories, reconciliation, and recall |
| Resources Graph | Public GitHub resource caching |
License
MIT
Metadata
Release files for memgraph-context-graph 0.12.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| memgraph_context_graph-0.12.1.tar.gz | 210.6 kB | Without provenance | Details for memgraph_context_graph-0.12.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| memgraph_context_graph-0.12.1-py3-none-any.whl | Python 3 | none | any | Details for memgraph_context_graph-0.12.1-py3-none-any.whl |
Total release size: 371.2 kB
Release files / memgraph_context_graph-0.12.1.tar.gz
| Download URL | memgraph_context_graph-0.12.1.tar.gz |
|---|---|
| Size | 210.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
dafa1dcd7dafc61bfd1b191d798f0effc0995bcb4d70337736bf21094caeff15
|
|
BLAKE2b-256 checksum How to use checksums |
a5e0bc82662ad58cb8e4d097728d988afff0ab7da50a99ba2ea984c58fe3c618
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / memgraph_context_graph-0.12.1-py3-none-any.whl
| Download URL | memgraph_context_graph-0.12.1-py3-none-any.whl |
|---|---|
| Size | 160.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f2edfb0d3833bed9cfda1d7c4a2e62d348424c32a9fa0bfb16b41e3d210d5778
|
|
BLAKE2b-256 checksum How to use checksums |
961b060c6e1946981c16b7041c991f48ce45e1288f7542d0fa2a4e16b8486b19
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for memgraph-context-graph 0.12.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.