Skip to main content

deepagents-graph-memory

PyPI Python 3.11–3.14 License: MIT

Give your agent a record of what it tried and what worked.

For developers building LangChain Deep Agents that handle long-running tasks and need to remember a lot of context. The graph connects attempts, evidence, and results so agents can find earlier work before deciding what to do next.

Works alongside the virtual filesystem (VFS): files hold code, logs, and tool dumps; the graph links findings to their evidence. For example: failing test → suspected cause → code change → test result.

Virtual Graph System: connected reasoning traces

Inspired by Niels de Jong's Neo4j article, From recall to reasoning: How context graphs upgrade an agent’s brain. Built by Pranav Bedi and Taha Khan, using LadybugDB. Experimental.

Install

pip install --upgrade deepagents-graph-memory

Requires Python 3.11–3.14 on Linux or Apple Silicon Mac; see supported platforms. The graph database, OpenSSL, and search extension come bundled. No database server or separate search setup.

Quick start: VGS and VFS together

Use both together by default: filesystem tools handle working files and logs, while graph tools record findings and recall their connected context. The graph has no agent filesystem interface. For human review, save it to a .lbdb file and open a closed copy in a compatible Ladybug Explorer. See download and view the graph.

Set your model provider's API key, then choose temporary or persistent graph storage.

Temporary graph

The graph keeps context while the backend is open. Closing it or exiting the process discards the graph.

from deepagents import create_deep_agent

from deepagents_graph_memory import (
    GraphMemoryBackend,
    graph_context_middleware,
    graph_memory_tools,
)

graph = GraphMemoryBackend.create()

agent = create_deep_agent(
    model="google_genai:gemini-3.5-flash",
    tools=graph_memory_tools(graph),
    middleware=[graph_context_middleware()],
)

result = agent.invoke(
    {
        "messages": [
            {
                "role": "user",
                "content": "Investigate the parser failure and record what you find.",
            }
        ]
    }
)

print(result["messages"][-1].content)
graph.close()

Persistent graph

Supply a path to save the graph on disk, so later runs can reuse the same project's context. Closing the backend keeps the saved graph.

from deepagents import create_deep_agent

from deepagents_graph_memory import (
    GraphMemoryBackend,
    graph_context_middleware,
    graph_memory_tools,
)

graph = GraphMemoryBackend.create(path="project.lbdb")

agent = create_deep_agent(
    model="google_genai:gemini-3.5-flash",
    tools=graph_memory_tools(graph),
    middleware=[graph_context_middleware()],
)

result = agent.invoke(
    {
        "messages": [
            {
                "role": "user",
                "content": "Investigate the parser failure and record what you find.",
            }
        ]
    }
)

print(result["messages"][-1].content)
graph.close()

Choosing the database path

path names the database file, including its folder. Relative paths start from the directory where you run Python, which may differ from the script's folder.

Path Where the graph is saved
"project.lbdb" Your current working directory.
"data/project.lbdb" A data subfolder of that directory.
"../graph-data/project.lbdb" A graph-data folder one level above it.
"/data/project.lbdb" An absolute location, independent of your working directory.

The parent folder must exist and be writable. For example, replace the graph creation line with this to keep the database in your home folder, outside the repo:

from pathlib import Path

storage_dir = Path.home() / "graph-data"
storage_dir.mkdir(parents=True, exist_ok=True)

graph = GraphMemoryBackend.create(path=storage_dir / "project.lbdb")

Use Path("/your/storage/folder") instead of Path.home() / "graph-data" to choose another absolute location. Opening the same file reuses its saved context.

Azure and AWS storage

The simplest cloud setup is a Linux VM with a persistent disk:

Cloud Run the agent on Store the graph on
AWS EC2 Amazon EBS
Azure Azure Linux VM Azure Managed Disk

Mount the disk at /data, give the app write permission, and use:

graph = GraphMemoryBackend.create(path="/data/project.lbdb")

These disks should fit the filesystem-based design, but cloud deployments have not been tested here. Keep one process writing to each database.

For containers, AWS EFS and Azure Files provide mounted storage; database locking and recovery still need validation.

S3 and Azure Blob are backup options, not live database paths. Close the graph before uploading its database files, and download them to a filesystem before reopening. Your application handles uploads and downloads.

See the persistent storage guide for reopening saved graphs, reading previous context, and closing the database.

Keep the database on durable storage. VFS files have a separate lifetime; persist them with a file backend or a durable checkpointer.

The full guide covers deployment, shared agents, graph-only mode, and debugging. Agents choose what to record; the graph doesn't automatically verify their claims.

Report an issue · MIT license

Metadata

Release files for deepagents-graph-memory 0.2.0

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

Built distributions (wheels)

Table of built distributions (wheels) for deepagents-graph-memory 0.2.0
File
deepagents_graph_memory-0.2.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details
deepagents_graph_memory-0.2.0-cp314-cp314-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl CPython 3.14 CPython 3.14 Linux glibc 2.28+ ARM64, Linux glibc 2.26+ ARM64 Details
deepagents_graph_memory-0.2.0-cp314-cp314-macosx_15_0_arm64.whl CPython 3.14 CPython 3.14 macOS 15.0+ ARM64 Details
deepagents_graph_memory-0.2.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details
deepagents_graph_memory-0.2.0-cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl CPython 3.13 CPython 3.13 Linux glibc 2.28+ ARM64, Linux glibc 2.26+ ARM64 Details
deepagents_graph_memory-0.2.0-cp313-cp313-macosx_15_0_arm64.whl CPython 3.13 CPython 3.13 macOS 15.0+ ARM64 Details
deepagents_graph_memory-0.2.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details
deepagents_graph_memory-0.2.0-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl CPython 3.12 CPython 3.12 Linux glibc 2.28+ ARM64, Linux glibc 2.26+ ARM64 Details
deepagents_graph_memory-0.2.0-cp312-cp312-macosx_15_0_arm64.whl CPython 3.12 CPython 3.12 macOS 15.0+ ARM64 Details
deepagents_graph_memory-0.2.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details
deepagents_graph_memory-0.2.0-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ ARM64, Linux glibc 2.26+ ARM64 Details
deepagents_graph_memory-0.2.0-cp311-cp311-macosx_15_0_arm64.whl CPython 3.11 CPython 3.11 macOS 15.0+ ARM64 Details

Total release size: 127.3 MB

Release files / deepagents_graph_memory-0.2.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL deepagents_graph_memory-0.2.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 12.3 MB
Tags CPython 3.14 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
498f407dd652e9faab6e157b33e63bb0f82300ef2adb179e13e8881c7a6ddabb
BLAKE2b-256 checksum
How to use checksums
b0eb53cf1be886ab616a9bcf6b01a5704ac24408e32eb30afeb15eb627df5a0b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.

Transparency log

Release files / deepagents_graph_memory-0.2.0-cp314-cp314-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl

Download URL deepagents_graph_memory-0.2.0-cp314-cp314-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Size 11.6 MB
Tags CPython 3.14 Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
a604f9aa3906512280a6f8e64076e0f7d8e7476630239b6e9230b7b80f397cc5
BLAKE2b-256 checksum
How to use checksums
0b91499ae88c51b4ac9caffcd2e76466248b7ba875df88089fd44e5624920267
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.

Transparency log

Release files / deepagents_graph_memory-0.2.0-cp314-cp314-macosx_15_0_arm64.whl

Download URL deepagents_graph_memory-0.2.0-cp314-cp314-macosx_15_0_arm64.whl
Size 7.9 MB
Tags CPython 3.14 macOS 15.0+ ARM64
SHA-256 checksum
How to use checksums
621955359df750ef60509b73e2439952b1c3130b6d8fc316080739a2cb94d8fb
BLAKE2b-256 checksum
How to use checksums
91411bbf4e54363e56aa65c4e3919317a64c5365afb50f105e89c5343b107b8c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.

Transparency log

Release files / deepagents_graph_memory-0.2.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL deepagents_graph_memory-0.2.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 12.3 MB
Tags CPython 3.13 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
735c515cc95d7c735f06ff05d045a9f69bd19771bc242078a4c89f926b2b32a4
BLAKE2b-256 checksum
How to use checksums
615c2011a4e5ff2bc8addf03e5cd5bf612901194dadff891f0de6b82dee78534
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.

Transparency log

Release files / deepagents_graph_memory-0.2.0-cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl

Download URL deepagents_graph_memory-0.2.0-cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Size 11.6 MB
Tags CPython 3.13 Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
2cc02409736bd9d2a9b540b7006c1f80c74afb1e5c25ca94e0720e68c0af8242
BLAKE2b-256 checksum
How to use checksums
bece131c0f88aed8773099f3c4bd73641a91803dc128b0bb499ce1d6b8c53d1c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.

Transparency log

Release files / deepagents_graph_memory-0.2.0-cp313-cp313-macosx_15_0_arm64.whl

Download URL deepagents_graph_memory-0.2.0-cp313-cp313-macosx_15_0_arm64.whl
Size 7.9 MB
Tags CPython 3.13 macOS 15.0+ ARM64
SHA-256 checksum
How to use checksums
d90b8bb35b15341eb3a5863c5ab14096bb8ca5a3c6e255b24ffab965b7424a97
BLAKE2b-256 checksum
How to use checksums
ba41754cdd5e6bb23e1f7fc8368ca695363c20e8d5665abbd0d8203825054b30
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.

Transparency log

Release files / deepagents_graph_memory-0.2.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL deepagents_graph_memory-0.2.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 12.3 MB
Tags CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
153874486f637806a5133651b17a2574d352abc99e7ae3d4cac2001bc9abbf45
BLAKE2b-256 checksum
How to use checksums
70a17e228852a155810e1143643ce16fae35c28802a568da3df6b64e908a401c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.

Transparency log

Release files / deepagents_graph_memory-0.2.0-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl

Download URL deepagents_graph_memory-0.2.0-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Size 11.6 MB
Tags CPython 3.12 Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
97e313e5f7b4c67e2bca6174b460a26ad1c2a06ba23b630f86298822a1e946ca
BLAKE2b-256 checksum
How to use checksums
e25e9f17b23ab9dce3bb17c8e0044353e21849c2760e6439e9653d77417675c1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.

Transparency log

Release files / deepagents_graph_memory-0.2.0-cp312-cp312-macosx_15_0_arm64.whl

Download URL deepagents_graph_memory-0.2.0-cp312-cp312-macosx_15_0_arm64.whl
Size 7.9 MB
Tags CPython 3.12 macOS 15.0+ ARM64
SHA-256 checksum
How to use checksums
b3527d79e816938443e81f710f25e0cea1d68052987033b799636882461ebc66
BLAKE2b-256 checksum
How to use checksums
6357cffa4a7660758b61d5cd635a7e4fb697622e70d503b9418d34c536fe5024
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.

Transparency log

Release files / deepagents_graph_memory-0.2.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL deepagents_graph_memory-0.2.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 12.3 MB
Tags CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
8258438a3e26637a16a4c0c47ece59b0126bcd4a73c2838eb53eb0552d6c3ed1
BLAKE2b-256 checksum
How to use checksums
233754e57765e8f20d5e4d22b8f0bd45a0a311036b0b83cf43ff1ecde74655dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.

Transparency log

Release files / deepagents_graph_memory-0.2.0-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl

Download URL deepagents_graph_memory-0.2.0-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Size 11.6 MB
Tags CPython 3.11 Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
c0c9ee64c6ba34be8062f479df2de7550f44b43eb51039c14f4d83582356669f
BLAKE2b-256 checksum
How to use checksums
6e87f0c88ab47ccc5e10906df6b2b802beb3173dea440f373f865f898fccf028
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.

Transparency log

Release files / deepagents_graph_memory-0.2.0-cp311-cp311-macosx_15_0_arm64.whl

Download URL deepagents_graph_memory-0.2.0-cp311-cp311-macosx_15_0_arm64.whl
Size 7.9 MB
Tags CPython 3.11 macOS 15.0+ ARM64
SHA-256 checksum
How to use checksums
e4bc7fc1b700d3d4a6128f27ddf09e853764bf08600a2b879fd9b607d8d18477
BLAKE2b-256 checksum
How to use checksums
10e17115f040b56aba0331c369e956523e729979f8c9ef9458c27db4ce640647
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.0 This release

12 release files

0.1.8

12 release files

0.1.7

20 release files

0.1.6

20 release files

0.1.5

20 release files

0.1.4

20 release files

0.1.3

20 release files

0.1.2

20 release files

0.1.1

20 release files

0.1.0

2 release files

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