Package com.tnsai.coordination.decision
Interface GroupDecisionFramework
- All Known Implementing Classes:
DefaultGroupDecisionFramework
public interface GroupDecisionFramework
Framework for group-level decision-making with propose, vote, and converge phases.
Provides a structured protocol for agents within an AgentGroup
to reach consensus on decisions. Supports pluggable consensus algorithms
via VotingMethod.
Decision Pipeline
- Propose — Create a
DecisionProposalwith topic and options - Vote — Collect votes from group members
- Converge — Tally votes, determine outcome, sync beliefs
Usage
GroupDecisionFramework framework = new DefaultGroupDecisionFramework(traceStore);
DecisionProposal proposal = DecisionProposal.of("Which database?",
List.of("PostgreSQL", "MySQL", "MongoDB"));
DecisionResult result = framework.makeDecision(group, proposal);
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionconverge(com.tnsai.agents.groups.AgentGroup group, List<Vote> votes, DecisionProposal proposal) Tallies votes, determines outcome, saves trace, and broadcasts result.default DecisionResultmakeDecision(com.tnsai.agents.groups.AgentGroup group, DecisionProposal proposal) Convenience method: propose, vote, and converge in one call.propose(String topic, List<String> options, VotingMethod method) Creates a decision proposal.vote(com.tnsai.agents.groups.AgentGroup group, DecisionProposal proposal) Collects votes from all group members on a proposal.
-
Method Details
-
propose
Creates a decision proposal.- Parameters:
topic- the question to decideoptions- available choices (at least 2)method- consensus algorithm- Returns:
- a new proposal
-
vote
Collects votes from all group members on a proposal.- Parameters:
group- the agent group whose members will voteproposal- the proposal to vote on- Returns:
- collected votes
-
converge
DecisionResult converge(com.tnsai.agents.groups.AgentGroup group, List<Vote> votes, DecisionProposal proposal) Tallies votes, determines outcome, saves trace, and broadcasts result. If no consensus is reached and a leader exists, falls back to leader decision.- Parameters:
group- the agent group (for leader fallback and belief sync)votes- collected votesproposal- the original proposal- Returns:
- the decision result
-
makeDecision
default DecisionResult makeDecision(com.tnsai.agents.groups.AgentGroup group, DecisionProposal proposal) Convenience method: propose, vote, and converge in one call.- Parameters:
group- the agent groupproposal- the decision proposal- Returns:
- the decision result
-