You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 25, 2026. It is now read-only.
Repository navigation
Commit e3198d2
Browse filesBrowse the repository at this point in the historyBrowse files
* Update Guides and Python API reference
* More Guides, API ref updates
- Add `vector.get()` usage to API reference, examples in Guides
- Fix code formatting for Vector DB guide
- Clean up Guides headings
- Fix Python agent communication examples (should use `get_agent`)
* CodeRabbit suggestions
* More fixes
* Update Object Storage examples
* Add full metadata back to examples
* More fixes
* Fix Python log info, agent logging guide
* Implement suggestions
In most advanced agentic scenarios, agents need to communicate with other agents to achieve their goals.
13
-
14
-
In fact, our recommendation is that you build agents with highly specialized roles and skills and use agent-to-agent communication to achieve the overall goal.
12
+
In most advanced agentic scenarios, agents need to communicate with other agents to achieve their goals. In fact, our recommendation is that you build agents with highly specialized roles and skills and use agent-to-agent communication to achieve the overall goal.
15
13
16
14
There are a number of ways to achieve agent-to-agent communication natively in Agentuity.
17
15
18
-
####Communication Types
16
+
## Communication Types
19
17
20
18
Agents can communicate with each other in a number of ways in the Agentuity platform. The following are the different types of communication that are supported:
21
19
@@ -25,28 +23,28 @@ Agents can communicate with each other in a number of ways in the Agentuity plat
25
23
|**Inter Project**| Agents can communicate with each other across projects within the same organization across the internal network |
26
24
|**Inter Organization**| Agents can communicate with each other across organizations across the internal network |
27
25
28
-
#####Intra Project
26
+
### Intra Project
29
27
30
28
Intra project communication is the simplest form of agent-to-agent communication. Agents within the same project can communicate with each other locally without leaving the local network.
31
29
32
-
#####Inter Project
30
+
### Inter Project
33
31
34
32
Inter project communication is a more advanced form of agent-to-agent communication. Agents can communicate with each other across projects within the same organization but will communicate over the internal network.
35
33
36
-
#####Inter Organization
34
+
### Inter Organization
37
35
38
36
Inter organization communication is the most advanced form of agent-to-agent communication. Agents can communicate with each other across organizations. Currently, Agentuity only supports inter organization agent communication if the target agent is public and the source agent has been given the agent ID by the other organization. For inter organization communication, the source agent will communicate over the internal network.
39
37
40
-
####Communication Methods
38
+
## Communication Methods
41
39
42
-
Agents has two primary methods of communication with other agents:
40
+
Agents have two primary methods of communication with other agents:
43
41
44
42
| Type | Description |
45
43
|-----------|-------------|
46
44
| Handoff | Agents can handoff a request to another agent to complete |
47
45
| Invocation | Agents can invoke another agent to complete a task and wait for the result |
48
46
49
-
#####Handoff
47
+
### Handoff
50
48
51
49
When an agent needs to handoff a request to another agent, it can do so by using the SDK `handoff` method. The `handoff` method will send the request to another agent and the other agent will be responsible for completing the request.
52
50
@@ -81,20 +79,24 @@ export default async function Agent(
81
79
resp: AgentResponse,
82
80
ctx: AgentContext
83
81
) {
84
-
return resp.handoff({name: 'My Other Agent'}, "would you please do this?");
82
+
return resp.handoff(
83
+
{name: 'My Other Agent'},
84
+
{ data: "would you please do this?", contentType: "text/plain" }
return response.handoff({"name":"My Other Agent"}, "would you please do this?")
89
91
`} />
90
92
91
-
#####Invocation
93
+
### Invocation
92
94
93
-
When an agent needs to invoke another agent to complete a task and wants to wait for the result, it can do so by using the SDK `getAgents` method on `AgentContext`. The `getAgents` will perform resolution to determine the target agent location and return a handle to the target agent that can be used to `run` the target agent.
95
+
When an agent needs to invoke another agent to complete a task and wants to wait for the result, it can do so by using the SDK `getAgent` method on `AgentContext`. The `getAgent` will perform resolution to determine the target agent location and return a handle to the target agent that can be used to `run` the target agent.
94
96
95
-
If the target agent is local (intra project), the `getAgents` method will return a handle to an internal agent which can be used to `run` the target agent.
97
+
If the target agent is local (intra project), the `getAgent` method will return a handle to an internal agent which can be used to `run` the target agent.
96
98
97
-
If the target agent is remote (inter project or inter organization), the `getAgents` method will return a handle to an external agent which can be used to `run` the target agent. In addition, the SDK internally will use the authorization token to authenticate the source agent to the target agent.
99
+
If the target agent is remote (inter project or inter organization), the `getAgent` method will return a handle to an external agent which can be used to `run` the target agent. In addition, the SDK internally will use the authorization token to authenticate the source agent to the target agent.
98
100
99
101
<Mermaidchart="
100
102
sequenceDiagram
@@ -115,23 +117,31 @@ export default async function Agent(
115
117
ctx: AgentContext
116
118
) {
117
119
const agent = await ctx.getAgent({name: 'My Other Agent'});
118
-
const agentResponse = await agent.run({name: 'My Other Agent'}, "would you please do this?");
120
+
// Basic usage - perfect for simple string data
121
+
const agentResponse = await agent.run({ data: "would you please do this?" });
122
+
// Explicit control when needed:
123
+
// const agentResponse = await agent.run({ data: "would you please do this?", contentType: "text/plain" });
agent = await context.getAgent({"name":"My Other Agent"})
125
-
agent_response = await agent.run({"name":"My Other Agent"}, "would you please do this?")
129
+
agent = await context.get_agent({"name":"My Other Agent"})
130
+
# Send plain text (content type inferred as text/plain)
131
+
agent_response = await agent.run("would you please do this?")
132
+
# Or send JSON (content type inferred as application/json)
133
+
# agent_response = await agent.run({"message": "would you please do this?"})
126
134
text = await agent_response.data.text()
127
135
return response.text(text)
128
136
`} />
129
137
138
+
> **Note:** JavaScript uses `{ data, contentType }` format while Python infers content type from the raw payload passed directly.
139
+
130
140
In this trivial example above, the functionality is similar to the handoff example above. The source agent is sending a request to the `My Other Agent` agent and passing a message to the other agent. The `My Other Agent` agent will receive the request, perform an operation and return the result to the source agent. The source agent will simply return the result as a text result.
131
141
132
142
In a real life scenario, you'll likely want to pass the appropriate data types to the target agent and wait for the result and then use the result in your own agent to perform additional tasks.
133
143
134
-
######Parallel Execution
144
+
#### Parallel Execution
135
145
136
146
Sometimes you want to send a request to multiple agents at the same time. This is an example of parallel execution.
137
147
@@ -144,22 +154,28 @@ export default async function Agent(
144
154
) {
145
155
const agent1 = await ctx.getAgent({name: 'My First Agent'});
146
156
const agent2 = await ctx.getAgent({name: 'My Second Agent'});
agent1 = await context.getAgent({"name":"My First Agent"})
158
-
agent2 = await context.getAgent({"name":"My Second Agent"})
173
+
agent1 = await context.get_agent({"name":"My First Agent"})
174
+
agent2 = await context.get_agent({"name":"My Second Agent"})
159
175
160
176
await asyncio.gather(
161
-
agent1.run({"task":"My First Task"}),
162
-
agent2.run({"task":"My Second Task"}),
177
+
agent1.run({"task":"My First Task"}), # content type inferred as JSON
178
+
agent2.run({"task":"My Second Task"}), # content type inferred as JSON
163
179
)
164
180
165
181
return response.text('OK')
@@ -175,27 +191,27 @@ sequenceDiagram
175
191
actor Agentuity
176
192
actor Agent 2
177
193
actor Agent 3
178
-
Agent 1-->>Agentuity: Get Agent 1
179
194
Agent 1-->>Agentuity: Get Agent 2
195
+
Agent 1-->>Agentuity: Get Agent 3
180
196
Agent 1->>Agent 2: Run
181
197
Agent 1->>Agent 3: Run
182
198
"/>
183
199
184
-
####Agent Resolution
200
+
## Agent Resolution
185
201
186
-
How do we resolve the target agent? There are two main ways to do this:
202
+
How do we resolve the target agent? There are three main ways to do this:
187
203
188
204
| Type | Description |
189
205
|-----------|-------------|
190
206
| Agent ID | The agent ID is a unique identifier for an agent. It is a string that is assigned to an agent when it is created. |
191
207
| Agent Name | The agent name is a human readable name for an agent. It is a string that was used for the agent's name. |
192
208
| Project ID | The agent project ID is specified to disambiguate agents with the same name in different projects. |
193
209
194
-
#####Intra Project Resolution
210
+
### Intra Project Resolution
195
211
196
212
When calling an agent within the same project, the agent name is usually the easiest way to resolve the target agent. The agent name is a human readable name for an agent. It is a string that was used for the agent's name.
197
213
198
-
#####Inter Project Resolution
214
+
### Inter Project Resolution
199
215
200
216
When calling an agent across projects within the same organization, the agent ID is typically the most reliable way to resolve the target agent. The agent ID is a unique identifier for an agent.
201
217
@@ -211,23 +227,23 @@ export default async function Agent(
211
227
ctx: AgentContext
212
228
) {
213
229
return resp.handoff({
214
-
id: 'agent_123456789abcedef',
215
-
projectId: 'project_123456789abcedef',
230
+
id: 'agent-123456789abcedef',
231
+
projectId: 'project-123456789abcedef',
216
232
});
217
233
}`}py={`
218
234
from agentuity import AgentRequest, AgentResponse, AgentContext
Currently, Agentuity only supports inter organization agent communication if the target agent is public and the source agent has been given the agent ID by the other organization. When using inter organization communication, only the agent ID is required to resolve the target agent.
230
246
231
-
####Communication Authorization
247
+
## Communication Authorization
232
248
233
249
When communicating with other agents outside the local project, Agentuity will automatically generate a one-time use authorization token with a short expiration. This token is used to authenticate the source agent to the target agent automatically without the need for the source agent to pass the token to the target agent.
Copy file name to clipboardExpand all lines: content/Guides/agent-data-handling.mdx
+15-13Lines changed: 15 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,9 @@ title: Agent Data Handling
3
3
description: How to handle data formats in your agents
4
4
---
5
5
6
-
We provide a few different ways to handle data formats in your agents to make it easier to work with different data types. Of course, your agent can always perform its own data handling by use the raw data and the content type property. However, most common data types are supported out of the box.
6
+
## Overview
7
+
8
+
We provide a few different ways to handle data formats in your agents to make it easier to work with different data types. Of course, your agent can always perform its own data handling by using the raw data and the content type property. However, most common data types are supported out of the box.
7
9
8
10
## How it works
9
11
@@ -37,16 +39,16 @@ export default async function Agent(
0 commit comments