db620d33df
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
dotnet-build-and-test / dotnet-test-functions (push) Has been cancelled
dotnet-build-and-test / paths-filter (push) Has been cancelled
dotnet-build-and-test / dotnet-build (Debug, windows-latest, net9.0) (push) Has been cancelled
dotnet-build-and-test / dotnet-build (Release, ubuntu-latest, net10.0) (push) Has been cancelled
dotnet-build-and-test / dotnet-build (Release, ubuntu-latest, net8.0) (push) Has been cancelled
dotnet-build-and-test / dotnet-build (Release, windows-latest, net472) (push) Has been cancelled
dotnet-build-and-test / dotnet-test (Release, integration, true, ubuntu-latest, net10.0) (push) Has been cancelled
dotnet-build-and-test / dotnet-test (Release, integration, true, windows-latest, net472) (push) Has been cancelled
dotnet-build-and-test / dotnet-foundry-hosted-it (push) Has been cancelled
dotnet-build-and-test / dotnet-build-and-test-check (push) Has been cancelled
dotnet-build-and-test / Integration Test Report (push) Has been cancelled
1.7 KiB
1.7 KiB
Neo4j GraphRAG Context Provider
The Neo4j GraphRAG context provider adds read-only retrieval from a Neo4j knowledge graph to an Agent Framework agent. It supports vector, fulltext, and hybrid retrieval, and can enrich search results by traversing graph relationships with a Cypher retrieval_query.
This sample keeps setup lightweight by using a pre-built Neo4j fulltext index plus a graph-enrichment query.
For full documentation, see the Neo4j GraphRAG integration guide on Microsoft Learn.
Example
| File | Description |
|---|---|
main.py |
Runnable GraphRAG sample using a Neo4j fulltext index and a Cypher enrichment query to surface related companies, products, and risk factors. |
Prerequisites
- A Neo4j database with document chunks already loaded
- A Neo4j fulltext index over chunk text, such as
search_chunks - An Azure AI Foundry project endpoint and chat deployment
- Azure CLI authentication via
az login
Environment variables
This sample expects:
FOUNDRY_PROJECT_ENDPOINTFOUNDRY_MODELNEO4J_URINEO4J_USERNAMENEO4J_PASSWORDNEO4J_FULLTEXT_INDEX_NAME(optional, defaults tosearch_chunks)
Run with uv
From the python/ directory:
uv run samples/05-end-to-end/neo4j_graphrag/main.py
Notes
- This sample uses the published
agent-framework-neo4jpackage rather than code from this repository. - The package also supports vector and hybrid retrieval when you configure embeddings and indexes in Neo4j.
- For memory-oriented scenarios, the Neo4j project also maintains companion examples in the external provider repository.