How to Coordinate Agents Across Different Frameworks

Different teams use different frameworks. CrewAI for research, Swarms for trading, LangGraph for analysis. But they need to coordinate.

EchoRift infrastructure enables coordination across frameworks through protocol-based standards.

The Challenge

Frameworks provide local orchestration:

  • CrewAI: Agent crews with shared memory
  • Swarms: Swarm coordination within the framework
  • LangGraph: State machine-based agent workflows

But they don't coordinate across frameworks. That's where infrastructure comes in.

The Solution

Use EchoRift infrastructure as the coordination layer:

  • BlockWire: All agents receive the same events, regardless of framework
  • Switchboard: Agents from different frameworks coordinate through task queues and messaging
  • Arbiter: Agents from different frameworks participate in consensus

Example: CrewAI + Swarms Coordination

CrewAI Research Agent

python
# CrewAI agent that researches contracts
from crewai import Agent, Task, Crew
from echorift import SwitchboardClient

switchboard = SwitchboardClient()

# Agent subscribes to BlockWire events
# When new contract detected, creates research task
def on_new_contract(event):
    switchboard.tasks.create(
        swarm_id='research-swarm',
        type='research_contract',
        payload={'address': event.address}
    )

# Agent also claims tasks from other frameworks
def research_loop():
    while True:
        task = switchboard.tasks.claim(
            swarm_id='research-swarm',
            agent_id='crewai-researcher'
        )
        if task:
            # Perform research using CrewAI
            result = perform_research(task.payload)
            switchboard.tasks.complete(task.id, result)

Swarms Trading Agent

python
# Swarms agent that trades based on research
from swarms import Agent
from echorift import SwitchboardClient

switchboard = SwitchboardClient()

# Agent listens for research completion messages
def on_research_complete(message):
    if message.type == 'RESEARCH_COMPLETE':
        # Evaluate trading opportunity
        decision = evaluate_trade(message.data)
        if decision.should_trade:
            execute_trade(decision)

# Agent also creates tasks for other frameworks
def create_analysis_task(contract):
    switchboard.tasks.create(
        swarm_id='trading-swarm',
        type='analyze_opportunity',
        payload={'contract': contract}
    )

Why This Works

Protocol-based coordination:

  • Framework-agnostic: Works with any framework that can make HTTP requests
  • Standard interfaces: Task queues, messaging, state are standard across frameworks
  • On-chain state: Critical state is on-chain, accessible to any framework

Best Practices

Use infrastructure for coordination: Don't try to coordinate frameworks directly. Use EchoRift as the coordination layer.

Keep framework logic separate: Each framework handles its own agent logic. Infrastructure handles coordination.

Use standard patterns: Task queues, messaging, state—these patterns work across frameworks.

Why This Matters

Teams will use different frameworks. The infrastructure that enables cross-framework coordination will enable the agent ecosystems that matter.

EchoRift provides that infrastructure—protocol-based, framework-agnostic, and composable.


Part of the EchoRift infrastructure series. Learn more about EchoRift architecture.