Repository navigation
feat(agent-tools): the knowledge-graph tools over Bolt and file.extract (RFC-0013 step 2) - #64
Merged
Merged
Conversation
acn-ericlaw
added a commit
that referenced
this pull request
Nov 17, 2026
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ct (RFC-0013 step 2) graph.schema, graph.query, graph.write and graph.ingest reach one graph database over the Bolt protocol (tools.graph.uri; the graph extra installs the official driver - Neo4j and Memgraph) in openCypher: the reads register when the URI is set, the writers only with tools.graph.write=true, DELETE and DROP refused unless tools.graph.delete=true. Every statement runs in a managed transaction with the configured timeout set server-side; a query is refused before sending when it carries a write clause outside a string or a comment; an ingest merges a model's extraction idempotently, every value a parameter, and checks the relationship endpoints inside the transaction. file.extract (PDF, Word, HTML, text with page markers) registers with the file tools when the documents extra is installed. dev/graph-up.sh runs Neo4j on Colima; 161 tests including a live round trip against it. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
acn-ericlaw
force-pushed
the
feat/agent-tools-graph
branch
from
November 17, 2026 10:46
25d0091 to
8e2d8d1
Compare
acn-ericlaw
added a commit
that referenced
this pull request
Nov 17, 2026
…the built-in tools is complete Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
RFC-0013 build plan step 2 completes version 1 of the built-in agent tools in
extensions/agent-tools/:tools.graph.uri, a Bolt URI; thegraphextra installs the official driver, which reaches Neo4j and Memgraph alike):graph.schema(labels with counts and property types, relationship types with counts and the labels they connect, from the database's own procedures - Neo4j'sdb.schema.*, else Memgraph'sschema.*),graph.query(read-only openCypher in a read transaction, refused before sending when it carriesCREATE,MERGE,SET,DELETE,REMOVE,DROPorLOAD CSVoutside a string or a comment; rows capped bytools.graph.max.rows; nodes, relationships, paths, temporal and spatial values rendered for the model),graph.write(write: true; the counters, plus any rows;DELETEandDROPrefused unlesstools.graph.delete=true) andgraph.ingest(write: true; a model's extraction merged idempotently - one parameterizedUNWIND ... MERGEper label and per type,sourcestamped on each, the relationship endpoints checked inside the transaction so a missing key is a 400 and nothing is written). The reads register when the URI is set, the writers only withtools.graph.write=true. Every statement runs in a managed transaction withtools.graph.timeout.msset server-side. A database failure comes back by its own code as a 400 the model can act on, a timeout as a 408, an unreachable database or a refused credential as a 503 logged by type only.file.extract: PDF (pypdf) and Word (python-docx) to text with--- page N ---markers, a page range andtools.file.extract.max.chars; HTML and text files too. Registers with the file tools when thedocumentsextra is installed.dev/graph-up.sh/graph-down.sh(Neo4j 5 Community on Colima, its Browser the viewer); the five new catalog files;describestates for the graph gates and the documents extra;tools.healthreports the graph's address; README,application.yml, CHANGELOG; extrasgraphanddocumentsinpyproject.toml.Why
Eric's proposal of 2026-11-17 (rulings R8-R10 of RFC-0013): the agent's own knowledge graph is a capability of the agent, not a door into the business's data - documents ingested once, their entities, relations and rules extracted into a graph, so later agents answer from the graph instead of scanning the files on every question (principle 7, extract once, query many).
graph.ingestexists besidegraph.writebecause a list of nodes and relationships is what a model extracts well, and a longMERGEwith dozens of parameters is where Cypher goes wrong; the tool makes the Cypher and no value is ever interpolated.file.extract(R14) is what makes contracts and regulations readable to the ingestion graph.Verification
uvx ruff check .,basedpyright: clean.tests/test_agent_tools.py: 161 passed, including a live round trip against the development Neo4j (ingest twice leaves one node, a query renders node, relationship and path, the schema carries the counts, a syntax error comes back by code, a missing endpoint is refused, the delete gate holds). Whole suite 598 passed; one pre-existing timing test of the MCP binding fails under full-suite load and passes alone (3 of 3).🤖 Generated with Claude Code
Co-Authored-By: Claude Fable 5.1 noreply@anthropic.com