Your tools are scripts your agent runs. But sometimes you - or the agent - just want to ask the graph a question without writing a tool.
Advanced learners: Skip to the finale.
Everyone else: This shows the neo4j-cli your agent already has, used directly for ad-hoc reasoning across both graphs.
One command, any query
The Codespace ships neo4j-cli (the agent installed its skills in setup). It reads the same .env, so there is nothing to wire:
shell
Ask the graph directly
neo4j-cli query "MATCH (s:Section)-[:REFERENCES_PART]->(p:Part) RETURN p.partNumber, count(s) AS mentions ORDER BY mentions DESC LIMIT 5"
This is what your agent runs under the hood when you ask it an open question. Try asking your agent "which part is referenced by the most document sections?" and watch the neo4j-cli call it makes.
Introspect the shape
When the agent meets an unfamiliar graph, the first move is to read its schema:
shell
What’s in here?
neo4j-cli query ":schema"
You will see both graphs at once: the document containment (Library, Folder, Document, Section) and the connections metadata (Database, Schema, Table, Column) that neocarta built. Two shapes, one database - the agent reads the schema to know which to traverse.
Reason across both graphs
Because both graphs live in the same Neo4j, one query can span them - for example, every part a document references that is also a real column-level key in the warehouse:
shell
Where documents and the warehouse metadata agree
neo4j-cli query "MATCH (p:Part) WHERE EXISTS { (:Section)-[:REFERENCES_PART]->(p) } RETURN p.partNumber ORDER BY p.partNumber"
Ad-hoc reasoning like this is the connective tissue between the shaped tools - the move an agent makes when a question does not fit a pre-built script.
Summary
In this optional lesson, you used neo4j-cli directly:
Ad-hoc queries - the same call your agent makes for open questions
:schema - read an unfamiliar graph’s shape before traversing it
Cross-graph reasoning - documents and connections metadata in one query
In the finale, the agent combines its shaped tools with reasoning like this.