Skip to content

Create

The ag2 create command generates boilerplate for common AG2 patterns.

ag2 create project#

Scaffold a full project with directory structure, dependencies, and starter code.

ag2 create project <name> [--template <template>]

Built-in templates: blank, research-team, rag-chatbot

ag2 create project my-app --template research-team

This generates:

my-app/
├── pyproject.toml
├── main.py
├── agents/
├── tools/
├── config/
└── tests/

ag2 create agent#

Generate a single agent file with system message and optional tool wiring.

ag2 create agent <name> [--tools <tool1,tool2>]
ag2 create agent researcher --tools web_search,summarize

ag2 create tool#

Create a tool function with the @tool decorator and proper typing.

ag2 create tool <name>
ag2 create tool web_search

ag2 create team#

Generate a multi-agent team with a specified orchestration pattern.

ag2 create team <name> [--pattern <pattern>]

Patterns: auto, round-robin, random

ag2 create team research-squad --pattern round-robin

ag2 create artifact#

Scaffold a publishable artifact with artifact.json and the required directory structure.

ag2 create artifact <name> --type <type>

Types: template, tool, dataset, agent, skills, bundle

ag2 create artifact my-tool --type tool

This creates the structure needed for ag2 publish.