The Scenario Data Generator Agent
Part of the Zero to Operational for Amazon Neptune using Agentic AI series. This agent generates data for complex query patterns in your Neptune cluster.
Agent Goals
The next agent in our workflow is the Scenario Data Generator Agent. Here we provide the agent with a detailed use case description, a connection to the Neptune cluster containing data, and an openCypher query.
Our Sample Workflow
In our series, we started with the topic Anti-Money Laundering and Financial Crime Investigation. The Use Case Generator Agent created this use case from that topic, which we did not edit and will use as-is. In our workflow, we execute each query directly against the
run_opencypher_query tool from the Neptune MCP Server and check if it has any results. We execute this agent for any query without results. In our scenario, the query for the first question Which accounts are participating in circular transaction patterns that could indicate layering activity in money laundering schemes? resulted in the query1
2
3
4
5
MATCH (a1:Account)<-[:TRANSFERS_FROM]-(t1:Transaction)-[:TRANSFERS_TO]->(a2:Account)<-[:TRANSFERS_FROM]-(t2:Transaction)-[:TRANSFERS_TO]->(a1)
WHERE a1.account_number <> a2.account_number
RETURN DISTINCT a1.account_number, a2.account_number, t1.amount, t2.amount, t1.timestamp, t2.timestamp
ORDER BY t1.timestamp DESC
LIMIT 10and didn't generate any results. Like the previous data generation agents, this agent inserts the data directly into Neptune and not in the output. However it does provide a human readable summary of what it did. In this instance
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
## Summary
I have successfully created comprehensive Anti-Money Laundering (AML) data in the Neptune graph database to support the circular transaction pattern detection query. Here's what was added:
### **Data Created:**
**1. Transactions (14 new transactions):**
- Created 14 sophisticated money laundering transactions with realistic amounts ranging from $92,000 to $850,000
- Used various transaction types including wire transfers, electronic transfers, target2 transfers, RTP transfers, and SWIFT transfers
- Set timestamps in January 2024 to create a clear timeline for investigation
- Included proper currency designations (USD, EUR, GBP)
**2. Accounts (3 new shell company accounts):**
- `ACC-ML-SHELL-001`: Offshore account owned by Global Ventures LLC
- `ACC-ML-SHELL-002`: Trust account owned by Apex Holdings Ltd (Flagged status)
- `ACC-ML-SHELL-003`: Business account owned by Diamond Trust Services
**3. Entities (3 new shell companies):**
- **Global Ventures LLC** (Cayman Islands) - Flagged as high-risk shell company
- **Apex Holdings Ltd** (British Virgin Islands) - High-risk shell company
- **Diamond Trust Services** (Seychelles) - Medium-risk shell company
**4. Circular Transaction Patterns:**
Created 7 distinct circular patterns showing money moving between account pairs and returning, which is indicative of layering activity in money laundering:
### **Key Patterns Created:**
1. **Large-scale offshore circular transfers**: $850K → $840K between shell company accounts
2. **Trust-to-business circular flows**: €425K → €420K between flagged trust and business accounts
3. **Multi-currency layering**: Various amounts in USD, EUR, and GBP
4. **Time-based patterns**: Transactions occurring within hours of each other, typical of rapid layering schemes
5. **Amount reduction patterns**: Slight reductions in return transfers to account for "fees" and make transactions appear legitimate
### **Query Results:**
The target query now successfully returns 10 circular transaction patterns, showing:
- Account pairs involved in circular transfers
- Transaction amounts showing typical money laundering reduction patterns
- Timestamps revealing rapid movement of funds
- Mix of existing and newly created shell company accounts
### **No Errors Occurred:**
All data was successfully added to Neptune without any errors. The query executes perfectly and returns realistic AML investigation results that would be typical in financial crime detection scenarios.
The data now supports comprehensive AML analysis including detection of layering schemes, shell company networks, and suspicious circular transaction patterns that are hallmarks of money laundering operations.Important notes:
- A human subject matter expert should review the output of this agent to ensure the data really does mimic the scenario described. Complex scenarios may result in more frequent hallucinations by the LLM and generate misleading data.
Agent Components
Let's look at the key components of the Scenario Data Generator agent. The prompts shown here were tested with Anthropic Claude 3.7 and 4.0.
System Prompt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
You specialize in generating graph data and adding it to a graph to provide results for a specific scenario given use case and query.
You will use the get_graph_schema tool to understand the schema of the graph.
You will use the run_opencypher_query tool for the following:
- to add data to the graph (in batches of 10 statements or more if possible)
- to query the data in the graph for purposes of understanding existing data
- finding existing nodes and edges to utilize in the scenario you are creating
Using the use case and model, generate realistic values for each of the nodes given the properties assigned for your label.
Add at least a few results for the scenario you are creating.
Use the run_opencypher_query tool to ensure the data you added does return results for the query. If it does not, try again.
Output a summary of the data you added to Neptune and report if any errors occurred. You do not need to output every statement.
# Data Rules
- If the field is a date or datetime, you must use the `datetime('YY-MM-DDTHH:mm:SSZ')` function. If it is just a date, then still use datetime with the time set to midnight like `datetime('2025-01-01T00:00:00Z')
- Use whitespace to separate statements in the batch. Do not use a semicolon.
# Node Output Format
WITH {!!list_of_properties!!} as properties MERGE (n:!!LABEL!! {`~id`: !!ID!!}) SET n += properties
!!LABEL!! is the label of the node specified in the model
!!list_of_properties!! is a JSON formatted list where each property is a key and each value is a realistic value for that property.
!!ID!! is a unique identifier across all of the output with the format `{node_label}_{unique identifier across all nodes}`
# Edge Output Format
WITH {!!list_of_properties!!} as properties MATCH (from {`~id`:!!FROM_NODE_ID}), (to {`~id`:!!TO_NODE_ID!!} MERGE (from)-[e:!!LABEL!! {`~id`:!!EDGE_ID!!}]->(to) SET e += properties
!!LABEL!! is the label of the edge specified in the model
!!list_of_properties!! is a JSON formatted list where each property is a key and each value is a realistic value for that property.
!!FROM_NODE_ID!! MUST match the ID of an existing node within the Neptune cluster and having a label matching the `from_label` property from the model. Run a query against the database to find an ID if you need to.
!!TO_NODE_ID!! MUST match the ID of an existing node within the Neptune cluster and having a label matching the `from_label` property from the model. Run a query against the database to find an ID if you need to.
!!EDGE_ID!! is a unique identifier across all of the output with the format `{edge_label}_{sequence of characters unique to all edges with this label}`Tools
Neptune MCP Server : get_graph_schema and run_opencypher_query tools
User Message Template
1
2
3
4
# Use Case Description
{use_case_description}
# Query Needing Data
{query}Costs
The example provided here resulted in 350,000 input tokens, 8,300 output tokens, 44,000 cache input read tokens, and 1,250 cache output read tokens. This would be a cost of approximately 1.20 USD.
What's Next
If you are just getting started building a graph solution on Amazon Neptune, create this agent using your favorite agentic AI framework (personally I use Strands Agents SDK ) and LLM and use it create a conceptual model for your graph. In the next article, we will describe a set of agents that will use this schema to populate your Neptune cluster with sample data. Have you implemented ways to improve this or have ideas on how to do so? Share them in the comments or reach out to me directly on LinkedIn .
Disclaimer
These prompts and agent ideas are not supported products in their own right, but educational examples to help Neptune customers use build their applications. Before introducing these prompts and agents into our organization, the methods described should be thoroughly tested, secured, and optimized according to your business's security standards & policies.
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article