Skip to content

kbatbouta/2Old2Intern

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

66 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ”—2Old2Intern

[WIP - Evolving Architecture] A powerful, general-purpose multi-agent orchestration system that enables AI experts to engage in structured debates through sequential goal progression, with advanced features like whisper communications and automated moderation.

Example of private thoughts

Julia has withdrawn already, which is surprising. She's made strong technical arguments but I think she's missing the depth of flavor that comes from the tomato-guanciale marriage. I need to counter her "immediate gratification" argument with the reality that great taste isn't just about instant pleasure - it's about complexity and satisfaction that builds. The coordinator keeps pushing us toward pure taste, so I must focus on the actual sensory experience of eating Amatriciana.

Example of private predictions

Julia withdrawing early suggests she's confident in her position but doesn't want to engage further. The Governor supports carbonara with similar arguments about umami intensity. The Senator is on my side but got caught up in cultural arguments. I need to make the sensory case for Amatriciana more compelling. The Divine Creator went with carbonara too, so I'm outnumbered. Need to focus on what makes Amatriciana's taste experience genuinely superior.

๐ŸŽฏ What This Is

This isn't just another chatbot system - it's a composable flexible debate engine that can handle any complex evaluation or decision-making scenario. Whether you're evaluating job candidates, research proposals, investment opportunities, policy decisions, medical diagnoses, or creative projects, this framework provides the infrastructure for multi-expert analysis.

Core Interactive Capabilities

  1. ๐Ÿ’ญ Hold private thoughts (like internal strategy) - Each agent maintains hidden reasoning that informs their public positions without revealing tactical considerations
  2. ๐Ÿคซ Whisper secret messages to each other (forming alliances) - Private bilateral communication channels enable realistic coalition building and information sharing
  3. ๐Ÿ”„ Engage in sticky back-and-forth private chats that shape the outcome - Persistent whisper threads allow for complex multi-turn negotiations that influence public debate
  4. ๐Ÿ›๏ธ Debate publicly in structured phases โ€” just like real committees, with formal position-taking and reasoned discourse
  5. ๐Ÿ”— Create recursive meta-debates - Debates can moderate other debates with infinite oversight depth for self-governing AI democracy
  6. ๐Ÿ”ฎ Behavioral prediction modeling - Agents continuously assess and predict other participants' motivations, strategic moves, and likely reactions based on evolving group dynamics

Progressive Goal Management System

  1. ๐ŸŽฏ Dynamic phase transitions triggered by participant withdrawal patterns rather than arbitrary timelines
  2. ๐Ÿ“ˆ Natural completion detection - when enough agents withdraw from a goal, the system recognizes deliberation has reached diminishing returns
  3. ๐Ÿ”„ Adaptive progression through structured phases (e.g., economic analysis โ†’ political feasibility โ†’ final recommendations)
  4. โšก Prevents endless circular debate by using organic stopping points based on participant behavior
  5. ๐ŸŽฒ Dynamic information injection - Wildcard system allows scheduled event reveals and information updates that test group adaptation to changing circumstances

Timekeeper Anti-Drift Architecture

  1. ๐Ÿ“‹ Structural enforcement of verdict scaffolding to ensure comparable, analyzable outputs
  2. ๐ŸŽฏ Progress tracking that monitors participation and prevents agents from avoiding commitment
  3. โš ๏ธ Drift prevention through constant orientation reminders and goal clarity
  4. ๐Ÿ”ด Escalating alerts when discussions veer off-track or participants fail to engage with current objectives
  5. ๐Ÿ“Š Real-time coordination ensuring all voices are heard before phase transitions

System Intelligence Features

  1. ๐Ÿ“ˆ Emergent narrative generation where authentic political dynamics arise from agent interactions
  2. โš–๏ธ Balanced participation management preventing any single voice from dominating
  3. ๐ŸŽญ Consistent character maintenance across extended multi-phase deliberations
  4. ๐Ÿ”ง Tick-based plugin composability - Modular watcher system enables unlimited extensibility and custom intervention strategies
  5. ๐Ÿงต Relationship persistence - Stickness system maintains private communication threads and relationship continuity across debate phases

Recursive Meta-Governance Architecture

  1. ๐Ÿ›๏ธ Democratic AI oversight - AI systems democratically govern other AI systems through structured debate with majority voting requirements
  2. ๐Ÿ”„ Self-correcting intelligence - Higher-level debates identify and correct biases or procedural errors in lower-level discussions through consensus-based interventions
  3. โš–๏ธ Configurable intervention depth - From quick oversight (1-2 messages) to comprehensive analysis (10+ messages) with tunable urgency thresholds
  4. โˆž Infinite recursion capability - Debates watching debates watching debates with no theoretical limit and fail-safe majority consensus requirements
  5. โš–๏ธ Majority consensus enforcement - Interventions only occur when meta-debate participants reach democratic agreement, with automatic fallback to non-interference
  6. โšก Real-time self-governance - System spawns scheduled meta-moderation debates, with democratic voting determining interventions without human oversight

๐Ÿง  Advanced Cognitive Features

Recursive Meta-Governance System

Meta-Debate Chains: The most advanced feature of the framework is its ability to create debates that moderate other debates through recursive meta-governance. This enables unprecedented oversight and quality control.

# Primary debate evaluating a job candidate
primary_debate = ChainOfDebate(topic="Should we hire this AI researcher?")

# Meta-debate watching the primary debate for bias or derailment  
meta_watcher = ModerationWatcher(
    llm=llm,
    moderation_criteria="Are evaluators avoiding bias? Staying on topic?",
    length_multiplier=2.0,  # Quick 2-4 message oversight
    check_interval=5        # Review every 5 messages
)

# Meta-meta-debate watching the meta-debate for over-correction
meta_meta_watcher = ModerationWatcher(
    llm=llm, 
    moderation_criteria="Are moderators being too harsh? Too lenient?",
    length_multiplier=1.5,
    meta_watchers=[meta_watcher]  # Infinite recursion possible
)

primary_debate.watchers.append(meta_meta_watcher)

Private Thoughts Architecture

Each agent generates internal thoughts that simulate realistic cognitive processes:

<PrivateThoughts speaker="agent_name">
This candidate's background check shows some concerning gaps. I need to probe deeper 
into their employment history without revealing what I know publicly. Maybe I can 
coordinate with the security expert privately first to build a stronger case.
</PrivateThoughts>

Key Features:

  • Complete Privacy: Only the generating agent can see their own thoughts
  • Strategic Planning: Agents use thoughts to plan their approach and assess situations
  • Realistic Cognition: Simulates the internal deliberation that precedes external communication
  • Coalition Strategy: Agents think through alliance-building and information sharing tactics

Continuous Cognitive Intelligence

Behavioral Prediction Modeling: Agents maintain ongoing psychological assessments of other participants, continuously updating their mental models based on observed behavior. This creates realistic social intelligence where agents evaluate motivations, detect strategic moves, and predict likely reactions in real-time.

Evolving Social Awareness: As debates progress, agents revise their opinions of colleagues based on performance - recognizing when someone exceeds expectations, identifying emerging coalition patterns, or detecting shifts in strategic positioning. This dynamic assessment mirrors how real experts adjust their perceptions during extended deliberations.

Enhanced Whisper Response System

The framework includes mechanisms to increase whisper engagement:

Whisper Targeting Intelligence:

  • Natural conversation threading where whispers often trigger follow-up whispers

Response Probability Enhancement:

# Agents are more likely to respond to whispers that:
# - Share confidential information
# - Propose alliances or coordination
# - Request private consultation
# - Contain strategic intelligence

Whisper Chain Formation:

  • Private conversations naturally develop into multi-message exchanges
  • Agents remember previous whisper context when generating responses
  • Strategic coordination often emerges through sustained private channels

๐Ÿ”ง Technical Deep Dive

Message Scaffolding System

Every agent communication follows strict XML-like scaffolding:

<Message id="unique-id" timestamp="2024-01-15T10:30:00">
<Speaker>agent_name</Speaker>
<SpeakingTo>target_agent</SpeakingTo>  <!-- Optional -->
<Whisper>true</Whisper>               <!-- For private messages -->
<Artifacts></Artifacts>
<PrivateThoughts speaker="agent_name">
  Internal cognitive process and strategic planning
</PrivateThoughts>
<Content>  
  The actual message content visible to intended recipients
</Content>
</Message>

Verdict Structure:

<Verdict>APPROVE</Verdict>             <!-- Domain-specific -->
<VerdictReasoning>Detailed reasoning</VerdictReasoning>
<Withdrawn>false</Withdrawn>

Advanced Information Management

Three-Tier Visibility System:

  1. Public Layer: Standard conversation visible to all participants
  2. Whisper Layer: Private messages filtered by target recipient
  3. Cognitive Layer: Internal thoughts visible only to the generating agent

Tick-Based Plugin System (Watchers)

Real-Time Monitoring & Intervention: The framework includes a powerful plugin architecture for monitoring conversation state and automatically intervening when needed.

class DebateWatcher(abc.ABC):
   """Tick-based conversation plugins that run on every turn"""
   @abc.abstractmethod
   def __call__(self, current_speaker, orchestrator_api: AgentOrchestratorAPI):
       pass

# Inject message when specific conditions are met
reminder = ScheduledMessage(
   "โฐ Five minutes remaining for this phase",
   lambda speaker, api: api.debate_messages_count() > 15
)

# Add to orchestrator
orchestrator.watchers.append(reminder) # or pass it to the constructor

๐ŸŽ›๏ธ Configuration & Customization

Enhanced Persona Configuration

Persona(
    name="Marcus Gossip",
    title="HR Security Specialist",
    expertise="Background verification and workplace security",
    personality="Secretive and paranoid, loves sharing rumors through whispers",
    speaking_style="Frequently whispers sensitive information, creates alliances through private communications"
)

๐Ÿ› ๏ธ Development Status

Current Status: WIP - Active Development

Stable Components:

  • โœ… Core orchestration engine
  • โœ… Scaffolded communication system
  • โœ… Sequential goal processing
  • โœ… Three-tier visibility system
  • โœ… Private thoughts architecture
  • โœ… Enhanced whisper mechanics
  • โœ… Verdict tracking and validation

Recent Major Upgrades:

  • โœ… Private Thoughts System - Internal cognitive processes visible only to generating agent
  • โœ… Whisper Response Enhancement - Improved probability of whisper engagement and threading
  • โœ… Coalition Detection - Automatic identification of alliance formation patterns
  • โœ… Strategic Intelligence Tracking - Analysis of information flow and influence patterns

In Progress:

  • ๐Ÿ”ง Advanced persona generation
  • ๐Ÿ”ง Enhanced analytics dashboard
  • ๐Ÿ”ง Performance optimization
  • ๐Ÿ”ง Extended domain templates

Planned Features:

  • ๐Ÿ”ฎ Dynamic expert generation from role descriptions
  • ๐Ÿ”ฎ Conversation summarization and compression
  • ๐Ÿ”ฎ Multi-modal artifact support
  • ๐Ÿ”ฎ Real-time collaboration interfaces
  • ๐Ÿ”ฎ Integration with external knowledge bases

Chain of Debate: What Makes It Different

TLDR

Chain of Debate creates realistic AI panel discussions where multiple AI experts can privately whisper to each other, form alliances, and work through complex decisions step-by-step - just like real human committees, but more reliable and scalable.

How Current AI Works vs. Chain of Debate

๐Ÿค– Current AI Systems

Single Expert Model:

  • You talk to one AI at a time
  • Gets one perspective on complex problems
  • No back-and-forth between different viewpoints
  • Like asking one doctor for a medical opinion

Simple Multi-AI:

  • Multiple AIs respond separately to the same question
  • No interaction between them
  • No coordination or discussion
  • Like surveying multiple doctors but they never talk to each other

๐Ÿ”— Chain of Debate

Structured AI Panel Discussions:

  • Multiple AI experts with different specialties debate together
  • They can whisper privately to form alliances and share sensitive information
  • Systematic progression through different aspects of the problem
  • Built-in moderation to keep discussions on track
  • Like a real expert panel where specialists can consult privately while working toward a group decision

Key Points

1. Private Communications ("Whispers")

  • AIs can send private messages to specific other AIs
  • Enables realistic coalition-building and strategic coordination
  • Information can be shared confidentially between allies
  • Why this matters: Real experts often coordinate privately before making public statements

2. Hidden Internal Thoughts

  • Each AI has private thoughts only they can see
  • Simulates internal deliberation and strategic planning
  • Makes behavior more realistic and human-like
  • Why this matters: Shows the "thinking process" behind decisions, just like humans consider strategy before speaking

3. Sequential Goal Processing

  • Complex problems broken into focused discussion phases
  • Automatic progression from topic to topic
  • Prevents discussions from going in circles
  • Why this matters: Real committees work through agendas systematically, not randomly

4. Smart Moderation

  • Built-in "TimeKeeper" that enforces deadlines and decisions
  • Escalating pressure to reach conclusions
  • Prevents endless debate without resolution
  • Why this matters: Human meetings need moderators; AI meetings do too

Real-World Comparison

Traditional Approach:

You โ†’ Ask Question โ†’ Single AI โ†’ Get Answer

Chain of Debate:

You โ†’ Present Problem โ†’ AI Panel Discussion โ†’ 
    โ†“
Multiple experts debate publicly
    โ†“  
Private whispers and alliance formation
    โ†“
Systematic progression through key issues
    โ†“
Structured final recommendations

Why This Is Valuable

  1. ๐ŸŽฏ Better Decisions: Multiple expert perspectives catch blind spots that single AIs miss
  2. ๐Ÿค Realistic Dynamics: Private communications and coalition-building mirror real human expert panels
  3. ๐Ÿ“Š Systematic Analysis: Sequential goal processing ensures comprehensive evaluation
  4. โšก Scalable Expertise: Can simulate expert panels for any topic without coordinating real humans
  5. ๐Ÿ” Transparent Process: You can see not just the final decision, but how it was reached through the debate

Bottom Line: Instead of asking one AI expert or getting separate opinions from multiple AIs, you get a realistic expert panel discussion where specialists can collaborate, compete, and coordinate just like humans do.

About

Chain of Debate Framework - Python composable multi-agent system for structured AI debates with sequential goals and automatic moderation. Multiple expert AI personas discuss complex decisions with verdict tracking and whisper mechanics. General-purpose framework evolved from resume evaluation.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages