Skip to content

Commit 363d33f

Browse files
committed
updates
1 parent 0791b64 commit 363d33f

File tree

2 files changed

+327
-39
lines changed

2 files changed

+327
-39
lines changed

content/manuals/ai/cagent/_index.md

Lines changed: 161 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,19 @@ params:
88
keywords: [ai, agent, cagent]
99
---
1010

11-
`cagent` is lets you build, orchestrate, and share AI agents. Use it to build AI
12-
agents that can work as a team. Build a root agent that can delegate
13-
tasks to sub-agents. Each agent can use the model of your choice, with the
14-
parameters of your choice.
11+
cagent lets you build, orchestrate, and share AI agents. Use it to define AI
12+
agents that work as a team.
13+
14+
cagent relies on the concept of a _root agent_ that acts as a team lead and
15+
delegates tasks to the sub-agents you define.
16+
Each agent:
17+
- uses the model of your choice, with the parameters of your choice.
18+
- has access to the [built-in tools](#built-in-tools) and MCP servers
19+
configured in the [Docker MCP gateway](/manuals/ai/mcp-gateway.md).
20+
- works in its own context. They do not share knowledge.
21+
22+
The root agent is your main contact point. Each agent has its own context,
23+
they do not share knowledge.
1524

1625
## Key features
1726

@@ -30,78 +39,101 @@ parameters of your choice.
3039
for your operating system.
3140

3241
> [!NOTE]
33-
> You may need to give the release executable permissions.
34-
> On MacOS and Linux, do so by running:
42+
> You might need to give the binary executable permissions.
43+
> On macOS and Linux, run:
3544
3645
```console
3746
chmod +x /path/to/downloads/cagent-linux-<arm/amd>64
3847
```
3948

49+
> [!NOTE]
50+
> You can also build cagent from the source. See the [repository](https://github.com/docker/cagent?tab=readme-ov-file#build-from-source).
51+
4052
1. Optional: Rename the binary as needed and update your PATH to include
4153
cagent's executable.
4254

4355
1. Set the following environment variables:
4456

4557
```bash
46-
# If using the Docker AI Gateway, set this env var or use
47-
# the `--models-gateway url_to_docker_ai_gateway` CLI flag
58+
# If using the Docker AI Gateway, set this environment variable or use
59+
# the `--models-gateway <url_to_docker_ai_gateway>` CLI flag
4860

49-
export CAGENT_MODELS_GATEWAY=url_to_docker_ai_gateway
61+
export CAGENT_MODELS_GATEWAY=<url_to_docker_ai_gateway>
5062

51-
# Alternatively, you to need set keys for remote inference services
52-
# These are not needed if you are using Docker AI Gateway
63+
# Alternatively, set keys for remote inference services.
64+
# These are not needed if you are using Docker AI Gateway.
5365

54-
export OPENAI_API_KEY=your_api_key_here # For OpenAI models
55-
export ANTHROPIC_API_KEY=your_api_key_here # For Anthopic models
56-
export GOOGLE_API_KEY=your_api_key_here # For Gemini models
66+
export OPENAI_API_KEY=<your_api_key_here> # For OpenAI models
67+
export ANTHROPIC_API_KEY=<your_api_key_here> # For Anthropic models
68+
export GOOGLE_API_KEY=<your_api_key_here> # For Gemini models
5769
```
5870

5971
1. Create an agent by saving this sample as `assistant.yaml`:
6072

6173
```yaml {title="assistant.yaml"}
6274
agents:
63-
root:
64-
model: openai/gpt-5-mini
65-
description: A helpful AI assistant
66-
instruction: |
67-
You are a knowledgeable assistant that helps users with various tasks.
68-
Be helpful, accurate, and concise in your responses.
69-
```
75+
root:
76+
model: openai/gpt-5-mini
77+
description: A helpful AI assistant
78+
instruction: |
79+
You are a knowledgeable assistant that helps users with various tasks.
80+
Be helpful, accurate, and concise in your responses.
81+
```
7082
7183
1. Start your prompt with your agent:
7284
7385
```bash
74-
cagent run my-agent.yaml
86+
cagent run assistant.yaml
7587
```
7688

7789
## Create an agentic team
7890

91+
You can use AI prompting to generate a team of agents with the `cagent new`
92+
command:
93+
94+
```console
95+
$ cagent new
96+
97+
For any feedback, please visit: https://docker.qualtrics.com/jfe/form/SV_cNsCIg92nQemlfw
98+
99+
Welcome to cagent! (Ctrl+C to exit)
100+
101+
What should your agent/agent team do? (describe its purpose):
102+
103+
> I need a cross-functional feature team. The team owns a specific product
104+
feature end-to-end. Include the key responsibilities of each of the roles
105+
involved (engineers, designer, product manager, QA). Keep the description
106+
short, clear, and focused on how this team delivers value to users and the business.
107+
```
108+
109+
Alternatively, you can write your configuration file by hand. For example:
110+
79111
```yaml {title="agentic-team.yaml"}
80112
agents:
81113
root:
82114
model: claude
83115
description: "Main coordinator agent that delegates tasks and manages workflow"
84116
instruction: |
85117
You are the root coordinator agent. Your job is to:
86-
1. Understand user requests and break them down into manageable tasks
87-
2. Delegate appropriate tasks to your helper agent
88-
3. Coordinate responses and ensure tasks are completed properly
89-
4. Provide final responses to the user
118+
1. Understand user requests and break them down into manageable tasks.
119+
2. Delegate appropriate tasks to your helper agent.
120+
3. Coordinate responses and ensure tasks are completed properly.
121+
4. Provide final responses to the user.
90122
When you receive a request, analyze what needs to be done and decide whether to:
91-
- Handle it yourself if it's simple
92-
- Delegate to the helper agent if it requires specific assistance
93-
- Break complex requests into multiple sub-tasks
123+
- Handle it yourself if it's simple.
124+
- Delegate to the helper agent if it requires specific assistance.
125+
- Break complex requests into multiple sub-tasks.
94126
sub_agents: ["helper"]
95127

96128
helper:
97129
model: claude
98130
description: "Assistant agent that helps with various tasks as directed by the root agent"
99131
instruction: |
100132
You are a helpful assistant agent. Your role is to:
101-
1. Complete specific tasks assigned by the root agent
102-
2. Provide detailed and accurate responses
103-
3. Ask for clarification if tasks are unclear
104-
4. Report back to the root agent with your results
133+
1. Complete specific tasks assigned by the root agent.
134+
2. Provide detailed and accurate responses.
135+
3. Ask for clarification if tasks are unclear.
136+
4. Report back to the root agent with your results.
105137
106138
Focus on being thorough and helpful in whatever task you're given.
107139
@@ -112,12 +144,102 @@ models:
112144
max_tokens: 64000
113145
```
114146
115-
[See the reference documentation](https://github.com/docker/cagent/blob/main/docs/user-guide.md#configuration-reference).
147+
[See the reference documentation](https://github.com/docker/cagent?tab=readme-ov-file#-configuration-reference).
148+
149+
## Built-in tools
150+
151+
cagent includes a set of built-in tools that enhance your agents' capabilities.
152+
You do not need to configure any external MCP tools to use them.
153+
154+
```yaml
155+
agents:
156+
root:
157+
# ... other config
158+
toolsets:
159+
- type: todo
160+
- type: transfer_task
161+
```
162+
163+
### Think tool
164+
165+
The think tool allows agents to reason through problems step by step:
166+
167+
```yaml
168+
agents:
169+
root:
170+
# ... other config
171+
toolsets:
172+
- type: think
173+
```
174+
175+
### Todo tool
176+
177+
The todo tool helps agents manage task lists:
178+
179+
```yaml
180+
agents:
181+
root:
182+
# ... other config
183+
toolsets:
184+
- type: todo
185+
```
186+
187+
### Memory tool
188+
189+
The memory tool provides persistent storage:
190+
191+
```yaml
192+
agents:
193+
root:
194+
# ... other config
195+
toolsets:
196+
- type: memory
197+
path: "./agent_memory.db"
198+
```
199+
200+
### Task transfer tool
201+
202+
The task transfer tool is an internal tool that allows an agent to delegate a task
203+
to sub-agents. To prevent an agent from delegating work, make sure it does not have
204+
sub-agents defined in its configuration.
205+
206+
### Using tools via the Docker MCP Gateway
207+
208+
If you use the [Docker MCP gateway](/manuals/ai/mcp-gateway.md),
209+
you can configure your agent to interact with the
210+
gateway and use the MCP servers configured in it. See [docker mcp
211+
gateway run](/reference/cli/docker/mcp/gateway/gateway_run.md).
212+
213+
For example, to enable an agent to use Duckduckgo via the MCP Gateway:
214+
215+
```yaml
216+
toolsets:
217+
- type: mcp
218+
command: docker
219+
args: ["mcp", "gateway", "run", "--servers=duckduckgo"]
220+
```
221+
222+
## Share your agents
223+
224+
Agent configurations can be packaged and shared via Docker Hub.
225+
Before you start, make sure you have a [Docker repository](/manuals/docker-hub/repos/create.md).
226+
227+
To push an agent:
228+
229+
```bash
230+
cagent push ./<agent-file>.yaml <namespace>/<reponame>
231+
```
232+
233+
To pull an agent:
234+
235+
```bash
236+
cagent pull <namespace>/<reponame>
237+
```
116238

117-
## Learn more about cagent
239+
The agent's configuration file is named `<namespace>_<reponame>.yaml`. Run
240+
it with the `cagent run <filename>` command.
118241

119-
For more information, see the following documentation in the
120-
[GitHub repository](https://github.com/docker/cagent):
242+
## Related pages
121243

122-
- [User guide](https://github.com/docker/cagent/blob/main/docs/user-guide.md)
123-
- [Configuration reference](https://github.com/docker/cagent/blob/main/docs/user-guide.md#configuration-reference)
244+
For more information about cagent, see the
245+
[GitHub repository](https://github.com/docker/cagent).

0 commit comments

Comments
 (0)