feat(knowledge): surface potential-conflict pairs at retrieval (agents' KB #4, surfacing half)#225
Merged
Merged
Conversation
…s' KB #4, surfacing half) The detection half (#224) creates :potential_conflict links; this makes them travel with the search result so the consuming agent — the one with live context — trips over them and resolves them. - get_article JSON: + a flattened, actionable `potential_conflicts` field per article (peer article_id/title/similarity), derived from the already-loaded link graph. An agent reading an article now sees its 'too similar to coexist' peers directly, instead of digging through incoming/outgoing_links. Empty list when none. - Knowledge.list_potential_conflicts/2: the tenant-wide review queue — every flagged pair, highest-overlap first (most likely a true duplicate), paginated, tenant-scoped. - API: GET /api/v1/knowledge/conflicts (agent+), so a consuming agent or human can pull the whole queue and act. - MCP v2.26.0: knowledge_conflicts tool (agent key); knowledge_get now carries potential_conflicts automatically (flows through the API). Also fixed a stale knowledge_drafts doc that still claimed an over-max limit is rejected-400 (it has clamped since the pagination work). The KB only flags; every tool/field repeats that the caller decides redundancy-vs- contradiction. Tests (+6 Elixir, +2 MCP): list ordering/pagination/isolation, the get field (populated + empty), the endpoint, and the MCP plumbing. Full gate green (3048 tests, dialyzer, credo; 52 MCP tests).
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.
The detection half (#224) creates
:potential_conflictlinks; this makes them travel with the search result so the consuming agent — the one with live context — trips over them and resolves them.Changes
get_articleJSON — a flattened, actionablepotential_conflictsfield per article (peerarticle_id/title/similarity), derived from the already-loaded link graph. An agent reading an article now sees its "too similar to coexist" peers directly instead of digging throughincoming/outgoing_links. Empty list when none.Knowledge.list_potential_conflicts/2— the tenant-wide review queue: every flagged pair, highest-overlap first (most likely a true duplicate), paginated, tenant-scoped.GET /api/v1/knowledge/conflicts(agent+), so a consuming agent or human can pull the whole queue and act.knowledge_conflictstool (agent key);knowledge_getcarriespotential_conflictsautomatically. Also fixed a staleknowledge_draftsdoc that still claimed an over-maxlimitis rejected-400 (it has clamped since the pagination work).The KB only flags; every tool/field repeats that the caller decides redundancy-vs-contradiction.
Tests (+6 Elixir, +2 MCP)
list ordering/pagination/isolation; the get field (populated + empty); the endpoint; MCP plumbing. Full gate green: format, credo, dialyzer, 3048 tests; 52 MCP tests.
Completes agents' KB #4.