Skip to content

feat(platform): let agents add, edit and search knowledge entries - #4548

Merged
yannickmonney merged 6 commits into
mainfrom
feat/agent-knowledge-tools
Oct 9, 2026
Merged

yannickmonney merged 6 commits into
mainfrom
feat/agent-knowledge-tools

Conversation

@yannickmonney

Copy link
Copy Markdown
Contributor

Why

Agents can search the knowledge base today, but nobody can see that, and they cannot add or correct a knowledge entry at all. This gives project agents and automation agent steps a grantable way to keep org facts current, makes the always-on search visible, and makes the growing equipment menu searchable.

What changes

  • knowledge_entry_write tool (grant-only, "Writes data"): saves one org-wide fact by topic. A new topic creates an entry with source Agent. The same text saves nothing. Changing an existing fact needs the version the agent read (expectedVersionId). A missing or stale version is refused with the current text, so the agent merges instead of overwriting a person's edit. Agents cannot delete entries.
  • Safety:
    • A run a Member started is refused (member_run).
    • Agent saves draw on their own per-org rate bucket (knowledge:agent-write), so a looping agent never locks editors out.
    • Every save leaves an audit row (knowledge_entry.created|updated, viaAgent) and a document hint.
  • Atomicity: the decision and the write run in one transaction under the topic advisory lock; migration 0164 admits the agent source.
  • knowledge_entry_find now returns each entry's version id and updatedAt, and matches content as well as the topic.
  • Equipment menu (agent dialog and both automation agent surfaces):
    • Lists Search the knowledge base under Knowledge, locked on ("Always on — no grant needed").
    • Gains a search field over skills, connectors and tools.
    • One useAgentToolOptions hook replaces three copies of the tool-option builder.
  • @tale/ui DropdownMenu:
    • Additive search option: the field keeps its keys from the menu's typeahead, Arrow Down moves into the rows, and the query resets on close.
    • locked checkbox rows.
  • API contract 3.21.0 (tool enum + KnowledgeEntry.source: agent). Specs KENTRY-R10–R13 and SBX-R7. Docs updated in EN, DE and FR. Manual boxes KNOW-F38/F39/B25, PROJ-F64/F65, TASK-B49.

Verification

  • Unit/server: knowledge entries service and races, bridge (knowledge + member run), dispatch routes, shim reachability, tool names and grants, OpenAPI spec/fingerprint, i18n parity, platform guards — all green locally.
  • Component: SkillsMenu (locked row, search) and DropdownMenu (search, locked, axe); project-agent-dialog, agent-node-fields and blank-automation-dialog tests green.
  • tsc (platform, ui), oxlint, knip, lint:manual + check-guide, lint:links green.

Not verified yet

  • A live agent run writing and merging an entry (needs a real sandbox and model).
  • The menu in a real browser in both themes. I'll check it before merging.

Known gap (pre-existing, unchanged)

Runtimes without MCP (pi, hermes) mount no tool bridge, so no workspace tool reaches them, granted or always-on. The menu wording avoids claiming "every agent".

@yannickmonney
yannickmonney force-pushed the feat/agent-knowledge-tools branch 7 times, most recently from 181cf77 to a6b1501 Compare October 8, 2026 23:29
Adds the entries domain's write by topic for agents: one transaction under the topic lock decides create, unchanged or a new version, and a change to an existing fact needs the version the agent read, else the refusal carries the current text to merge from. Rows read source agent with the agent as author, leave an audit row and a document hint, and draw on an agent-only rate bucket. Migration 0164 admits the agent source; the agents' listing gains the version id, updatedAt and an opt-in content match.
Project agents and automation agent steps can be equipped with the
knowledge_entry_write tool, which saves one organization-wide fact by
topic through the entries domain's write by topic. Changing an existing
entry needs the version the agent read, and a stale or missing version
comes back as an answer carrying the current text to merge from. A run a
member started is refused, agent saves draw on their own rate bucket, and
the find tool now answers each entry's version id and dates and matches
content as well as the topic. The API contract moves to 3.23.0 for the
new tool name and the agent source.
A menu given a search option opens with the caret in a field that narrows its rows by label, description and keywords as you type, keeps a group's label while a row under it matches, says when nothing matches, moves into the rows with Arrow Down and starts over when reopened. Its keys stay its own, so the menu's typeahead no longer jumps to a row on every letter. A checkbox row can be locked: always on, shown at full strength and announced as unavailable to switch.
The equipment menu of project agents and automation agent steps lists Search the knowledge base under Knowledge as always on, beside the grantable Add and edit knowledge entries, and gains a search field over skills, connectors and tools. One hook now builds the tool options for all three surfaces, and an agent's details list knowledge search first among its platform tools.
Knowledge entries, the knowledge overview, project agents, agent concepts and the member-run limits in EN, DE and FR describe the knowledge write tool, the merge on a changed entry, the always-on search row and the equipment menu search. New manual boxes KNOW-F38, KNOW-F39, KNOW-B25, PROJ-F64, PROJ-F65 and TASK-B49 with their automation rows.
Quarantined legacy runs reuse grantedToolsGuidance and its neighbours from tool_names.ts, pinned to the released bytes. The write warning keeps its released wording, and the pin now holds each reused declaration instead of the whole file, so the member-run guidance beside them can name knowledge entries.
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