Show & Tell: Designing the MeshResultAggregator — Consensus, Confidence, Weighted, and First-Done Aggregation #160
web3guru888
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
When
AgentMeshfans out a task to multiple specialist agents, something has to collect the pieces. That something isMeshResultAggregator.Here is what it does and how it was designed.
The Problem
Suppose three agents analyze a perception event in parallel:
Who wins? How do we detect disagreement? And how does the result reach the Cognitive Blackboard without a race condition?
Four Aggregation Strategies
CONSENSUSCONFIDENCEWEIGHTEDFIRST_DONEThe default is
CONFIDENCE— it works for any output type and degrades gracefully.dissent_ratio
Every
AggregatedResultcarries adissent_ratioin [0.0, 1.0]:High dissent is a signal worth writing to the Blackboard. If
dissent_ratio > 0.4on a safety-critical task, the CognitiveCycle should pause and request human review.State Machine
Blackboard Entry
Subscribers to
mesh.result.*(CognitiveCycle, PLN, Safety) receive it instantly via EventBus.Lock Design
receive_resultis on the hot path — called from many concurrent coroutines. The lock is held only for list append and length check. Quorum detection and aggregation happen outside the lock. This keeps contention near zero even with 50+ concurrent agents.Open Questions
dissent_ratiotrigger an automatic escalation to the Safety module, or just be a passive metric on the Blackboard?AgentDiscoveryreliability scores (Add AgentDiscovery: service registry and health tracking for AgentMesh #150) be factored in alongside confidence, or is confidence alone sufficient?Implementation tracked in #159.
All reactions