This is a companion project to the deeplearning.ai short course on agentic knowledge graph construction.
The course is notebook-based, walking through the key concepts of building a multi-agent system. This project is that system.
Features:
- a multi-agent system for constructing knowledge graphs
- meant as a reference implementation for learning and experimentation, not a production tool
- built on top of Google ADK
- interacts with a local Neo4j database
- rich with opportunities for improvement :)
These steps assume you have uv installed and Python 3.12 available.
- Install uv: see uv getting started
- Create a virtual environment and install dependencies with uv:
uv venv
uv sync
- Copy
.env.exampleto.envand adjust as needed OPENAI_API_KEY=sk-...(optional)NEO4J_DSN=bolt://neo4j:secret@localhost:7687/neo4j
The local Neo4j database must have access to files in the import directory. If you're unsure where that is,
you can run the multi_agent and ask it "Where is the import directory?" Copy the sample files there.
There are some example data files under data.
Google ADK include a great devtool that can launch a web interface for the agent.
adk web src/agentic_kg/coordinators/
This will discover the available "coordinators" or top-level agents. There are two:
single_agent- uses a single sub-agent that can interace with Neo4j directlymulti_agent- has a hiearchy of specialized sub-agents to collaborate with a user through multiple phases
- this coordinator can answer basic questions about the environment, like "Is Neo4j ready?" and "Where is the import directory?"
user_intent_agent- ideates on the kind of graph and purpose of the graphfile_suggestion_agent- recommends files to use as inputschema_proposal_agent- proposes a construction plan for making a graph from the files which supports the user goalgraph_construction_agent- does the work of building the graph
There are minimal pytests available.
- Unit tests (fast, no Docker required):
uv run pytest -q
- Integration tests (Neo4j via Testcontainers; requires Docker running):
uv run pytest -q -m integration
- many agents use a special
finishedtool to signal that they're done
- add the unstructured data import workflow
- evals! evals! evals!
- add multiple GraphRAG tools
- add handling of field types
- improve
llm_catalogmodel selection - add hypothetical questions to user goal, which should be used to validate the constructed graph and guide GraphRAG retrievers
Special thanks to everyone who worked on the deeplearning course and helped develop and inspire this project.
Particular shout-outs to:
- Hawraa Salami of deeplearning.ai for her guidance and support in developing the course
- Andrew Ng of deeplearning.ai for raising everyone's game with Deeplearning.ai
- Adam Cowley of Neo4j for his inspiring work on GraphAcademy
- Martin O'Hanlon for his clear, methodical and friendly approach to teaching
- Neo4j for letting me work on this project :)