Skip to content

feat(agent-tools): the knowledge-graph tools over Bolt and file.extract (RFC-0013 step 2) - #64

Merged
acn-ericlaw merged 2 commits into
mainfrom
feat/agent-tools-graph
Nov 17, 2026
Merged

acn-ericlaw merged 2 commits into
mainfrom
feat/agent-tools-graph

Conversation

@acn-ericlaw

Copy link
Copy Markdown
Collaborator

What

RFC-0013 build plan step 2 completes version 1 of the built-in agent tools in extensions/agent-tools/:

  • The knowledge graph, inside one database (tools.graph.uri, a Bolt URI; the graph extra 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's db.schema.*, else Memgraph's schema.*), graph.query (read-only openCypher in a read transaction, refused before sending when it carries CREATE, MERGE, SET, DELETE, REMOVE, DROP or LOAD CSV outside a string or a comment; rows capped by tools.graph.max.rows; nodes, relationships, paths, temporal and spatial values rendered for the model), graph.write (write: true; the counters, plus any rows; DELETE and DROP refused unless tools.graph.delete=true) and graph.ingest (write: true; a model's extraction merged idempotently - one parameterized UNWIND ... MERGE per label and per type, source stamped 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 with tools.graph.write=true. Every statement runs in a managed transaction with tools.graph.timeout.ms set 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 and tools.file.extract.max.chars; HTML and text files too. Registers with the file tools when the documents extra is installed.
  • dev/graph-up.sh / graph-down.sh (Neo4j 5 Community on Colima, its Browser the viewer); the five new catalog files; describe states for the graph gates and the documents extra; tools.health reports the graph's address; README, application.yml, CHANGELOG; extras graph and documents in pyproject.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.ingest exists beside graph.write because a list of nodes and relationships is what a model extracts well, and a long MERGE with 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

acn-ericlaw added a commit that referenced this pull request Nov 17, 2026
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
acn-ericlaw and others added 2 commits November 17, 2026 18:46
…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
acn-ericlaw force-pushed the feat/agent-tools-graph branch from 25d0091 to 8e2d8d1 Compare November 17, 2026 10:46
@acn-ericlaw
acn-ericlaw merged commit 36a72bf into main Nov 17, 2026
5 checks passed
@acn-ericlaw
acn-ericlaw deleted the feat/agent-tools-graph branch November 17, 2026 10:48
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant