Skip to main content

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.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for memgraph-context-graph 0.12.2
File Size Uploaded Provenance Actions
memgraph_context_graph-0.12.2.tar.gz 214.5 kB Without provenance Details for memgraph_context_graph-0.12.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for memgraph-context-graph 0.12.2
File Interpreter ABI Platform Actions
memgraph_context_graph-0.12.2-py3-none-any.whl Python 3 none any Details for memgraph_context_graph-0.12.2-py3-none-any.whl

Total release size: 376.9 kB

Release files / memgraph_context_graph-0.12.2.tar.gz

Download URL memgraph_context_graph-0.12.2.tar.gz
Size 214.5 kB
Tags Source
SHA-256 checksum
How to use checksums
1cb4e4e6caeeb90f25c7e9f5a6fb79375ec4c1a7ca0b9d3a12b987b442754e2b
BLAKE2b-256 checksum
How to use checksums
aeca32006f543ac0d2e8ae1559df130318b04e1dd68c3d44dc0e27467cdd14ba
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.2-py3-none-any.whl

Download URL memgraph_context_graph-0.12.2-py3-none-any.whl
Size 162.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
809af16c7248ca545568606c7912f53e2c3d8e4aac34a9f82384912d43f95fd5
BLAKE2b-256 checksum
How to use checksums
8e2e23b422bb332e387ccddcebe48860fcd342e6f78bca464bdace4b35df9f44
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.2

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page