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. A profile sends one agent's memory to another Memgraph, e.g. join <url> <login> --agent codex, while the other agents stay where they are.

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

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.13.1
File Size Uploaded Provenance Actions
memgraph_context_graph-0.13.1.tar.gz 249.2 kB Without provenance Details for memgraph_context_graph-0.13.1.tar.gz

Built distribution (wheel)

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

Total release size: 433.9 kB

Release files / memgraph_context_graph-0.13.1.tar.gz

Download URL memgraph_context_graph-0.13.1.tar.gz
Size 249.2 kB
Tags Source
SHA-256 checksum
How to use checksums
30b25d815fe9212c1c6d58db4748fb8431cdcbef38109ccf2e9e449b0cd8ffa2
BLAKE2b-256 checksum
How to use checksums
0dc9793c388729788d9f8f152720be6ac2ea2e138c11f5197b02d8b5287c2c00
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","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.13.1-py3-none-any.whl

Download URL memgraph_context_graph-0.13.1-py3-none-any.whl
Size 184.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c39dad3719104300146e16f05dc18fbd34fdd76c2d4f1d69f51076e6ec4647c0
BLAKE2b-256 checksum
How to use checksums
62ef7f6a55d11a018b30e8a4f23a478baa373994c87cf4ce8f8c8edac90a2d84
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","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.13.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.

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