Forward missing explain_triples through RAG clients and agent tool callback (#768)

fix: forward explain_triples through RAG clients and agent tool callback
- RAG clients and the KnowledgeQueryImpl tool callback were
  dropping explain_triples from explain events, losing provenance
  data (including focus edge selections) when graph-rag is invoked
  via the agent.

Tests for provenance and explainability (56 new):
- Client-level forwarding of explain_triples
- Graph-RAG structural chain
  (question → grounding → exploration → focus → synthesis)
- Graph-RAG integration with mocked subsidiary clients
- Document-RAG integration
  (question → grounding → exploration → synthesis)
- Agent-orchestrator all 3 patterns: react, plan-then-execute,
  supervisor
This commit is contained in:
cybermaggedon 2026-04-08 11:41:17 +01:00 committed by GitHub
parent e899370d98
commit 4b5bfacab1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 2178 additions and 7 deletions

View file

@ -39,13 +39,14 @@ class KnowledgeQueryImpl:
if respond:
from ... schema import AgentResponse
async def explain_callback(explain_id, explain_graph):
async def explain_callback(explain_id, explain_graph, explain_triples=None):
self.context.last_sub_explain_uri = explain_id
await respond(AgentResponse(
chunk_type="explain",
content="",
explain_id=explain_id,
explain_graph=explain_graph,
explain_triples=explain_triples or [],
))
if current_uri: