Skip to content

samples: add AgentMemory (Neo4j-agent memory reimplemented in NET ) shopping assistant sample#7096

Open
joslat wants to merge 2 commits into
microsoft:mainfrom
joslat:neo4j/shopping-assistant-sample
Open

samples: add AgentMemory (Neo4j-agent memory reimplemented in NET ) shopping assistant sample#7096
joslat wants to merge 2 commits into
microsoft:mainfrom
joslat:neo4j/shopping-assistant-sample

Conversation

@joslat

@joslat joslat commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Summary

AgentMemory is a native .NET reimplementation of the graph-native agent memory, inspired by Neo4j Agent Memory and verified against its compatibility kit.

It:

  • Adds a .NET shopping-assistant sample to dotnet/samples/02-agents/AgentWithMemory/AgentWithMemory_Step06_MemoryUsingAgentMemory, following that folder's naming/README/solution conventions (AgentWithMemory_StepNN_...).
  • Demonstrates the AgentMemory library's Microsoft Agent Framework adapter (Neo4jMemoryContextProvider, MemoryToolFactory) for durable, graph-backed memory: the agent learns a shopper's preferences and recommends products via Neo4j graph traversal, with memory persisting across brand-new sessions.
  • Ships as a standalone sample: it consumes the published AgentMemory NuGet packages (which target Microsoft.Agents.AI 1.9.0) rather than this repo's source projects, so it targets net9.0 with explicit package versions. Empty Directory.Build.props/Directory.Build.targets markers keep it isolated from the repo's net10.0 / Central-Package-Management build (verified it restores/builds cleanly in isolation).
  • Registered in the CI sample-verification list (eng/verify-samples/AgentsSamples.cs) with a SkipReason, matching the existing Mem0 sample, since it requires a live Neo4j instance.
  • Named around "AgentMemory" (the library) rather than "Neo4j" the company/product, since this is a community .NET port and not an officially recognized Neo4j integration — Neo4j is still referenced where it's a genuine technical detail (the graph backing store, env vars, Cypher).

Test plan

  • dotnet build succeeds for the new project in isolation (confirmed Directory.Build.props/targets markers correctly block inheritance of the repo's net10.0/CPM settings — TargetFrameworks, TreatWarningsAsErrors evaluate empty/false as expected).
  • Manual run against a real Neo4j instance + Azure OpenAI/Foundry deployment (requires external services not available in this environment).

joslat and others added 2 commits July 13, 2026 22:48
…ory 1.0.1)

The .NET port of the official Neo4j Agent Memory "retail assistant" example
(neo4j-labs/agent-memory examples/microsoft_agent_retail_assistant, referenced
from the Learn integration page), which is currently Python-only.

Wires Neo4jMemoryContextProvider (AIContextProvider), MemoryToolFactory
memory tools, and a ProductCatalog of retail tools over a Neo4j :Product
graph, via the published AgentMemory + AgentMemory.AgentFramework 1.0.1
NuGet packages.

Lives at the repo root rather than under dotnet/samples/: that tree is
.NET 10 + Central Package Management + Microsoft.Agents.AI ~1.13 with
source ProjectReferences, while AgentMemory currently targets net9.0 +
Microsoft.Agents.AI 1.9.0. A repo-native version needs AgentMemory bumped
to track the newer Agents.AI/Extensions.AI line first. Cross-linked from
dotnet/samples/02-agents/AgentWithMemory/README.md as a "See also" entry,
same pattern already used for the cross-folder Custom Memory Implementation
link.

Verified: dotnet build succeeds (0 warnings, 0 errors) against the published
packages, proving the AgentMemory public surface is package-consumable.
Matches sibling AgentWithMemory samples' conventions (BOM + copyright file
header on .cs files, README sections: Features Demonstrated / Prerequisites
/ Environment Variables / Run the Sample / Expected Output).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Relocates the standalone shopping-assistant sample from the repo root into
dotnet/samples/02-agents/AgentWithMemory/AgentWithMemory_Step06_MemoryUsingAgentMemory,
following that folder's naming/README/solution conventions. Renames its identity
from "Neo4j" to "AgentMemory" (the library it actually demonstrates) since this
is a community .NET port, not an officially recognized Neo4j integration - Neo4j
is still referenced where it's a genuine technical detail (the graph backing
store, env vars, Cypher). Adds empty Directory.Build.props/targets markers so it
stays isolated from the repo's net10.0/CPM build, and registers it (skipped, like
the Mem0 sample) in the CI sample-verification list since it needs a live Neo4j
instance.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 13, 2026 21:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@giles17 giles17 added documentation Usage: [Issues, PRs], Target: documentation in the code base and learn docs .NET Usage: [Issues, PRs], Target: .Net labels Jul 13, 2026
@github-actions github-actions Bot changed the title samples: add AgentMemory (Neo4j-backed) shopping assistant sample .NET: samples: add AgentMemory (Neo4j-backed) shopping assistant sample Jul 13, 2026
@joslat joslat changed the title .NET: samples: add AgentMemory (Neo4j-backed) shopping assistant sample samples: add AgentMemory (Neo4j-agent memory reimplemented in NET ) shopping assistant sample Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Usage: [Issues, PRs], Target: documentation in the code base and learn docs .NET Usage: [Issues, PRs], Target: .Net

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants