How-To Guides
Practical guides for accomplishing specific tasks with neo4j-agent-memory.
How-to guides are task-oriented. They take you through the steps required to solve a real-world problem. They assume you already know the basics and focus on building your context graph—the personalized knowledge structure that makes your agents intelligent.
Deployment & Backend
Decide how to run agent memory: hosted service or self-hosted Neo4j.
| Guide | What You’ll Accomplish |
|---|---|
Run agent memory with zero infrastructure. Get an API key, point |
|
Port an existing self-hosted deployment to the hosted service. Includes the full |
|
Use |
Multi-Agent Patterns
When two or more agents share a memory graph — whether across languages, frameworks, or services.
| Guide | What You’ll Accomplish |
|---|---|
Cross-Agent Memory Sharing (concept) |
Understand the conversation-vs-entity namespace split, how Python and TypeScript agents share the same graph, and the typical multi-agent architecture. |
The per-user scoping primitive that keeps tenants isolated on a shared backend. |
|
Query |
|
Expose the memory surface as MCP tools so any MCP-aware agent (Claude Desktop, Cursor, custom dispatchers) shares the same graph. |
Core Context Graph Operations
Build and query your context graph—the foundation for personalized agent interactions.
| Guide | What You’ll Accomplish |
|---|---|
Add messages to conversations, search by semantic similarity, manage sessions, build conversation context. |
|
Create, update, and query entities in your context graph. Link entities to messages. Build relationship networks. |
|
Store and retrieve user preferences. Personalize agent responses. Learn from user behavior. |
|
Capture agent reasoning steps and tool calls. Learn from past successes. Improve agent decisions over time. |
Entity Extraction & Knowledge Building
Automatically extract entities and relationships to populate your context graph from conversations and documents.
| Guide | What You’ll Accomplish |
|---|---|
Layer agent memory on top of a graph that already exists in production. Attach the |
|
Set up spaCy, GLiNER, or LLM extractors. Create custom domain schemas for financial services, ecommerce, or any industry. Build multi-stage pipelines. |
|
Use spaCy/GLiNER-only extraction with |
|
Extract entities from large document collections efficiently. Handle streaming for long documents. Import product catalogs or financial reports. |
|
Configure automatic deduplication. Review and merge flagged duplicates. Maintain a clean context graph. |
|
Enable Location Geocoding (coming soon) |
Add coordinates to location entities. Query locations by proximity. Build location-aware context. |
Enrich Entities with External Data (coming soon) |
Add Wikipedia descriptions and images to entities automatically. Enhance your context graph with external knowledge. |
Agent Framework Integrations
Connect neo4j-agent-memory to popular agent frameworks for persistent, shared context graphs.
| Guide | What You’ll Accomplish |
|---|---|
Integrate memory as a PydanticAI dependency. Create memory-enabled tools. Build shopping assistants and financial advisors. |
|
Implement custom chat message history. Create context graph tools. Add callbacks for reasoning traces. |
|
Build context-aware retrievers combining documents and graph knowledge. Create RAG applications with persistent memory. |
|
Share context graphs across multiple agents. Build collaborative multi-agent systems with persistent shared memory. |
|
Connect Claude Desktop to scaffolded projects. Query domain-specific knowledge graphs through natural conversation. |
TypeScript SDK (@neo4j-labs/agent-memory)
The TypeScript SDK targets the hosted NAMS service. It runs on Node 20+, Bun, Deno, Cloudflare Workers, and Vercel Edge.
| Guide | What You’ll Accomplish |
|---|---|
API key handling, OAuth refresh, scope management for the TypeScript SDK. |
|
Run agent memory on Cloudflare Workers or Vercel Edge — the |
|
Three-tier context injection + automatic persistence as a |
|
Wire the standard 12-tool memory surface into Claude Desktop, Cursor, or any MCP-aware client. |
|
|
|
|
|
Session storage + conversation manager + reasoning hooks for the Strands JS SDK. |
|
Request/response logging, request-id correlation, OpenTelemetry-compatible event stream. |
|
The TS exception hierarchy, retry policy, and request-id propagation. |
|
Common failure modes and how to diagnose them. |
Enterprise Use Cases
These guides include examples for common enterprise scenarios:
-
Financial Services: Client profiles, portfolio analysis, compliance tracking, advisory recommendations
-
Ecommerce Retail: Customer preferences, product recommendations, purchase history, personalized shopping
How-To Guide Philosophy
Each guide follows a consistent structure:
-
Goal: What you’ll accomplish (one sentence)
-
Prerequisites: What you need before starting
-
Steps: Numbered, actionable instructions
-
Verification: How to confirm it worked
-
See Also: Related guides and reference material
If you’re new to neo4j-agent-memory, start with the Tutorials first.
For understanding the concepts behind these operations, see the Explanation section.
For complete API details and configuration options, see the Reference section.