-
Neo4j Database: Install and run Neo4j locally or use Neo4j Aura
- Default connection:
bolt://localhost:7687 - Default credentials:
neo4j/password(change inbuild_env.py)
- Default connection:
-
Ollama: Install and run Ollama with a compatible model
- Install from: https://ollama.ai
- Default model:
llama2(can be changed inOllamaClient) - Ensure Ollama is running on
http://localhost:11434
pip install -r requirements.txtfrom build_env import Neo4jEnvironmentBuilder
# Initialize builder
builder = Neo4jEnvironmentBuilder(
uri="bolt://localhost:7687",
user="neo4j",
password="your_password"
)
# Generate and build a single scenario
actions, transactions = builder.generate_and_build_scenario()
# Generate multiple scenarios
scenarios = builder.generate_multiple_scenarios(10)
# Don't forget to close the connection
builder.close()python build_env.py-
:Actor - People and fraudsters
- Properties:
name,role(victim, fraudster)
- Properties:
-
:Account - Bank accounts
- Properties:
name,owner,bank,balance
- Properties:
-
:Institution - Banks, telecoms, merchants, government
- Properties:
name,type(bank, telecom, merchant, government)
- Properties:
-
:ActionType - Types of actions
- Properties:
name(e.g., phishing, impersonation, sim_swap, credential_submission)
- Properties:
-
:Channel - Communication channels
- Properties:
name(e.g., email, sms, call, app, website)
- Properties:
(a:Actor)-[:OWNS]->(acc:Account)(acc:Account)-[:HELD_AT]->(i:Institution {type:"bank"})(fraud:Actor)-[:USES_ACTION]->(t:ActionType)(victim:Actor)-[:RESPONDS_WITH]->(t:ActionType)(optional)(t:ActionType)-[:COMMON_CHANNEL]->(c:Channel)
The system generates sequences in two formats:
-
Action Sequences:
Action(entity1, action, entity2, channel)- Example:
Action(John Smith, phishing, Alice Brown, email)
- Example:
-
Transaction Sequences:
Transaction(entity1, action, entity2, amount)- Example:
Transaction(John Smith, transfer, ACC-1234, 5000.00)
- Example:
- Ollama Model: Change
self.modelinOllamaClient.__init__() - Ollama URL: Change
base_urlparameter inOllamaClient.__init__() - Neo4j Connection: Update URI, user, and password in
main()or when creatingNeo4jEnvironmentBuilder