菜单

AutoGPT 平台

相关源文件

AutoGPT 平台是一个强大的系统,它允许用户通过一种可视化的、基于图形的方法来创建、部署和管理连续的 AI 代理,以自动化复杂的工。本页面提供有关平台架构、关键组件和执行模型的技术概述。

有关经典 AutoGPT 实现的信息,请参阅 经典 AutoGPT

平台概述

AutoGPT 平台允许用户通过连接各种功能块来直观地构建 AI 自动化工作流。每个工作流(代理)都表示为一个有向图,其中

  • 节点代表单个操作或计算
  • 代表节点之间的数据流
  • 为每个节点提供底层功能

该平台由两部分组成

  1. 前端:一个基于 React 的 Web 应用程序,用于构建和管理代理
  2. 后端:一个 FastAPI 服务器,用于执行代理和管理用户数据

来源

架构概述

AutoGPT 平台在前端用户界面和后端执行引擎之间具有清晰的划分。这种架构使用户能够通过直观的界面构建复杂的 AI 工作流,而后端则负责执行、状态管理和与外部服务的集成。

来源

图系统

AutoGPT 平台的核心是其基于图形的代理模型。每个代理都定义为一个有向图,其中包含执行特定操作的节点,以及定义数据流的边。

Graph Data Model

The graph system is built on these key entities

此模型表示系统中代理图的结构。每个图包含节点,节点通过链接连接。图是版本化的,允许用户创建同一代理的多个版本。

来源

块系统

Block System 提供用户可以在代理图中使用的构建块(节点类型)。每个块都有定义的输入和输出模式,并实现特定的功能。

Blocks are categorized into several types

  • Input Blocks: Collect user input for the agent
  • Output Blocks: Return results to the user
  • AI Blocks: Interact with language models
  • Tool Blocks: Implement various utility functions
  • Webhook Blocks: Respond to external events
  • Agent Blocks: Embed other agents within the graph

Each block has a well-defined schema for its inputs and outputs, ensuring type safety and validation throughout the execution process.

来源

执行引擎

Execution Engine 负责处理代理图并按正确的顺序执行节点,管理数据流经图。

执行流程

When a user runs an agent, the following process takes place

This execution model allows for parallelism where possible, while ensuring data dependencies are respected. The system tracks the state of each node execution and manages the flow of data between nodes.

来源

Node Execution Process

The node execution process is the core of the execution engine

During execution, the engine

  1. Retrieves the node data from the database
  2. Validates the input data against the node's schema
  3. Executes the block's functionality
  4. Processes the outputs and determines which nodes to execute next
  5. Updates the execution status in the database

来源

前端架构

The frontend of the AutoGPT Platform is built using Next.js and React, providing a visual interface for building and running agents.

Agent Builder (Graph Editor)

The Agent Builder is a visual graph editor that allows users to create and modify agent workflows. It uses ReactFlow to create a canvas where users can

  1. Add nodes from the available blocks
  2. Connect nodes to define data flow
  3. Configure node parameters
  4. Save and test the agent

The Agent Builder provides an intuitive interface for visualizing and constructing complex agent workflows, with real-time validation and feedback.

来源

Execution UI

The Execution UI provides a real-time view of an agent's execution, showing

  • Current execution status
  • Node execution progress
  • Outputs from each node
  • Final agent results

The UI connects to the backend via WebSockets to receive real-time updates as the agent executes.

来源

后端架构

The backend of the AutoGPT Platform is built using FastAPI and provides a range of services for executing agents and managing user data.

API服务器

The API Server provides RESTful endpoints for

  • Creating and managing agents
  • Executing agents
  • Managing user data and integrations
  • Handling authentication and authorization

The API Server acts as the central point for all client interactions with the platform.

来源

WebSocket 服务器

The WebSocket Server provides real-time event streaming for agent executions, allowing the frontend to update as the agent runs.

来源

数据库 Schema

The platform uses PostgreSQL with Prisma as the ORM layer. Key database models include

Model Name描述
用户Stores user data and preferences
AgentGraphDefines an agent graph structure
AgentNodeIndividual nodes within a graph
AgentNodeLinkConnections between nodes
AgentBlockBlock definitions for node types
AgentGraphExecutionExecution instance of a graph
AgentNodeExecutionExecution instance of a node
LibraryAgentUser's personal library of agents
StoreListingMarketplace listings for agents

The schema is designed to efficiently store and query agent definitions and execution data.

来源

集成系统

The platform includes a robust integration system to connect with external services and APIs.

Credentials Management

The platform securely stores and manages user credentials for various services

  • API keys for LLM providers (OpenAI, Anthropic, etc.)
  • OAuth2 tokens for third-party services
  • Webhook authentication

来源

Webhook System

The platform supports webhook-triggered agents that can respond to external events

  1. External systems send events to webhook endpoints
  2. The webhook system routes events to the appropriate agent
  3. The agent executes in response to the event

This enables agents to integrate with external systems and respond to events in real-time.

来源

Credit System

该平台包含一个基于信用额的计费系统,该系统会向用户收取代理执行费用。每次块执行都会根据其资源使用情况产生费用。

信用额系统确保了平台使用的公平计费,同时为用户提供了透明度。

来源

通知系统

该平台包含一个通知系统,用于让用户了解代理活动。

  • 代理运行完成
  • 执行失败
  • 信用额余额不足
  • 系统公告

通知可以通过电子邮件或应用内消息发送。

来源

总结

AutoGPT平台通过视觉化的图表界面提供了一个构建和运行AI代理的综合系统。其架构结合了用户友好的前端和强大的后端执行引擎,使用户无需编码即可创建复杂的AI工作流。

该平台的主要特点包括:

  • 用于构建代理的可视化图表编辑器
  • 用于定义功能的块状系统
  • 用于运行代理的高效执行引擎
  • 与各种外部服务集成
  • 基于信用额的计费以实现公平使用
  • 实时通知和监控

该平台模块化设计允许通过新的块类型和集成轻松扩展,使其成为AI代理开发的灵活基础。