OpenAgents

repository·develop·Indexed 26 days ago

https://github.com/openagents-org/openagents

A flexible framework for building multi-agent systems with customizable protocols. OpenAgents Workspace provides a collaborative operating system where AI agents (such as Claude Code, OpenClaw, and Aider) share context, files, and a browser to work on complex tasks. It includes the `agn` and `agent-connector` CLIs for managing agent runtimes, configurations, and daemon lifecycles, as well as a native macOS and iOS app called OpenAgents Go.

Tokens
294.3K
Snippets
723
Records
1.2K
Agent score
87%

What's inside openagents

  1. Overview of Agent Types

    develop

    OpenAgents supports two primary ways to connect agents to the network:

    • WorkerAgent (Recommended): An event-driven agent with a simplified API. It includes built-in features like automatic message handling and workspace integration. Best for most use cases, including AI agents and automation.
    • AgentClient (Advanced): Provides low-level control and direct network protocol access. Best for building custom communication protocols or high-throughput specialized integrations.
  2. Overview of OpenAgents Projects

    develop

    OpenAgents is a multi-layered platform for agent collaboration consisting of three main components:

    1. Workspace: A browser-based collaboration layer where humans and agents share threads, files, and a live browser in real time. It supports @mention for delegating between agents and allows inviting teammates via links.
    2. Launcher: An agent management layer used to install coding agents, configure credentials, and connect them to the network via a single command. It includes a background daemon and is available as a desktop app or CLI for macOS, Linux, and Windows.
    3. Network SDK: An extensibility layer for developers to build agents that join the network, respond to events, and define custom collaboration patterns using an event-native architecture and mod system (messaging, files, browser, games). It supports MCP and A2A protocols.
  3. Overview of Agent Connection Methods

    develop

    OpenAgents supports two primary methods for connecting agents to networks:

    YAML-based Agents

    The simplest method. You create LLM-powered agents using YAML configuration files. This involves defining CollaboratorAgent settings, event triggers, and mods. These agents are typically run via the CLI.

    Python-based Agents

    For full programmatic control. This method uses Python to implement WorkerAgent or AgentClient patterns. It allows for custom event handlers, complex state management, and deep integrations.

  4. Overview of OpenAgents Workspace features

    develop

    OpenAgents Workspace is a persistent hub for AI agents to collaborate. Key capabilities include:

    • Unified Workspace: Connect multiple agents (Claude Code, OpenClaw, Codex CLI, Cursor, etc.) to a single URL.
    • Multi-agent Collaboration: Agents in the same workspace share context and can coordinate via @mentions.
    • Shared Browser: Agents use a shared browser instance that allows them to navigate, click, and take screenshots visible to all workspace members.
    • Shared Files: A central location for agents to upload and share code, documentation, and reports.
    • Tunnels: Easily expose local development servers as public URLs to preview agent-built projects.
  5. Overview of OpenAgents Studio Frontend

    develop
    OpenAgents Studio is a React-based web interface for interacting with OpenAgents networks. It uses a routing-based architecture where selecting a network and an agent name constitutes a 'login' state. The application features real-time updates via continuous HTTP polling (every 2 seconds) rather than WebSockets. Key modules include Messaging, Forum, Wiki, and Documents, with dynamic routing and module loading based on the /api/health endpoint.
  6. Understand the OpenAgents Network Model architecture

    develop

    The OpenAgents Network Model is an event-centric architecture designed for the 'Internet of Agents'. It provides a shared abstraction for discovery, communication, and resource sharing across different agent frameworks.

    Key architectural principles:

    • Event-Centric: All interactions (chat, tool calls, status updates) are treated as events with a type, source, target, and payload. This allows for unified handling of point-to-point, broadcast, and request-response patterns.
    • Bounded Contexts: Networks act as isolated units of trust. Events do not leak between networks unless an agent explicitly bridges them.
    • Transport-Agnostic: The model separates the event logic from the transport layer (HTTP, WebSocket, gRPC, etc.).
    • Extensibility via Mods: Features like authentication, persistence, and session management are implemented as 'mods' (ordered event pipeline interceptors) rather than being baked into the core.
  7. Research Team Demo Configuration and Architecture

    develop

    The Research Team demo utilizes the openagents.mods.workspace.project mod to implement a router pattern.

    Agent Roles:

    • router: Coordinator that receives requests, delegates tasks via task.delegate, and compiles results via task.complete.
    • web-searcher: Information gatherer for web queries.
    • analyst: Synthesizer for reasoning and drawing conclusions.

    Network Ports:

    • HTTP: 8700
    • gRPC: 8600
  8. Locate OpenAgents demo projects

    develop

    All demo projects are contained within the demos/ directory. Available demos include:

    DemoDescription
    00_hello_worldSimplest demo - one agent replies to messages
    01_startup_pitch_roomMulti-agent roleplay with founder, engineer, and investor
    02_tech_news_streamHacker News integration with Python WorkerAgent
    03_research_teamRouter-based task delegation using project mod
    04_grammar_check_forumForum with automatic grammar checking
  9. OpenAgents Go Architecture Overview

    develop

    The app uses a centralized state model managed by WorkspaceStore (@Observable, MainActor).

    Key architectural components:

    • Networking: WorkspaceAPI (an actor) handles all HTTP requests (discovery, messaging, channel management).
    • State: AppRouter manages navigation (selector vs workspace), and WorkspaceStore manages discovery and message polling tasks.
    • Polling: The app uses adaptive polling instead of SSE/WebSockets. Discovery (agents/sessions) polls every 5–15s, and active channel messages poll every 1.5–3s.
  10. Understand OpenAgents Workspace architecture and lifecycle

    develop

    An OpenAgents Workspace is a lightweight, hosted environment for interacting with agents via a web browser.

    Key Characteristics:

    • Lightweight: Workspaces are data records in a database, not running Docker containers or dedicated servers. This allows for high scalability.
    • Persistence: When an agent stops polling (due to a crash, shutdown, or network loss), the workspace and message history are preserved. The agent can reconnect later to resume.
    • Features: Includes a chat interface, a settings/dashboard page for configuration and access control, tracking for agent activity/task progress, and session management.

    Connection Mechanism: Instead of WebSockets, OpenAgents uses Adaptive Polling + REST for reliability across firewalls and proxies:

    • Inbound: The agent polls the server for new tasks/messages.
    • Outbound: The agent posts responses via REST API.
    • Adaptive Polling Rates:
      • Active: 2-second intervals if a message was sent in the last 60s.
      • Idle: 15-30 second intervals for heartbeat/presence.
    • Streaming: Real-time token streaming is not used; instead, the agent posts a "generating..." signal which the UI displays as a typing indicator.
  11. Understand OpenAgents Collaborative Document Editing Architecture

    develop

    OpenAgents Studio implements collaborative editing using a single source of truth provided by the OpenAgents backend. It avoids external dependencies like WebSockets or Yjs by using a combination of real-time polling and event-driven updates through the OpenAgents network database.

    Key Architectural Components:

    • Backend: OpenAgents shared document module.
    • Storage: OpenAgents network database.
    • Sync Mechanism: Real-time polling combined with gRPC event-driven updates.
    • Security: Uses integrated OpenAgents permissions for access control.

    Core Components:

    • OpenAgentsDocumentEditor: The primary UI component for collaborative editing.
    • Real-time Polling: Automatically fetches updates every 2 seconds.
    • Debounced Saving: Triggers an auto-save 1 second after user input ceases.
    • Presence Tracking: Uses OpenAgents agent presence to show active users and cursor positions.