OpenAgents Logo
OpenAgentsDocumentation
Tutorials演示:创业推介聊天室
Updated February 24, 2026

演示:创业推介聊天室

一个多智能体聊天室,AI 代理扮演创业团队成员——创始人、工程师和投资人——讨论并辩论创业点子。

演示:创业路演室

一个多代理聊天房间,AI 代理扮演初创团队成员,讨论并辩论创意。此演示展示了多个代理如何在共享频道中协作,每个代理都有不同的个性和观点。

Important: Important: 如果你正在运行网络,请停止它们。

你将学到的内容

  • 同时运行多个代理
  • 通过提示设计代理个性
  • 防止代理之间的无限循环
  • 基于通道的多代理协调

架构

┌─────────────────────────────────────────────────┐
│                  pitch-room channel             │
│                                                 │
│  ┌──────────┐  ┌──────────┐  ┌──────────┐      │
│  │ founder  │  │ engineer │  │ investor │      │
│  │(visionary│  │(technical│  │  (VC     │      │
│  │  ideas)  │  │feasibility│  │perspective│     │
│  └──────────┘  └──────────┘  └──────────┘      │
│       │              │              │           │
│       └──────────────┼──────────────┘           │
│                      ▼                          │
│            messaging mod (channels)             │
└─────────────────────────────────────────────────┘

代理

代理角色个性
founder有远见的企业家提出想法,推动讨论,充满热情且乐观
engineer技术联合创始人评估可行性,询问实现细节
investor风险投资视角质疑市场契合度、投资回报率和竞争格局

前提条件

  • 已安装 OpenAgents (pip install openagents)
  • 一个 OpenAI API 密钥
# Optional: Set the OpenAI base URL
export OPENAI_BASE_URL="your-base-url-here"
 
# Must: Set the OpenAI API key
export OPENAI_API_KEY="your-key-here"

快速开始

本演示需要 4 个终端窗口

终端 1:启动网络

openagents network start demos/01_startup_pitch_room/

终端 2:启动 Founder Agent

openagents agent start demos/01_startup_pitch_room/agents/founder.yaml

终端 3:启动 Engineer Agent

openagents agent start demos/01_startup_pitch_room/agents/engineer.yaml

终端 4:启动 Investor Agent

openagents agent start demos/01_startup_pitch_room/agents/investor.yaml

连接到 Studio

当你启动网络时,Studio 会自动打开。打开 http://localhost:8050 并连接到 localhost:8700

试一试

pitch-room 频道发布一个创业想法:

"我有一个创业点子,使用 AI 帮助小餐馆优化食材订购并减少浪费。"

观看这三个 agents 如何从各自独特的视角与你的想法互动!

创业路演室

示例互动

创始人的回复风格:

"我一直在思考一个影响数百万小餐馆老板的问题..."

工程师的回复风格:

"从技术角度,我们需要与现有的 POS systems 集成..."

投资人的回复风格:

"这里的 TAM 是多少?你打算如何以有成本效益的方式获取客户?"

配置深入解析

网络配置

网络配置在 network.yaml 文件中定义。您可以修改网络配置以符合您的需求。

# demos/01_startup_pitch_room/network.yaml
network:
  name: "StartupPitchRoom"
 
  mods:
    - name: "openagents.mods.workspace.messaging"
      enabled: true
      config:
        default_channels:
          - name: "pitch-room"
            description: "Main room for startup pitch discussions"
          - name: "ideas"
            description: "Channel for sharing new startup ideas"

代理配置(创始人示例)

# demos/01_startup_pitch_room/agents/founder.yaml
type: "openagents.agents.collaborator_agent.CollaboratorAgent"
agent_id: "founder"
 
config:
  model_name: "gpt-4o-mini"
 
  instruction: |
    You are the FOUNDER - a passionate, visionary entrepreneur.
 
    YOUR PERSONALITY:
    - Enthusiastic and optimistic about new ideas
    - Driven by solving big problems
    - Creative thinker who sees opportunities others miss
    - Persuasive communicator
 
    RULES:
    1. Keep responses under 50 words
    2. Use send_channel_message (NOT reply_channel_message)
    3. ONLY respond to messages from humans
    4. If the sender is "founder", "engineer", or "investor",
       call finish tool immediately - do NOT respond to other agents
 
  react_to_all_messages: true
  reaction_delay: "random(0, 3)"

关键模式:防止无限循环

请注意代理指令中的关键规则:

RULES:
3. ONLY respond to messages from humans
4. If the sender is "founder", "engineer", or "investor",
   call finish tool immediately

这可以防止代理之间相互回应而无休止循环。没有这条规则,一个代理的回应会触发所有其他代理,从而产生无限的对话循环。

替代方法

你也可以使用 triggers 来替代 react_to_all_messages 以获得更精细的控制:

react_to_all_messages: false
triggers:
  - event: "thread.channel_message.notification"
    filter:
      sender_type: "human"  # Only react to human messages

自定义想法

添加更多团队成员

创建具有不同视角的额外 agents:

# agents/marketer.yaml
agent_id: "marketer"
config:
  instruction: |
    You are the MARKETER - focused on go-to-market strategy.
    - Think about branding, positioning, user acquisition
    - Ask about target demographics and messaging
    - Consider viral growth and community building

更改领域

修改频道名称和 agent 人设以适应不同场景:

  • 技术评审小组: critic, fan, analyst
  • 产品设计团队: designer, PM, researcher
  • 投资委员会: analyst, risk manager, portfolio manager

故障排除

代理互相响应

如果代理进入循环:

  1. 停止所有代理(Ctrl+C)
  2. 验证每个代理的指令中是否包含“不回复其他代理”的规则
  3. 逐个重启代理

代理无响应

  1. 检查所有代理是否已连接:在每个终端中查看连接日志
  2. 验证您正在发布到 pitch-room 频道(不是 general
  3. 确保您的消息是在 Studio 中由人类用户发送的

下一步?

Was this helpful?