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.

Core Context Graph Operations

Build and query your context graph—the foundation for personalized agent interactions.

Guide What You’ll Accomplish

Store and Search Messages

Add messages to conversations, search by semantic similarity, manage sessions, build conversation context.

Work with Entities

Create, update, and query entities in your context graph. Link entities to messages. Build relationship networks.

Manage User Preferences

Store and retrieve user preferences. Personalize agent responses. Learn from user behavior.

Record Reasoning Traces

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

Configure Entity Extraction

Set up spaCy, GLiNER, or LLM extractors. Create custom domain schemas for financial services, ecommerce, or any industry. Build multi-stage pipelines.

Process Documents in Batch

Extract entities from large document collections efficiently. Handle streaming for long documents. Import product catalogs or financial reports.

Handle Duplicate Entities

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

Use with PydanticAI

Integrate memory as a PydanticAI dependency. Create memory-enabled tools. Build shopping assistants and financial advisors.

Use with LangChain

Implement custom chat message history. Create context graph tools. Add callbacks for reasoning traces.

Use with LlamaIndex

Build context-aware retrievers combining documents and graph knowledge. Create RAG applications with persistent memory.

Use with CrewAI

Share context graphs across multiple agents. Build collaborative multi-agent systems with persistent shared memory.

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:

  1. Goal: What you’ll accomplish (one sentence)

  2. Prerequisites: What you need before starting

  3. Steps: Numbered, actionable instructions

  4. Verification: How to confirm it worked

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