ChatDev 2.0 (DevAll)

repository·main·Indexed 12 days ago

https://github.com/openbmb/chatdev

A zero-code multi-agent orchestration platform for defining and executing complex workflows. Transitioning from a virtual software company (v1.0) to a general-purpose system (v2.0), it supports Function and Model Context Protocol (MCP) tooling, Python SDK integration, and pre-configured workflows for data visualization, 3D generation, and deep research.

Tokens
39K
Snippets
85
Records
171
Agent score
97%

What's inside ChatDev

  1. Navigate the DevAll Backend Documentation

    main

    The DevAll backend documentation is organized by user role and functional area. Use the following map to find relevant guides:

  2. Overview of ChatDev 2.0 (DevAll) vs ChatDev 1.0 (Legacy)

    main

    ChatDev has transitioned from a specialized software development tool into a general-purpose multi-agent orchestration platform.

    • ChatDev 2.0 (DevAll): A Zero-Code Multi-Agent Platform designed for "Developing Everything". It allows users to build and execute customized multi-agent systems (e.g., for data visualization, 3D generation, or deep research) through simple configuration of agents, workflows, and tasks without writing code.
    • ChatDev 1.0 (Legacy): A Virtual Software Company paradigm. It uses specialized agents (CEO, CTO, Programmer, etc.) to automate the software development life cycle (designing, coding, testing, and documenting). This version is maintained in the chatdev1.0 branch.
  3. Understand Graph Startup and Entry Nodes

    main

    When a Graph starts, nodes connected to the start node are treated as Entry nodes (initial nodes).

    Execution Logic:

    • All Entry nodes receive the user's initial input simultaneously.
    • Entry nodes execute in parallel.
    • A workflow can have multiple Entry nodes by creating edges from the start node to multiple target nodes.
  4. Inject session context into functions via _context

    main

    The executor automatically passes a _context dictionary into your functions. This allows your tools to interact with the agent's environment.

    Available Context Keys

    KeyValue
    attachment_storeutils.attachments.AttachmentStore for querying/registering attachments
    python_workspace_rootThe session code_workspace/ shared by Python nodes
    graph_directoryThe session root directory for relative path helpers
    othersEnvironment-specific extras (session/node IDs, etc.)

    Usage Pattern

    Declare the parameter as _context: dict | None = None in your function signature. You can then parse it to access workspace paths or attachment stores.

    from typing import Annotated
    from utils.function_catalog import ParamMeta
    
    def read_text_file(
        path: Annotated[str, ParamMeta(description="workspace-relative path")],
        *,
        encoding: str = "utf-8",
        _context: dict | None = None,
    ) -> str:
        # Example of using context to resolve paths
        ctx = FileToolContext(_context)
        target = ctx.resolve_under_workspace(path)
        return target.read_text(encoding=encoding)
  5. How the Loop Counter node works and its topological requirements

    main

    The Loop Counter node acts as a circuit breaker or iteration guard. To function correctly within a graph, it must follow specific topological patterns because it suppresses all output until the limit is reached.

    Core Logic

    1. Triggered: Counter increments by 1.
    2. Counter < max_iterations: No output is produced; outgoing edges are not triggered.
    3. Counter == max_iterations: The message is produced, triggering outgoing edges.

    Required Graph Structure

    To prevent premature termination or broken loops, you must connect the nodes as follows:

    1. Human/Agent Connection: The node responsible for continuing the loop (e.g., a Human or Agent) must connect to both the loop participant (to continue the work) and the Loop Counter (to increment the count).
    2. In-Loop Connection: The Loop Counter must connect back to the node inside the loop (e.g., the Writer) so it is recognized as part of the loop cycle.
    3. Out-of-Loop Connection: The Loop Counter must connect to an End Node (outside the loop) to trigger the termination of the entire workflow once the limit is reached.

    Visual Pattern:

        ┌──────────────────────────────────────┐
        ▼                                      │
      Agent ──► Human ─────► Loop Counter ──┬──┘
        ▲         │                         │
        └─────────┘                         ▼
                                       End Node (outside loop)
  6. DevAll Backend Glossary and Core Concepts

    main

    Understanding these core terms is essential for interacting with the DevAll backend:

    • Session: A unique identifier (composed of a timestamp and name) for a single execution run, used to track data across the Web UI, backend, and WareHouse/ storage.
    • code_workspace: A shared directory located at WareHouse/<session>/code_workspace/ used by Python nodes; it is synchronized with relevant attachments.
    • Attachment: Files that are either uploaded by users or generated during a workflow run. These are accessible via REST or WebSocket APIs.
    • Memory Store / Attachment: Memory Stores are the persistence backends (e.g., simple, file, blackboard). Memory Attachments define how agent nodes interact with these stores across different execution phases.
    • Tooling: The execution environment associated with agent nodes, implemented via Function or MCP (Model Context Protocol) modes.
  7. Transfer Information using Edges and Messages

    main

    Information flows between nodes via Edges using Messages.

    Messages

    • The basic unit of information transmission, context control, and edge processing.
    • Can transmit text and multimodal information.
    • A node's input and output can consist of multiple messages.
    • The user's initial input is a single message.

    Edges

    Edges connect nodes to perform two core functions:

    1. Information Transfer: Passing the output of upstream nodes as input to downstream nodes.
    2. Execution Control: Defining execution dependencies and trigger relationships.

    Important Behavior: If an upstream node outputs multiple messages, the edge will evaluate, process, and transmit each message individually.

  8. Configure Memory for Agent Nodes

    main

    The Memory module allows Agents to retrieve and store information. It is a two-step configuration process:

    1. Declare a Memory Store at the Graph Level

    Use the Manage Memories interface in the Workflow UI to add a new Memory Store.

    Supported Memory Types:

    TypeFeaturesUse CaseRequires Embedding
    simpleVector search + semantic reranking; supports read/writeDialogue memory, rapid prototypingYes
    fileSlices files/directories into vector indices; read-onlyKnowledge bases, document Q&AYes
    blackboardSimple log trimmed by time/count; no vectorsBroadcast boardNo

    Note: simple and file types require an Embedding Provider (e.g., OpenAI text-embedding-3-small).

    2. Attach Memory to an Agent Node

    In the Agent node configuration, use Memory Attachments to select a store and configure:

    • Read/Write: Control if the node can read from or write to the memory.
    • Top K: Number of items to retrieve.
    • Retrieve Stage: When to perform retrieval (e.g., Gen Stage).
  9. Extend DevAll as a developer

    main

    DevAll is built with a modular architecture designed for extensibility. You can enhance the system by extending nodes, Providers, and tools.

    Core Modules:

    • server/: FastAPI backend.
    • runtime/: Agent abstractions and tool execution.
    • workflow/: Multi-agent logic.
    • entity/: Configuration files.
    • frontend/: Vue 3 Web Console.
    • functions/: Custom Python tools.

    Reference Documentation:

  10. How the Human Node blocking mechanism works

    main

    The Human node implements a Blocking Wait Mechanism to facilitate human-in-the-loop workflows:

    1. Pause: When the workflow reaches a Human node, execution stops.
    2. Display: The Web UI displays the current execution context and the node's description.
    3. Input: The user enters a response (text or file attachments) in the interface.
    4. Resume: Once submitted, the workflow resumes, passing the user's input to the next downstream node in the graph.
  11. Understand the DevAll Backend Architecture and Execution Flow

    main

    DevAll operates as a workflow orchestration engine that parses YAML DAGs and coordinates various node types (model, python, tooling, and human) within a shared context.

    Execution Lifecycle

    1. Entry: Requests enter via the FastAPI server (e.g., server_main.py) through endpoints like /api/workflow/execute.
    2. Validation & Setup: WorkflowRunService validates the YAML, initializes a unique Session, and prepares the code_workspace/attachments/ directories.
    3. Execution: The scheduler in workflow/ resolves dependencies. Node executors manage context propagation, tool calls, and memory retrieval via MemoryManager, ToolingConfig, and ThinkingManager.
    4. Observability: Real-time updates (node states, stdout/stderr, artifact events) are streamed via WebSockets to the UI. Structured JSON logs are stored in logs/.
    5. Asset Management: All run assets (attachments, Python workspace, context snapshots) are stored in WareHouse/<session>/ and can be downloaded via Attachment APIs.