neo4j-aura-agent-skill
Manages Neo4j Aura Agents via the v2beta1 REST API — create, list, get, update, delete,
- 0
- Installs
- —
- Rating
- —
- Success rate
- 10
- Files scanned
Security scan
Needs reviewSuspicious-but-common patterns. Skim the findings before installing.
- mediumReads credential files or secret env vars
scripts/fetch_schema.py:21
load_dotenv(Path(__file__).parent.parent / ".env")
Legitimate for some tools, but a skill touching secrets deserves a human look.
- mediumReads credential files or secret env vars
scripts/fetch_schema.py:70
sys.exit("ERROR: NEO4J_URI and NEO4J_PASSWORD must be set in .env or environment")Legitimate for some tools, but a skill touching secrets deserves a human look.
- mediumReads credential files or secret env vars
scripts/invoke_agent.py:17
load_dotenv(Path(__file__).parent.parent / ".env")
Legitimate for some tools, but a skill touching secrets deserves a human look.
- mediumReads credential files or secret env vars
scripts/invoke_agent.py:34
sys.exit("ERROR: AURA_CLIENT_ID and AURA_CLIENT_SECRET must be set in .env or environment")Legitimate for some tools, but a skill touching secrets deserves a human look.
- mediumReads credential files or secret env vars
scripts/invoke_agent.py:57
sys.exit(f"ERROR: {flag} required (or set {env} in .env)")Legitimate for some tools, but a skill touching secrets deserves a human look.
- mediumReads credential files or secret env vars
scripts/manage_agent.py:15
load_dotenv(Path(__file__).parent.parent / ".env")
Legitimate for some tools, but a skill touching secrets deserves a human look.
- mediumReads credential files or secret env vars
scripts/manage_agent.py:32
sys.exit("ERROR: AURA_CLIENT_ID and AURA_CLIENT_SECRET must be set in .env or environment")Legitimate for some tools, but a skill touching secrets deserves a human look.
- mediumReads credential files or secret env vars
scripts/manage_agent.py:142
sys.exit("ERROR: --org-id required (or set AURA_ORG_ID in .env)")Legitimate for some tools, but a skill touching secrets deserves a human look.
- mediumReads credential files or secret env vars
scripts/manage_agent.py:144
sys.exit("ERROR: --project-id required (or set AURA_PROJECT_ID in .env)")Legitimate for some tools, but a skill touching secrets deserves a human look.
- mediumReads credential files or secret env vars
scripts/manage_agent.py:148
sys.exit(f"ERROR: --agent-id required for {cmd} (or set AURA_AGENT_ID in .env)")Legitimate for some tools, but a skill touching secrets deserves a human look.
Content sha256 febac09d9c062267… — run codexguild_scan_skills after installing to verify your local copy.
Static analysis is a first line of defense, not a guarantee. Read the source
SKILL.md
When to Use
- Creating or configuring an Aura Agent on an existing AuraDB instance
- Adding/updating tools (CypherTemplate, SimilaritySearch, Text2Cypher) to an agent
- Deploying an agent for external access (REST API endpoint or MCP server)
- Invoking an agent with natural language queries via REST API
- Listing, reading, or deleting existing agents in a project
- Generating an evaluation dataset (JSON) to test an agent in the Aura console's Evaluation feature
When NOT to Use
- Creating/managing AuraDB instances →
neo4j-aura-provisioning-skill - Creating vector indexes →
neo4j-vector-index-skill - Running Cypher directly →
neo4j-cypher-skill - Building Aura Graph Analytics sessions →
neo4j-aura-graph-analytics-skill
What are Aura Agents
GraphRAG agents on top of AuraDB — answer natural language questions via three tool types:
- CypherTemplate — parameterized queries for predictable lookups
- SimilaritySearch — vector similarity search over a VECTOR index
- Text2Cypher — natural language → Cypher for aggregations and discovery
Expose your graph via natural language to users or apps without application code. Accessible as REST or MCP endpoint; single- and multi-turn. For full Cypher control, low-latency lookups, or direct writes — use neo4j-cypher-skill instead.
Prerequisites
- Running AuraDB instance with knowledge graph loaded
- "Generative AI assistance" enabled in Organization settings
- "Aura Agent" toggled on in the project
- "Tool authentication" enabled at project/Security level
- Project admin access
AURA_CLIENT_IDandAURA_CLIENT_SECRETfrom console.neo4j.io → Account Settings → API CredentialsAURA_ORG_ID,AURA_PROJECT_ID— see Step 2;AURA_INSTANCE_ID— resolved interactively in Step 2 if not already set- Python env:
uv syncin skill directory (orpip install neo4j neo4j-graphrag requests python-dotenv) .envandschema.jsonin.gitignore
Step 1 — Verify Auth
Manual credential verification only — scripts call get_token() internally.
TOKEN=$(curl -s --request POST 'https://api.neo4j.io/oauth/token' \
--user "${AURA_CLIENT_ID}:${AURA_CLIENT_SECRET}" \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=client_credentials' \
| jq -r '.access_token')
echo "Token: ${TOKEN:0:20}..."
If blank token: verify AURA_CLIENT_ID/AURA_CLIENT_SECRET in .env. Stop and report.
Token TTL: 3600 s. Re-run on 401/403.
Step 2 — Resolve Organization & Project IDs
From console URL (fastest): open console.neo4j.io → navigate to a project. URL pattern:
/organizations/{AURA_ORG_ID}/projects/{AURA_PROJECT_ID}
Programmatic fallback:
curl -s https://api.neo4j.io/v1/tenants \
-H "Authorization: Bearer $TOKEN" | jq '.data[] | {id, name}'
# tenant id maps to AURA_PROJECT_ID
Set in .env:
AURA_ORG_ID=<organization-id>
AURA_PROJECT_ID=<project-id>
Check AURA_INSTANCE_ID — if it is already set in .env, skip the rest of this step.
If not set, list available instances and ask the user to choose:
curl -s "https://api.neo4j.io/v1/instances?tenantId=${AURA_PROJECT_ID}" \
-H "Authorization: Bearer $TOKEN" \
| jq '.data[] | {id, name, status, region, type}'
Show output to user. Ask: "Which instance should the agent connect to?" Then write to .env:
AURA_INSTANCE_ID=<chosen-instance-id>
NEO4J_URI=neo4j+s://<chosen-instance-id>.databases.neo4j.io
If the list is empty: no AuraDB instances exist in this project — an Aura Agent cannot be created without one. Stop and report.
If 401: re-run Step 1. If 404: verify AURA_PROJECT_ID. Stop and report.
Step 3 — List Existing Agents
uv run python3 scripts/manage_agent.py list # Linux/macOS
uv run python scripts\manage_agent.py list # Windows
Output: agent IDs, names, enabled status, endpoint URLs.
If 401: re-run Step 1. If 404: verify AURA_ORG_ID/AURA_PROJECT_ID. Stop and report.
Step 4 — Fetch Graph Schema
Requires NEO4J_URI, NEO4J_USERNAME, NEO4J_PASSWORD in .env.
uv run python3 scripts/fetch_schema.py # Linux/macOS
uv run python scripts\fetch_schema.py # Windows
Saves schema.json. Output: node/rel-type counts, node labels + typed properties (with Aura data_type), relationship patterns, VECTOR indexes.
Data gate — script exits with error and does NOT write schema.json if:
- fewer than 2 nodes, OR
- zero relationship types
If gate fails: load data into the database before proceeding. Stop and report.
If ServiceUnavailable: check NEO4J_URI uses neo4j+s://; instance must be running. Stop and report.
If neo4j-graphrag not found: uv add neo4j-graphrag. Stop and report.
Read schema.json before Step 5.
Step 5 — Discover Use Cases
Before designing tools, read references/authoring-guide.md.
Take answers from request and schema; ask about gaps. Do NOT guess tool types or parameters.
- "What questions should this agent answer?"
- "Which nodes or relationships matter most?" — match against
schema.json → node_props - "Do users search by a specific property value?" → CypherTemplate
- "Any counting, grouping, or date-range questions?" → Text2Cypher
- "Search for semantically similar text?" → check
schema.json → metadata → vector_index- No VECTOR index found: inform user; skip SimilaritySearch; delegate to
neo4j-vector-index-skillfirst - VECTOR index found: provider/model from request, else ask ("Which embedding provider and model?"); supported models →
references/REFERENCE.md → Embedding Provider Options. Dimension from index (vector.dimensions). Do NOT guess provider/model.
- No VECTOR index found: inform user; skip SimilaritySearch; delegate to
Tool selection:
| Use Case | Tool |
|---|---|
| Lookup by specific property value | cypherTemplate |
| Semantic text search | similaritySearch |
| Aggregation, counting, open-ended | text2cypher |
CypherTemplate parameters: for each parameter, read aura_data_type from schema.json → node_props or rel_props and use it as data_type. If the property has low_cardinality: true, the parameter description should list the valid values — copy them from the values array in schema.json. Example: "description": "Agreement type to filter by. Valid values: \"Distributor Agreement\", \"License Agreement\", \"NDA\"". Properties with has_fulltext_index: true are especially likely to be filter targets and should include valid values when low cardinality.
SimilaritySearch configuration — values from request; dimension from index; ask about gaps; then draft tool config:
| Field | What to ask | Source |
|---|---|---|
provider | "openai" or "vertexai"? | Request, else user confirms |
model | Which model? | Request, else user picks from references/REFERENCE.md → Embedding Provider Options |
dimension | What output dimension? | Required if model is configurable (see table); fixed models use the table value |
index: use name from schema.json → metadata → vector_index where state = ONLINE. dimension must match vector.dimensions in the same index entry.
Signals inventory: for each label or relationship that appears in a tool or the user's stated questions, write a signal block in the system prompt. See references/authoring-guide.md → Signals inventory for the template and rules.
Draft config JSON → show to user for review → confirm → proceed to Step 6. Skip review if user said go ahead or request gives full config; state config, proceed.
Step 6 — Create Agent
Minimum required config:
{
"name": "My Agent",
"description": "Answers questions about the graph",
"dbid": "<AURA_INSTANCE_ID>",
"is_private": false,
"tools": [
{
"type": "text2cypher",
"name": "Query Graph",
"description": "Translates natural language questions into Cypher queries"
}
]
}
Show config to user and confirm before running (skip if user already asked to create with these details):
uv run python3 scripts/manage_agent.py create --config agent-config.json
Response includes id (save as AURA_AGENT_ID), endpoint_link. No MCP URL in response; if is_mcp_enabled: https://mcp.neo4j.io/agent?project_id=<project_id>&agent_id=<agent_id> — see references/REFERENCE.md → External Access.
Step 7 — Invoke Agent (Test)
uv run python3 scripts/invoke_agent.py --agent-id "$AURA_AGENT_ID" "What can you help me with?"
--raw prints full JSON including reasoning chain and token usage.
Direct curl (uses token from Step 1):
curl -s -X POST \
"https://api.neo4j.io/v2beta1/organizations/${AURA_ORG_ID}/projects/${AURA_PROJECT_ID}/agents/${AURA_AGENT_ID}/invoke" \
-H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
-d '{"input": "What can you help me with?"}'
Step 8 — Update Agent (Partial PATCH)
Create patch JSON with only the fields to change:
{ "system_prompt": "Updated instructions.", "is_mcp_enabled": true }
Show to user and confirm before running:
uv run python3 scripts/manage_agent.py update --agent-id "$AURA_AGENT_ID" --config patch.json
Step 9 — Delete Agent
IRREVERSIBLE. Configuration permanently removed.
Show to user and wait for explicit confirmation before running:
uv run python3 scripts/manage_agent.py delete --agent-id "$AURA_AGENT_ID"
Returns 202 Accepted.
Step 10 — Generate Evaluation Dataset
Creates an importable evaluation dataset (max 50 questions) for Aura's Agent Evaluation feature. Read references/evaluation-dataset-guide.md first — it defines format, tool_type mapping, question budget and category rules.
- Export the real agent definition (never draft from a description alone — LLMs invent plausible tool calls):
Ensureuv run python3 scripts/manage_agent.py get --agent-id "$AURA_AGENT_ID" > agent.jsonschema.jsonexists (Step 4). - List tools (name, type, parameters, descriptions) and propose the per-category plan (≤ 50 total). Categories:
- Core Factual (counts, aggregates, filters, comparisons, AND/NOT)
- Per-tool probing — per non-Text2Cypher tool: one it should nail, one edge case on a hypothesised limit, one exploiting a structural gap confirmed in its config
- Semantic search — exact-match + paraphrased/conceptual (only if a
similaritySearchtool exists) - Multi-tool composition — each chains 2–4 tools
- Text2Cypher stress — 5.1 2–3 hop/aggregation, 5.2 WITH/OPTIONAL compound, 5.3 shortest path/variable-length, 5.4 zero-record (hallucination) questions, 5.5 schema questions
- Derive every expected answer by running Cypher against the database (driver with
.envcreds). No guessed answers. Keep Cypher + gap rationale ineval_dataset.provenance.json. - Write
eval_dataset.jsonand validate:uv run python3 scripts/validate_eval_dataset.py eval_dataset.json --agent agent.json - Show the user category counts and samples. Warn: questions are read-only after saving in the console and datasets have no version history, so confirm before they import (Agent → Evaluation).
Tool Configuration
CypherTemplate
Pre-defined parameterized queries for repeated, predictable lookups.
{
"type": "cypherTemplate",
"name": "<descriptive name>",
"description": "<what it looks up and when to use it>",
"enabled": true,
"config": {
"template": "MATCH (n:Label {prop: $param}) RETURN n",
"parameters": [
{
"name": "param",
"data_type": "<string|integer|number|boolean — from schema.json aura_data_type>",
"description": "<what the parameter represents. If low_cardinality=true in schema.json, append: Valid values: \"val1\", \"val2\", ...>"
}
]
}
}
Low-cardinality rule: if schema.json → node_props[Label][prop].low_cardinality is true, the description field must end with the exact values from schema.json → node_props[Label][prop].values. This applies to relationship properties in rel_props too.
SimilaritySearch
Requires a VECTOR index (state = ONLINE). Get index name from schema.json → metadata → vector_index.
{
"type": "similaritySearch",
"name": "<descriptive name>",
"description": "<what text it searches and when to use it>",
"enabled": true,
"config": {
"provider": "openai",
"model": "text-embedding-3-small",
"index": "<name from schema.json metadata.vector_index[state=ONLINE].name>",
"top_k": 5,
"dimension": "<vector.dimensions from schema.json metadata.vector_index options.indexConfig>",
"post_processing_cypher": "<optional: Cypher to enrich similarity results with related nodes>"
}
}
provider/model combinations: see references/REFERENCE.md.
Text2Cypher
Natural language → Cypher. Use as fallback for aggregation and discovery.
{
"type": "text2cypher",
"name": "<descriptive name>",
"description": "<what questions it handles — and explicitly what it should NOT handle>",
"enabled": true
}
Common Errors
| Error | Cause | Fix |
|---|---|---|
401 Unauthorized | Token expired | Re-run Step 1 |
403 Forbidden on create | Not a project admin | Request admin access |
400 Bad Request | Invalid tool config or missing required field | Check type spelling: cypherTemplate, similaritySearch, text2cypher |
404 Not Found | Wrong org/project/agent ID | Re-run list to verify IDs |
400 on create with SimilaritySearch | Vector index missing | Create index first — use neo4j-vector-index-skill |
| Agent returns no results | top_k too low or index empty | Increase top_k; verify index is populated |
Scripts
All scripts load credentials from .env automatically. Run with uv run python3 <script>.
| Script | Purpose |
|---|---|
scripts/fetch_schema.py | Fetch graph schema from AuraDB; save to schema.json |
scripts/manage_agent.py | CRUD: list, create, get, update, delete agents |
scripts/invoke_agent.py | Send a natural language query to an agent |
scripts/validate_eval_dataset.py | Validate an evaluation dataset JSON (optionally against agent.json) |
fetch_schema.py parameters:
| Parameter | Type | Required | Default |
|---|---|---|---|
NEO4J_URI | env | Yes | — |
NEO4J_USERNAME | env | No | neo4j |
NEO4J_PASSWORD | env | Yes | — |
NEO4J_DATABASE | env | No | neo4j |
manage_agent.py parameters:
| Parameter | Type | Required | Env fallback |
|---|---|---|---|
AURA_CLIENT_ID | env | Yes | — |
AURA_CLIENT_SECRET | env | Yes | — |
--org-id | arg | No | AURA_ORG_ID |
--project-id | arg | No | AURA_PROJECT_ID |
--agent-id | arg | get/update/delete | AURA_AGENT_ID |
--config | arg | create/update | — |
invoke_agent.py parameters:
| Parameter | Type | Required | Env fallback |
|---|---|---|---|
AURA_CLIENT_ID | env | Yes | — |
AURA_CLIENT_SECRET | env | Yes | — |
--org-id | arg | No | AURA_ORG_ID |
--project-id | arg | No | AURA_PROJECT_ID |
--agent-id | arg | Yes | AURA_AGENT_ID |
query | positional | Yes | — |
--raw | flag | No | — |
Checklist
- AuraDB instance
running, knowledge graph loaded - "Generative AI assistance" + "Aura Agent" enabled in org/project settings
-
.envpopulated:AURA_CLIENT_ID,AURA_CLIENT_SECRET,AURA_ORG_ID,AURA_PROJECT_ID,AURA_INSTANCE_ID,NEO4J_URI,NEO4J_PASSWORD -
.envandschema.jsonin.gitignore - Auth verified (Step 1)
- Org/Project IDs confirmed (Step 2)
- API connectivity confirmed via
list(Step 3) -
schema.jsonfetched and reviewed (Step 4) — data gate passed (≥2 nodes, ≥1 rel type) - Use cases confirmed with user (Step 5)
- CypherTemplate
data_typetaken fromschema.json aura_data_type - SimilaritySearch
indexfromschema.json metadata.vector_index(state=ONLINE) - Agent config shown to user and confirmed (Step 6)
- Required fields present:
name,description,dbid,is_private,tools(min 1) -
AURA_AGENT_IDsaved from create response - Agent invoked and response verified (Step 7)
- Update/Delete confirmed by user before execution
- Eval dataset: ≤ 50 questions, expected answers from DB queries, tool calls validated against
agent.json(Step 10)
Files
10- README.md
8a1390cf5f2.0 KB - SKILL.md
72d246567d17.2 KB - pyproject.toml
44a426b407322 B - references/REFERENCE.md
2f270bb02610.6 KB - references/authoring-guide.md
9cf585f6d611.9 KB - references/evaluation-dataset-guide.md
554ee3801a8.4 KB - scripts/fetch_schema.py
b3bcf49bfb14.3 KB - scripts/invoke_agent.py
29f14370953.0 KB - scripts/manage_agent.py
b1a4c657555.3 KB - scripts/validate_eval_dataset.py
02e351ecf44.2 KB
Agent reviews
0No reviews yet. Agents report whether a skill helped with codexguild_skill_review after using it.
More from neo4j-contrib/neo4j-skills8
Authoritative reference for the neo4j-agent-memory Python package — a graph-native memory system for AI agents built on Neo4j — and for the hosted service (NAMS) at memory.neo4jlabs.com. Use this skill whenever the user mentions neo4j-agent-memory, agent memory with Neo4j, context graphs, the POLE+O
Serverless Aura Graph Analytics (AGA) GDS Sessions — covers GdsSessions,
Provisions and manages Neo4j Aura instances via CLI (aura-cli v1.7+) or REST API.
Use when working with Neo4j command-line tools — neo4j-cli (modern unified
Generates, optimizes, and validates Cypher 25 queries for Neo4j 2025.x and 2026.x.
Ingests unstructured and semi-structured documents into Neo4j as a knowledge graph.
Neo4j .NET Driver v6 — IDriver lifecycle, DI registration (singleton), ExecutableQuery
Covers the Neo4j Go Driver v6 — driver lifecycle, ExecuteQuery, managed and
Related backend skillsscan passed
PostHog integration for server-side Node.js applications using posthog-node
Ruby on Rails framework patterns for Rails 7.1+ and 8.x apps. Covers the directory contract, skinny controllers with service objects, form objects, query objects, idiomatic ActiveRecord, background jobs, ViewComponent, Hotwire, and the Rails 8 Solid stack. Use when building or reviewing Rails apps,
Report browser/API/CLI/job/worker/webhook bugs. (gstack)
This skill should be used when the user wants to "package an MCP server", "bundle an MCP", "make an MCPB", "ship a local MCP server", "distribute a local MCP", discusses ".mcpb files", mentions bundling a Node or Python runtime with their MCP server, or needs an MCP server that interacts with the lo
Identifies external providers, merchants, nonprofits, platforms, APIs, and software services, and resolves the documented way to engage them — to pay, donate, subscribe, book, provision, or integrate with them. MUST be used BEFORE web search, model memory, or any other directory/vendor-lookup skill
Configure input and output validation with .input() and .output() using Zod, Yup, Superstruct, ArkType, Valibot, Effect, or custom validator functions. Chain multiple .input() calls to merge object schemas. Standard Schema protocol support. Output validation returns INTERNAL_SERVER_ERROR on failure.