How-to guides
Choose the task you need to complete. Check its backend and prerequisites before running commands. For a first guided exercise, start with a tutorial; for signatures and defaults, use reference.
These guides are grouped the way the sidebar groups them, so a section heading here matches the sidebar category it belongs to.
Pluggable providers
-
Bring your own model — Wire a custom LLM or embedding provider into
MemoryClientwithout waiting on a built-in integration. -
Configure an LLM provider — Point extraction and reasoning at OpenAI, Anthropic, Vertex AI, Bedrock, or another supported provider.
-
Configure an embedding provider — Choose and configure the embedder used for entity resolution and semantic search.
-
Migrate to pluggable providers — Move an existing client from the legacy hard-coded provider setup to the pluggable provider API.
-
Migrate to a new embedding model — Re-embed stored memory after switching embedding models or dimensions.
Hosted backend
-
Connect a Python application to NAMS — Authenticate and issue reads and writes against the hosted Neo4j Agent Memory Service.
-
Migrate a Python application to NAMS — Inventory unsupported operations, replace them, and verify a self-hosted Bolt application against a NAMS sandbox workspace.
-
Activate and verify a workspace ontology — Clone a template, activate a strict version for a NAMS workspace, and verify the active binding.
-
Share team memory with an editor — Connect an editor’s MCP client to a shared NAMS workspace for team-wide memory.
Core operations
-
Store, retrieve, and summarize messages — Add conversation turns to short-term memory and read them back in order.
-
Store entities, relationships, and facts — Create POLE+O entities, link them with typed relationships, and record facts.
-
Store and revise a user preference — Record a preference, then update or supersede it as the user’s stated preference changes.
-
Merge a reviewed entity pair — Merge a known duplicate pair and verify its aliases; review flagged
SAME_AScandidates withreview_duplicate.
Entity extraction
-
Extract and inspect entity candidates — Run the extraction pipeline over text and inspect the entities it finds.
-
Apply a custom entity extraction schema — Swap in a domain-specific GLiNER2.5 schema instead of the default POLE+O types.
-
Drive extraction from an ontology — Write a typed ontology, validate and compile it, activate it in the database, and store typed
RELATED_TOedges with provenance. -
Rename an ontology type and migrate a Bolt graph — Rename a type in a stored ontology and relabel the entities already extracted, with an inline
migrate. -
Tune entity resolution — Adjust the ingest-time resolver’s thresholds, per-type overrides, alias gazetteer, review band and tenant scope, then measure the change with B-cubed.
-
Account for batch and chunk extraction results — Reconcile entities extracted across batches or streamed document chunks.
-
Migrate to GLiNER2.5 — Move off the removed GLiNER v1 and GLiREL stack: extras, model ids, old-to-new code, output shape and the
RELATED_TObackfill.
Reasoning and audit
-
Record and verify a failed tool call — Start a reasoning trace, record a tool call outcome, and verify what was captured.
-
Audit reasoning with
:TOUCHEDedges — Query which entities a reasoning step touched using the:TOUCHEDaudit relationship.
Operational features
-
Associate memory with users and select scoped reads — Associate supported conversation, message, and preference writes with a user and use explicitly scoped reads; this is not access control.
-
Buffered (fire-and-forget) writes — Decouple the response path from Neo4j round-trips with a bounded write queue.
-
Memory consolidation — Run dry-runnable hygiene jobs that dedupe entities, summarize traces, and archive old conversations.
-
Adopt an existing domain graph — Attach the memory library’s schema to nodes from a pre-existing Neo4j graph.
-
Privacy and audit — Record explicit audit events after sensitive reads and mark old conversations for archival.
-
Evaluate memory quality — Run labelled regression cases against retrieval, audit, and preference quality.
-
Run without an LLM — Use local extractors and embedders without constructing an LLM provider or requiring an OpenAI key; the example still connects to Aura.
-
Process documents in batch — Extract and store entities from a corpus of documents in one pass.
Framework integrations
-
Agent framework integrations — Compare the available framework integrations and pick the one that fits your agent.
-
Use with LangChain — Wire
neo4j-agent-memoryinto a LangChain agent as memory and a retriever. -
Use with LlamaIndex — Use the package as a LlamaIndex memory backend.
-
Use with PydanticAI — Inject memory as a PydanticAI dependency and expose memory tools to the agent.
-
Use with CrewAI — Share memory across a CrewAI crew of agents.
-
Use with the OpenAI Agents SDK — Add memory and memory tools to an agent built with the OpenAI Agents SDK.
-
Use Vertex AI embeddings with Neo4j — Configure the Vertex AI embedder and size vector indexes for its output dimensions.
-
Use with Google ADK — Wire
Neo4jMemoryServiceinto a Google ADKRunnerfor agent memory. -
Use with Strands agents — Use the session manager and memory store tools with AWS Strands Agents.
-
Use Amazon Bedrock embeddings — Configure the Bedrock embedder as the client’s embedding provider.
-
Route memory searches with the hybrid provider — Route message, entity, and preference retrieval within a Neo4j-backed
MemoryClient. -
Use with Microsoft Agent Framework — Give a Microsoft Agent Framework
Agentretrieved Neo4j context and persist its turns through a context provider. -
Add an MCP server to a context graph project — Add the memory MCP server to an existing context-graph project.
TypeScript
-
TypeScript framework integrations — Compare the TypeScript SDK’s framework integrations and pick the one that fits your app.
-
Deploy to edge runtimes — Run the TypeScript client in edge runtimes such as Vercel Edge Functions and Cloudflare Workers.
-
Integrate with the Vercel AI SDK — Add memory to a Vercel AI SDK application’s chat loop.
-
Choose a NAMS AI provider mode — Compare the separate NAMS AI provider package’s four integration modes and pick the one that fits your app.
-
Wrap a model in provider mode — Swap your model for a NAMS-wrapped one so memory is retrieved and persisted automatically, with no tool calls.
-
Wrap a model in middleware mode — Wrap an existing model instance with automatic memory retrieval and persistence.
-
Expose memory as tools — Give the model explicit
query_memoryandstore_memorytools it decides when to call. -
Control memory with lifecycle hooks — Drive memory retrieval and persistence from application code with lifecycle hooks around every generation.
-
Build a Next.js chat app with a memory rail — Build a Next.js chat UI backed by NAMS memory, with a live memory sidebar.
-
Use the MCP tools — Register the SDK’s 12 memory tools on your own MCP server or dispatch them programmatically.
-
Integrate with LangChain JS — Wire the TypeScript client into a LangChain JS agent as memory.
-
Store Mastra threads in NAMS — Persist Mastra conversation threads in the hosted memory backend.
-
Integrate with AWS Strands Agents — Use the TypeScript client with AWS Strands Agents.
-
Enable request logging — Turn on request and response logging for the TypeScript client.
-
Authenticate a TypeScript client — Configure API key authentication for the TypeScript SDK against NAMS.
-
Handle TypeScript REST errors — Catch and handle the typed error classes the TypeScript client’s REST calls raise.
-
Troubleshooting — Diagnose common connection, authentication, and build issues with the TypeScript SDK.