Building a Graph PoC using Agents: a case study (part 1 - the setup)
Step by step output of using agents to build a graph proof of concept. Part 1 sets up the process.
GenAI isn't just good for writing code. It is also very useful for building data models. In Zero to Operational for Amazon Neptune using Agentic AI , I discuss a series of agents used to go from a simple topic statement about a workload to a functioning proof of concept complete with sample data. By early March 2026, working sample code of agents should be available (will add a link when it is published). In this series, I will walk through a full use case demonstrating not only the outcomes, but trace how the agents adapted to issues along the way to get those outcomes. The workload I'll use is based on a workshop I did at The Knowledge Graph Conference '25 : designing a walking tour of tourist attractions.
First, remember that security is job zero at AWS. That means the first thing I am going to do is limit these agents to have the least privilege they need to do their job. I do this by creating a specific IAM role containing only these permissions:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "BedrockAccess",
"Effect": "Allow",
"Action": [
"bedrock:InvokeModel",
"bedrock:InvokeModelWithResponseStream"
],
"Resource": [
"arn:aws:bedrock:*::foundation-model/anthropic.claude-*",
"arn:aws:bedrock:*::inference-profile/*"
]
},
{
"Sid": "NeptuneAccess",
"Effect": "Allow",
"Action": [
"neptune-db:connect",
"neptune-db:ReadDataViaQuery",
"neptune-db:WriteDataViaQuery",
"neptune-db:GetEngineStatus",
"neptune-db:GetGraphSummary"
],
"Resource": "arn:aws:neptune-db:REGION:ACCOUNT_ID:cluster-CLUSTER_ID/*"
}
]
}The agents only have access to Bedrock (specifically Anthropic Claude models) and to connect to our Neptune cluster with read/write permissions (plus a couple other read permissions I'll explain as we go).
The AWS credentials I provide to the agents will be scoped by assuming this role using the CLI command
aws sts assume-role --role-arn {arn} --role-session-name {any session name you like} and supplying those credentials in a .env file.Now we can get started with our Use Case Generator Agent . If I am using the code base (soon to be provided) and Kiro CLI , I can simply use the command
@generate-usecase to have the LLM guide me into providing a short description of my use case. When it asks me, I tell it Create trip plans for walking tours of cities . Kiro will use this as input to the agent workflow. This task is very simple, performing a single round trip call to the LLM and producing the following use case document.<use_case>
Create trip plans for walking tours of cities
</use_case>
<response>
Walking tour planning involves complex spatial and categorical relationships
between points of interest (POIs), streets, neighborhoods, and visitor
preferences. A graph database excels at modeling cities as interconnected
networks where nodes represent locations (museums, restaurants, parks,
historical sites) and edges represent walking paths with properties like
distance, elevation, accessibility, and estimated walking time. The challenge
lies in finding optimal routes that maximize visitor satisfaction while
respecting constraints like time, physical difficulty, and opening hours.
Traditional databases struggle with the multi-criteria pathfinding needed to
create personalized itineraries that flow naturally through city streets while
considering factors like "must-see" attractions, cuisine preferences, and
avoiding backtracking. Graph databases can efficiently calculate weighted paths,
suggest alternative routes when attractions are closed, and discover hidden gems
along the way based on similarity to visited locations.
Questions:
- What is the optimal walking route that visits 5 historical landmarks within 3
hours while minimizing elevation changes and including a lunch stop?
- Which lesser-known attractions are located along the path between two popular
tourist destinations and match a visitor's interest in art galleries?
- How can a multi-day itinerary be optimized to minimize repeated walking
through the same neighborhoods while covering all requested POI categories?
</response>Maybe it is a little verbose, but let's go with it. After it produces the output, Kiro hints to us that we should review and edit it, and when we are ready use the next prompt
@generate-model . We'll cover that in Part 2 .Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article