Skip to content

feat(knowledge): surface potential-conflict pairs at retrieval (agents' KB #4, surfacing half)#225

Merged
mkreyman merged 1 commit into
masterfrom
knowledge-conflict-surfacing
Jun 30, 2026
Merged

feat(knowledge): surface potential-conflict pairs at retrieval (agents' KB #4, surfacing half)#225
mkreyman merged 1 commit into
masterfrom
knowledge-conflict-surfacing

Conversation

@mkreyman

Copy link
Copy Markdown
Owner

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.

Changes

  • 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.
  • APIGET /api/v1/knowledge/conflicts (agent+), so a consuming agent or human can pull the whole queue and act.
  • MCP v2.26.0knowledge_conflicts tool (agent key); knowledge_get carries potential_conflicts automatically. 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; MCP plumbing. Full gate green: format, credo, dialyzer, 3048 tests; 52 MCP tests.

Completes agents' KB #4.

…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).
@mkreyman mkreyman merged commit 54af9f8 into master Jun 30, 2026
9 checks passed
@mkreyman mkreyman deleted the knowledge-conflict-surfacing branch June 30, 2026 23:13
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