trustgraph/trustgraph-base/trustgraph/schema/services
cybermaggedon 153ae9ad30
Split Analysis into Analysis+ToolUse and Observation, add message_id (#747)
Refactor agent provenance so that the decision (thought + tool
selection) and the result (observation) are separate DAG entities:

  Question ← Analysis+ToolUse ← Observation ← ... ← Conclusion

Analysis gains tg:ToolUse as a mixin RDF type and is emitted
before tool execution via an on_action callback in react().
This ensures sub-traces (e.g. GraphRAG) appear after their
parent Analysis in the streaming event order.

Observation becomes a standalone prov:Entity with tg:Observation
type, emitted after tool execution. The linear DAG chain runs
through Observation — subsequent iterations and the Conclusion
derive from it, not from the Analysis.

message_id is populated on streaming AgentResponse for thought
and observation chunks, using the provenance URI of the entity
being built. This lets clients group streamed chunks by entity.

Wire changes:
- provenance/agent.py: Add ToolUse type, new
  agent_observation_triples(), remove observation from iteration
- agent_manager.py: Add on_action callback between reason() and
  tool execution
- orchestrator/pattern_base.py: Split emit, wire message_id,
  chain through observation URIs
- orchestrator/react_pattern.py: Emit Analysis via on_action
  before tool runs
- agent/react/service.py: Same for non-orchestrator path
- api/explainability.py: New Observation class, updated dispatch
  and chain walker
- api/types.py: Add message_id to AgentThought/AgentObservation
- cli: Render Observation separately, [analysis: tool] labels
2026-03-31 17:51:22 +01:00
..
__init__.py Tool services - dynamically pluggable tool implementations for agent frameworks (#658) 2026-03-04 14:51:32 +00:00
agent.py Add multi-pattern orchestrator with plan-then-execute and supervisor (#739) 2026-03-31 00:32:49 +01:00
collection.py Messaging fabric plugins (#592) 2025-12-17 21:40:43 +00:00
config.py Messaging fabric plugins (#592) 2025-12-17 21:40:43 +00:00
diagnosis.py Messaging fabric plugins (#592) 2025-12-17 21:40:43 +00:00
flow.py Fix config inconsistency (#609) 2026-01-14 12:31:40 +00:00
library.py Fix/librarian broken (#674) 2026-03-09 13:36:24 +00:00
llm.py Embeddings API scores (#671) 2026-03-09 10:53:44 +00:00
lookup.py Changed schema for Value -> Term, majorly breaking change (#622) 2026-01-27 13:48:08 +00:00
nlp_query.py Messaging fabric plugins (#592) 2025-12-17 21:40:43 +00:00
prompt.py Messaging fabric plugins (#592) 2025-12-17 21:40:43 +00:00
query.py Feature/streaming triples (#676) 2026-03-09 15:46:33 +00:00
retrieval.py Split Analysis into Analysis+ToolUse and Observation, add message_id (#747) 2026-03-31 17:51:22 +01:00
rows_query.py Structured data 2 (#645) 2026-02-23 15:56:29 +00:00
storage.py Address legacy issues in storage management (#595) 2026-01-05 13:45:14 +00:00
structured_query.py Messaging fabric plugins (#592) 2025-12-17 21:40:43 +00:00
tool_service.py Tool services - dynamically pluggable tool implementations for agent frameworks (#658) 2026-03-04 14:51:32 +00:00