Skip to content

YUHAO-corn/pm-agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PM Agent 🚀

从产品想法到完整文档,一键生成 | From idea to complete product documentation in one command

English | 中文


中文

简介

PM Agent 是一个基于 Google ADK 构建的多 Agent 产品经理助手。输入你的产品想法,它会自动生成一套完整的产品文档,包括市场研究、用户画像、功能列表、线框图和交互流程图。

核心特性

  • 层级化多 Agent 架构 - 三层嵌套设计:路由层 → 访谈层 → 文档生成流水线
  • 智能访谈机制 - 通过多轮结构化问答收集产品信息,动态判断何时启动生成
  • 真实市场研究 - 集成 Google Search,获取真实的市场数据和竞品信息
  • 可视化输出 - 自动生成线框图 HTML、Mermaid 流程图、产品定位矩阵
  • 结构化文档 - 输出专业的 Markdown 文档,可直接用于团队协作

架构

三层嵌套的多 Agent 系统 (Hierarchical Multi-Agent Architecture)

┌─────────────────────────────────────────────────────────────────────────┐
│  Root Agent (PMAgent)                                                   │
│  ┌───────────────────────────────────────────────────────────────────┐  │
│  │  智能路由:判断用户意图                                            │  │
│  │  • 普通问题 → 直接回答                                             │  │
│  │  • 产品想法 → 转发给 InterviewAgent                                │  │
│  └───────────────────────────────────────────────────────────────────┘  │
│         │                                                               │
│         ▼ transfer_to_agent                                             │
│  ┌───────────────────────────────────────────────────────────────────┐  │
│  │  Interview Agent                                                   │  │
│  │  ┌─────────────────────────────────────────────────────────────┐  │  │
│  │  │  多轮访谈:结构化问答收集产品信息                             │  │  │
│  │  │  • 动态判断信息是否充足                                       │  │  │
│  │  │  • 信息充足 → 触发文档生成流水线                              │  │  │
│  │  └─────────────────────────────────────────────────────────────┘  │  │
│  │         │                                                          │  │
│  │         ▼ transfer_to_agent (when ready)                           │  │
│  │  ┌─────────────────────────────────────────────────────────────┐  │  │
│  │  │  PM Document Pipeline (SequentialAgent)                      │  │  │
│  │  │                                                              │  │  │
│  │  │  DecisionList → MarketResearch → UserResearch →              │  │  │
│  │  │  ProductPositioning → FeatureList → Wireframe →              │  │  │
│  │  │  InteractionFlow → ProductSummary                            │  │  │
│  │  │                                                              │  │  │
│  │  └─────────────────────────────────────────────────────────────┘  │  │
│  └───────────────────────────────────────────────────────────────────┘  │
└─────────────────────────────────────────────────────────────────────────┘

设计亮点

  • 层级化 Agent 架构 - 而非简单的线性流水线,实现关注点分离
  • 智能路由 - Root Agent 根据用户意图动态决策
  • 访谈机制 - 通过多轮结构化问答收集信息,而非一次性输入
  • 动态触发 - Interview Agent 判断信息充足后才启动文档生成
  • 上下文传递 - 各 Agent 通过 output_key 共享状态,下游 Agent 可访问上游所有输出

Agent 流程

阶段 Agent 功能 输出
1 DecisionListAgent 整理用户想法为结构化决策列表 decision_list.md
2 MarketResearchAgent 市场规模、竞品分析、行业趋势 market_research.md
3 UserResearchAgent 用户画像、用户故事、验收标准 user_research.md
4 ProductPositioningAgent 产品定位、差异化策略、定位矩阵图 product_positioning.md
5 FeatureListAgent 功能规格、模块依赖图 feature_list.md
6 WireframeAgent 核心界面黑白线框图 wireframe.html
7 InteractionFlowAgent 关键交互时序图 interaction_flow.png
8 ProductSummaryAgent 产品摘要、最终报告 final_report.html

技术栈

  • 框架: Google ADK (Agent Development Kit)
  • 模型: Gemini 2.5 Flash / Gemini 3 Flash Preview
  • 搜索: Google Search API (市场研究)
  • 图表: Mermaid (via mermaid.ink API)
  • 运行时: Python 3.10+

快速开始

# 1. 克隆项目
git clone https://github.com/YUHAO-corn/pm-agent.git
cd pm-agent

# 2. 安装依赖
pip install -r pm_agent/requirements.txt

# 3. 配置环境变量
cp pm_agent/.env.example pm_agent/.env
# 编辑 .env 填入你的 Google Cloud 配置

# 4. 运行
adk web pm_agent

环境配置

需要配置 Google Cloud Vertex AI:

# pm_agent/.env
GOOGLE_GENAI_USE_VERTEXAI=1
GOOGLE_CLOUD_PROJECT=your-project-id
GOOGLE_CLOUD_LOCATION=global

输出示例

运行后会在 pm_agent/outputs/<project_name>/ 下生成:

outputs/
└── your-product/
    ├── decision_list.md          # 决策列表
    ├── market_research.md        # 市场研究报告
    ├── user_research.md          # 用户研究文档
    ├── product_positioning.md    # 产品定位文档
    ├── feature_list.md           # 功能列表
    ├── wireframe.html            # 线框图
    ├── positioning_matrix.png    # 定位矩阵图
    ├── interaction_flow.png      # 交互流程图
    └── final_report.html         # 最终报告

English

Introduction

PM Agent is a multi-agent product manager assistant built with Google ADK. Input your product idea, and it automatically generates a complete set of product documentation including market research, user personas, feature lists, wireframes, and interaction flow diagrams.

Key Features

  • Hierarchical Multi-Agent Architecture - Three-layer nested design: Routing → Interview → Document Pipeline
  • Smart Interview Mechanism - Collects product info through multi-round structured Q&A, dynamically decides when to start generation
  • Real Market Research - Integrated with Google Search for real market data and competitor analysis
  • Visual Outputs - Auto-generates wireframe HTML, Mermaid diagrams, positioning matrices
  • Structured Documentation - Professional Markdown documents ready for team collaboration

Architecture

Three-Layer Hierarchical Multi-Agent System

┌─────────────────────────────────────────────────────────────────────────┐
│  Root Agent (PMAgent)                                                   │
│  ┌───────────────────────────────────────────────────────────────────┐  │
│  │  Smart Routing: Determine user intent                             │  │
│  │  • General questions → Answer directly                            │  │
│  │  • Product ideas → Transfer to InterviewAgent                     │  │
│  └───────────────────────────────────────────────────────────────────┘  │
│         │                                                               │
│         ▼ transfer_to_agent                                             │
│  ┌───────────────────────────────────────────────────────────────────┐  │
│  │  Interview Agent                                                   │  │
│  │  ┌─────────────────────────────────────────────────────────────┐  │  │
│  │  │  Multi-round Interview: Structured Q&A to collect info       │  │  │
│  │  │  • Dynamically assess if info is sufficient                  │  │  │
│  │  │  • When ready → Trigger document generation pipeline         │  │  │
│  │  └─────────────────────────────────────────────────────────────┘  │  │
│  │         │                                                          │  │
│  │         ▼ transfer_to_agent (when ready)                           │  │
│  │  ┌─────────────────────────────────────────────────────────────┐  │  │
│  │  │  PM Document Pipeline (SequentialAgent)                      │  │  │
│  │  │                                                              │  │  │
│  │  │  DecisionList → MarketResearch → UserResearch →              │  │  │
│  │  │  ProductPositioning → FeatureList → Wireframe →              │  │  │
│  │  │  InteractionFlow → ProductSummary                            │  │  │
│  │  │                                                              │  │  │
│  │  └─────────────────────────────────────────────────────────────┘  │  │
│  └───────────────────────────────────────────────────────────────────┘  │
└─────────────────────────────────────────────────────────────────────────┘

Design Highlights

  • Hierarchical Agent Architecture - Not a simple linear pipeline; separates concerns across layers
  • Smart Routing - Root Agent dynamically decides based on user intent
  • Interview Mechanism - Collects info through multi-round structured Q&A, not one-shot input
  • Dynamic Triggering - Interview Agent decides when to start document generation
  • Context Propagation - Agents share state via output_key; downstream agents can access all upstream outputs

Agent Pipeline

Stage Agent Function Output
1 DecisionListAgent Organizes user ideas into structured decision list decision_list.md
2 MarketResearchAgent Market size, competitor analysis, industry trends market_research.md
3 UserResearchAgent User personas, user stories, acceptance criteria user_research.md
4 ProductPositioningAgent Product positioning, differentiation strategy product_positioning.md
5 FeatureListAgent Feature specifications, module dependencies feature_list.md
6 WireframeAgent Black-and-white wireframes for key screens wireframe.html
7 InteractionFlowAgent Sequence diagrams for key interactions interaction_flow.png
8 ProductSummaryAgent Product summary, final report final_report.html

Tech Stack

  • Framework: Google ADK (Agent Development Kit)
  • Models: Gemini 2.5 Flash / Gemini 3 Flash Preview
  • Search: Google Search API (for market research)
  • Diagrams: Mermaid (via mermaid.ink API)
  • Runtime: Python 3.10+

Quick Start

# 1. Clone the repository
git clone https://github.com/YUHAO-corn/pm-agent.git
cd pm-agent

# 2. Install dependencies
pip install -r pm_agent/requirements.txt

# 3. Configure environment variables
cp pm_agent/.env.example pm_agent/.env
# Edit .env with your Google Cloud configuration

# 4. Run
adk web pm_agent

Configuration

Requires Google Cloud Vertex AI setup:

# pm_agent/.env
GOOGLE_GENAI_USE_VERTEXAI=1
GOOGLE_CLOUD_PROJECT=your-project-id
GOOGLE_CLOUD_LOCATION=global

Output Example

After running, outputs are generated in pm_agent/outputs/<project_name>/:

outputs/
└── your-product/
    ├── decision_list.md          # Decision list
    ├── market_research.md        # Market research report
    ├── user_research.md          # User research document
    ├── product_positioning.md    # Product positioning
    ├── feature_list.md           # Feature list
    ├── wireframe.html            # Wireframes
    ├── positioning_matrix.png    # Positioning matrix
    ├── interaction_flow.png      # Interaction flow diagram
    └── final_report.html         # Final report

License

MIT License

About

Multi-agent product manager assistant built with Google ADK

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors