Python SDK
The Python SDK connects directly to Neo4j over Bolt or to NAMS over HTTP. Supported methods, result shapes and data scope differ; see backend capabilities.
|
Neo4j Labs project This project is part of Neo4j Labs and is actively maintained, but not officially supported. There are no SLAs or guarantees around backwards compatibility and deprecation. For questions and support, please use the Neo4j Community Forum. |
Install Python 0.7.0
These Python examples use the published neo4j-agent-memory==0.7.0 package.
Use Python 3.10 or later and install the extras needed by the selected backend
and provider. For hosted NAMS memory:
python -m pip install 'neo4j-agent-memory[nams]==0.7.0'
For Aura with OpenAI embeddings, use
python -m pip install 'neo4j-agent-memory[openai]==0.7.0'.
Install the named provider/framework extra; [all] does not include every
local model dependency. The linked tutorials include virtual-environment setup.
Each Python lesson displays its complete programs and helper modules with labelled filenames. Create the lesson folder, save those files locally, and install the SDK from PyPI. A repository clone is needed for SDK development; these Python lessons require neither a clone nor a code download.
Optional extras
Each extra adds the dependencies for one provider, integration or tool.
Combine them in one install, for example
python -m pip install 'neo4j-agent-memory[openai,cli]==0.7.0'.
| Extras | Enables |
|---|---|
|
The hosted NAMS backend (HTTP client). |
|
Native model adapters for OpenAI, Anthropic, Amazon Bedrock and Vertex AI, and the LiteLLM fallback for other providers. |
|
Local embeddings, used by the keyless tutorials. |
|
Local entity extraction with spaCy, GLiNER2.5 ( |
|
An Instructor-backed structured extractor for LLM entity extraction. |
|
RapidFuzz string matching for entity resolution and deduplication. |
|
Framework integrations. |
|
The |
|
The MCP server started with |
|
Tracing providers for |
|
|
The spaCy extractor also needs a language model:
python -m spacy download en_core_web_sm.
Quick start
Choose one complete lesson with setup, named files and observable verification:
A complete lesson is the maintained starting point. A constructor change alone does not migrate data, configure every provider or guarantee backend parity.
Source and releases
-
Package: neo4j-agent-memory on PyPI
-
Source: neo4j-labs/agent-memory
-
Release tags:
python-v*; changelog
Looking for the TypeScript SDK?
See TypeScript SDK. Python and TypeScript applications can share supported NAMS data in the same authorized workspace. This does not imply identical local APIs or automatic cross-process conversation recall.
Runnable examples
The examples directory contains small scripts, framework integrations and full applications. The tutorial and how-to pages display complete documentation recipes; larger applications have their own README dependencies and backend requirements. Application test fakes do not establish hosted service support for every demonstrated business operation.