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

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.0
File Size Uploaded Provenance Actions
memgraph_context_graph-0.13.0.tar.gz 246.4 kB Without provenance Details for memgraph_context_graph-0.13.0.tar.gz

Built distribution (wheel)

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

Total release size: 429.9 kB

Release files / memgraph_context_graph-0.13.0.tar.gz

Download URL memgraph_context_graph-0.13.0.tar.gz
Size 246.4 kB
Tags Source
SHA-256 checksum
How to use checksums
c3d70c4b55bb41fc102ed1b895915673648b47086780efd248d9a7092bf2d751
BLAKE2b-256 checksum
How to use checksums
d4feb1791f7e32e219c5498fddf7928da79a3b6c97fc6d869c5134c4eb9de12b
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.0-py3-none-any.whl

Download URL memgraph_context_graph-0.13.0-py3-none-any.whl
Size 183.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a6ba6312e0ad19c5ef56453c834c8ae4dc50c361c492cd378543d02601f66647
BLAKE2b-256 checksum
How to use checksums
482d23b630b16b1bc8ec36f120e178ac2dd528386f5f6e14402a324746cf2e1e
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.0

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