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
Copy file name to clipboardExpand all lines: README.md
+103-1Lines changed: 103 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,6 +33,7 @@ ACP (Agent Control Plane) is a cloud-native orchestrator for AI Agents built on
33
33
-[Creating an Agent and Running your first task](#creating-an-agent-and-running-your-first-task)
34
34
-[Adding Tools with MCP](#adding-tools-with-mcp)
35
35
-[Using other language models](#using-other-language-models)
36
+
-[Delegating to a Sub-Agent](#delegating-to-a-sub-agent)
36
37
-[Incorporating Human Approval](#incorporating-human-approval)
37
38
-[Incorporating Humans as Tools](#humans-as-tools)
38
39
-[Cleaning Up](#cleaning-up)
@@ -908,6 +909,107 @@ NAME READY STATUS PHASE PREVIEW OUTPUT
908
909
claude-task true Ready FinalAnswer I am Claude, an AI assistant created by Anthropic. My primary directive is to be helpful while being direct and honest in my interactions. I aim to help users with their tasks while adhering to ethical principles.
909
910
```
910
911
912
+
### Delegating to a Sub-Agent
913
+
914
+
We can compose agents together to create more complex behaviors and make longer workflows more reliable.
915
+
916
+
Let's create a web search agent that can use the fetch tool we created in the previous example.
917
+
918
+
```bash
919
+
cat <<EOF | kubectl apply -f -
920
+
apiVersion: acp.humanlayer.dev/v1alpha1
921
+
kind: Agent
922
+
metadata:
923
+
name: web-search
924
+
spec:
925
+
llmRef:
926
+
name: gpt-4o
927
+
system: |
928
+
You are a helpful assistant. Your job is to help the user with their tasks.
929
+
mcpServers:
930
+
- name: fetch
931
+
EOF
932
+
```
933
+
934
+
next, we can create a router agent that can delegate to the web search agent.
935
+
936
+
```bash
937
+
cat <<EOF | kubectl apply -f -
938
+
apiVersion: acp.humanlayer.dev/v1alpha1
939
+
kind: Agent
940
+
metadata:
941
+
name: manager
942
+
spec:
943
+
llmRef:
944
+
name: gpt-4o
945
+
system: |
946
+
You are a helpful assistant. Your job is to help the user with their tasks.
947
+
subAgents:
948
+
- name: web-search
949
+
EOF
950
+
```
951
+
952
+
From here, let's create a task that uses the manager agent.
953
+
954
+
```bash
955
+
cat <<EOF | kubectl apply -f -
956
+
apiVersion: acp.humanlayer.dev/v1alpha1
957
+
kind: Task
958
+
metadata:
959
+
name: manager-task
960
+
spec:
961
+
agentRef:
962
+
name: manager
963
+
userMessage: "what is the data at https://lotrapi.co/api/v1/characters/2?"
964
+
EOF
965
+
```
966
+
967
+
While this is running, you can run the following a few times to see how the parent agent calls a `delegate` tool which then spawns a new task that uses the `web-fetch` agent
968
+
969
+
```
970
+
kubectl get agent,task,toolcall
971
+
```
972
+
973
+
974
+
975
+
976
+
The following diagram shows the relationship between Agents, subagents, and created tasks:
977
+
978
+
```mermaid
979
+
graph RL
980
+
981
+
982
+
subgraph ManagerAgent
983
+
subAgents
984
+
end
985
+
986
+
subgraph WebFetchAgent
987
+
MCPServers
988
+
end
989
+
990
+
991
+
992
+
subgraph ManagerTask
993
+
agentRef
994
+
end
995
+
996
+
subgraph DelegationTask
997
+
userMessage
998
+
agentRef2
999
+
end
1000
+
1001
+
DelegationTask --> parentTask --> ManagerTask
1002
+
agentRef2 --> WebFetchAgent
1003
+
1004
+
agentRef --> ManagerAgent
1005
+
1006
+
subgraph MCPServer
1007
+
fetch[fetch server]
1008
+
end
1009
+
1010
+
MCPServers --> MCPServer
1011
+
```
1012
+
911
1013
### Incorporating Human Approval
912
1014
913
1015
For certain classes of MCP tools, you may want to incorporate human approval into an agent's workflow.
@@ -1198,7 +1300,7 @@ kind delete cluster
1198
1300
| MCP stdio Support | Alpha ✅ |
1199
1301
| Task Execution History via Kubernetes Events | Alpha ✅ |
1200
1302
| Better MCP Scheduling | Planned 🗺️ |
1201
-
| Delegation to Sub Agents |Planned 🗺️|
1303
+
| Delegation to Sub Agents |In Progress 🚧|
1202
1304
| Human approval for MCP Tools | Alpha ✅ |
1203
1305
| Contact human as a tool | In Progress 🚧 |
1204
1306
| Tiered approval (once, just for this task, or always) | Planned 🗺️ |
0 commit comments