Skip to content

Add Neo4j GraphRAG samples#4994

Merged
westey-m merged 7 commits intomicrosoft:mainfrom
ltwlf:example/neo4j-graphrag-samples
Apr 1, 2026
Merged

Add Neo4j GraphRAG samples#4994
westey-m merged 7 commits intomicrosoft:mainfrom
ltwlf:example/neo4j-graphrag-samples

Conversation

@ltwlf
Copy link
Copy Markdown
Contributor

@ltwlf ltwlf commented Mar 31, 2026

Summary

  • add a runnable Neo4j GraphRAG Python sample under python/samples/02-agents/context_providers/neo4j_graphrag
  • add a runnable Neo4j GraphRAG .NET sample as AgentWithRAG_Step05_Neo4jGraphRAG
  • wire the new .NET sample into the RAG sample index and solution
  • use the published Neo4j.AgentFramework.GraphRAG and agent-framework-neo4j packages rather than repo-local integrations

Why

A previous Neo4j context-provider PR existed, but it was documentation-only

Validation

  • python3 -m py_compile python/samples/02-agents/context_providers/neo4j_graphrag/main.py
  • uv run /Users/ltwlf/Sources/ltwlf/agent-framework/python/samples/02-agents/context_providers/neo4j_graphrag/main.py
  • dotnet build dotnet/samples/02-agents/AgentWithRAG/AgentWithRAG_Step05_Neo4jGraphRAG/AgentWithRAG_Step05_Neo4jGraphRAG.csproj -c Debug
  • dotnet run --framework net10.0 --project dotnet/samples/02-agents/AgentWithRAG/AgentWithRAG_Step05_Neo4jGraphRAG/AgentWithRAG_Step05_Neo4jGraphRAG.csproj
  • fresh-cache restore for the .NET sample via NUGET_PACKAGES=$(mktemp -d) dotnet restore ... --configfile dotnet/nuget.config

Notes

  • Python sample follows the sample guidelines with PEP 723 inline dependencies so uv run works directly.
  • The live validation used a real Neo4j database plus Azure AI Foundry / Azure OpenAI resources.

@markwallace-microsoft markwallace-microsoft added documentation Improvements or additions to documentation python .NET labels Mar 31, 2026
@github-actions github-actions bot changed the title [codex] Add Neo4j GraphRAG samples Python: [codex] Add Neo4j GraphRAG samples Mar 31, 2026
@github-actions github-actions bot changed the title [codex] Add Neo4j GraphRAG samples .NET: [codex] Add Neo4j GraphRAG samples Mar 31, 2026
@ltwlf ltwlf changed the title .NET: [codex] Add Neo4j GraphRAG samples Add Neo4j GraphRAG samples Mar 31, 2026
@ltwlf ltwlf marked this pull request as ready for review March 31, 2026 13:47
Copilot AI review requested due to automatic review settings March 31, 2026 13:47
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds runnable Neo4j GraphRAG samples to both the Python and .NET sample sets, using the published Neo4j provider packages and wiring the new .NET sample into the existing AgentWithRAG sample lineup/solution.

Changes:

  • Add a Python Neo4j GraphRAG context-provider sample (neo4j_graphrag) runnable via uv run (PEP 723 inline deps).
  • Add a .NET Neo4j GraphRAG RAG sample project (AgentWithRAG_Step05_Neo4jGraphRAG) and include it in the AgentWithRAG index + solution.
  • Pin Neo4j sample package versions via central package management and exclude the Python sample from pyright sample configs.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
python/samples/02-agents/context_providers/neo4j_graphrag/README.md Documents the new Python Neo4j GraphRAG sample, prerequisites, and env vars.
python/samples/02-agents/context_providers/neo4j_graphrag/main.py Implements the runnable Python GraphRAG sample (Foundry chat client + Neo4j context provider).
python/pyrightconfig.samples.py310.json Excludes the new sample path from pyright sample checking.
python/pyrightconfig.samples.json Excludes the new sample path from pyright sample checking.
dotnet/samples/02-agents/AgentWithRAG/README.md Adds the Neo4j GraphRAG sample entry to the AgentWithRAG index.
dotnet/samples/02-agents/AgentWithRAG/AgentWithRAG_Step05_Neo4jGraphRAG/README.md Documents the new .NET Neo4j GraphRAG sample setup and run steps.
dotnet/samples/02-agents/AgentWithRAG/AgentWithRAG_Step05_Neo4jGraphRAG/Program.cs Implements the .NET GraphRAG sample (Azure OpenAI + Neo4j provider).
dotnet/samples/02-agents/AgentWithRAG/AgentWithRAG_Step05_Neo4jGraphRAG/AgentWithRAG_Step05_Neo4jGraphRAG.csproj Defines the new sample project and its package references.
dotnet/Directory.Packages.props Adds centrally-managed versions for Neo4j packages used by the sample.
dotnet/agent-framework-dotnet.slnx Adds the new sample project to the solution index.

Copy link
Copy Markdown
Member

@eavanvalkenburg eavanvalkenburg left a comment

Choose a reason for hiding this comment

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

couple of notes on the python version, nothing major

@westey-m westey-m self-requested a review March 31, 2026 16:48
Copy link
Copy Markdown
Member

@eavanvalkenburg eavanvalkenburg left a comment

Choose a reason for hiding this comment

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

the python side looks good, thanks @ltwlf one note on the neo4j package, we have embedding clients in MAF as well, could be reused in your package.

@westey-m westey-m enabled auto-merge April 1, 2026 10:04
@westey-m westey-m added this pull request to the merge queue Apr 1, 2026
Merged via the queue into microsoft:main with commit 3432984 Apr 1, 2026
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation .NET python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants