Skip to content

Commit 2da7fd8

Browse files
authored
Rename acp_type=AGENTIC to ASYNC with backwards compatibility (#20)
This PR makes a major refactor to the Agentex server code by adding the "async" ACP type, which is meant to replace "agentic". New agents should use "async", but backwards compatibility with "agentic" agents is still maintained, though marked as deprecated. In the future, we should try to migrate all existing "agentic" agents to async, then completely remove it from the codebase. A couple surface areas that I want to comment on: * **Migrations**: A migration to change the default acp type on the Agents table from "agentic" to "async" has been added * **Docs**: All references to "agentic" in docs have been removed and replaced with "async". * **Testing**: All existing tests using the "agentic" acp type have been updated to use the new "async" designation, and all of them are passing. New unit and integration tests have also been added to test backwards compatibility. * **Agentex-ui**: No updates have been made to agentex-ui yet, we need to wait for the new acp type to be available via the SDK after this PR lands. * **python SDK**: A separate PR will need to be made (in addition to the automated stainless ones) to update the jinja templates in the python SDK to make async the new default.
1 parent 60b44c5 commit 2da7fd8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+804
-123
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
"""change_default_acp_to_async
2+
3+
Revision ID: 329fbafa4ff9
4+
Revises: d7addd4229e8
5+
Create Date: 2025-10-30 21:57:45.309656
6+
7+
"""
8+
from typing import Sequence, Union
9+
10+
from alembic import op
11+
import sqlalchemy as sa
12+
13+
14+
# revision identifiers, used by Alembic.
15+
revision: str = '329fbafa4ff9'
16+
down_revision: Union[str, None] = 'd7addd4229e8'
17+
branch_labels: Union[str, Sequence[str], None] = None
18+
depends_on: Union[str, Sequence[str], None] = None
19+
20+
21+
def upgrade() -> None:
22+
# ### commands auto generated by Alembic - please adjust! ###
23+
# Change the server_default of acp_type column to "async"
24+
op.alter_column(
25+
'agents',
26+
'acp_type',
27+
server_default='async',
28+
existing_nullable=False
29+
)
30+
# ### end Alembic commands ###
31+
32+
33+
def downgrade() -> None:
34+
# ### commands auto generated by Alembic - please adjust! ###
35+
# Revert the server_default of acp_type column back to "agentic"
36+
op.alter_column(
37+
'agents',
38+
'acp_type',
39+
server_default='agentic',
40+
existing_nullable=False
41+
)
42+
# ### end Alembic commands ###

agentex/database/migrations/migration_history.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
09368a02d6cc -> d7addd4229e8 (head), soft delete status
1+
d7addd4229e8 -> 329fbafa4ff9 (head), change_default_acp_to_async
2+
09368a02d6cc -> d7addd4229e8, soft delete status
23
739800d3e1ce -> 09368a02d6cc, deployment history
34
dbac39ab82c3 -> 739800d3e1ce, registration metadata
45
87454c35c13e -> dbac39ab82c3, add_task_metadata

agentex/docs/docs/acp/agentic/base.md renamed to agentex/docs/docs/acp/async/base.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Base Agentic ACP
1+
# Base Async ACP
22

3-
**Base Agentic ACP** is the foundational implementation designed for learning and development environments. It provides complete control over task lifecycle while using Agentex's built-in state management.
3+
**Base Async ACP** is the foundational implementation designed for learning and development environments. It provides complete control over task lifecycle while using Agentex's built-in state management.
44

55
## When to Use
66

@@ -25,14 +25,14 @@
2525

2626
### Not Ideal For:
2727

28-
**Production Critical Systems** - Use Temporal Agentic ACP
28+
**Production Critical Systems** - Use Temporal Async ACP
2929
**Very Large State Requirements** - Consider external storage
3030
**Enterprise Durability** - No advanced fault tolerance
3131
**High-Scale Operations** - Better suited for development
3232

3333
## State Management
3434

35-
Base Agentic ACP requires using Agentex's state management system:
35+
Base Async ACP requires using Agentex's state management system:
3636

3737
```python
3838
@acp.on_task_create
@@ -187,7 +187,7 @@ Used in `@acp.on_task_cancel` for cleanup:
187187

188188
## Next Steps
189189

190-
- **Ready for production?** Learn about [Temporal Agentic ACP](temporal.md)
190+
- **Ready for production?** Learn about [Temporal Async ACP](temporal.md)
191191
- **Need to upgrade?** See the [Migration Guide](../../concepts/migration_guide.md)
192192
- **New to Agentex?** Follow the [Quick Start Guide on GitHub](https://github.com/scaleapi/scale-agentex#quick-start)
193193
- **Ready to build?** Check out [Base Agentic Tutorials on GitHub](https://github.com/scaleapi/scale-agentex-python/tree/main/examples/tutorials/10_agentic/000_base)

agentex/docs/docs/acp/agentic/overview.md renamed to agentex/docs/docs/acp/async/overview.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# Agentic ACP
1+
# Async ACP
22

3-
**Agentic ACP** is the powerful, event-driven approach for complex agent interactions. It provides complete control over task lifecycle, state management, and workflows through three distinct handlers.
3+
**Async ACP** is the powerful, event-driven approach for complex agent interactions. It provides complete control over task lifecycle, state management, and workflows through three distinct handlers.
44

5-
## What is Agentic ACP?
5+
## What is Async ACP?
66

7-
Agentic ACP provides full lifecycle control where:
7+
Async ACP provides full lifecycle control where:
88

99
- You implement **three handler methods** for complete lifecycle management
1010
- Tasks require **explicit initialization** and cleanup
@@ -13,9 +13,9 @@ Agentic ACP provides full lifecycle control where:
1313

1414
## Two Implementation Approaches
1515

16-
Agentic ACP can be implemented in two ways:
16+
Async ACP can be implemented in two ways:
1717

18-
| Aspect | Base Agentic ACP | Temporal Agentic ACP |
18+
| Aspect | Base Async ACP | Temporal Async ACP |
1919
|--------|------------------|----------------------|
2020
| **Best for** | Learning, development, POCs | Production, enterprise |
2121
| **State Management** | Agentex state APIs | Temporal event sourcing or Agentex state |
@@ -26,7 +26,7 @@ Agentic ACP can be implemented in two ways:
2626

2727
## Core Architecture
2828

29-
Both Base and Temporal Agentic ACP share the same three-handler pattern:
29+
Both Base and Temporal Async ACP share the same three-handler pattern:
3030

3131
```python
3232
@acp.on_task_create
@@ -68,7 +68,7 @@ graph TD
6868

6969
## Asynchronous Event Processing
7070

71-
Think of Agentic ACP like a **postal system for agents** - each agent has its own mailbox where events are delivered asynchronously, and agents decide when and how to process their mail.
71+
Think of Async ACP like a **postal system for agents** - each agent has its own mailbox where events are delivered asynchronously, and agents decide when and how to process their mail.
7272

7373
### Every Agent Has a Mailbox
7474

@@ -148,24 +148,24 @@ async def handle_event_send(params: SendEventParams):
148148

149149
## Choose Your Implementation
150150

151-
### Base Agentic ACP
151+
### Base Async ACP
152152

153153
Perfect for learning and development. Use Agentex's built-in state management.
154154

155-
**[→ Read Base Agentic ACP Guide](base.md)**
155+
**[→ Read Base Async ACP Guide](base.md)**
156156

157-
### Temporal Agentic ACP
157+
### Temporal Async ACP
158158

159159
Production-ready with durable execution and automatic fault tolerance.
160160

161-
**[→ Read Temporal Agentic ACP Guide](temporal.md)**
161+
**[→ Read Temporal Async ACP Guide](temporal.md)**
162162

163163
---
164164

165165
## Next Steps
166166

167-
- **Getting started?** Learn about [Base Agentic ACP](base.md) first
168-
- **Ready for production?** Explore [Temporal Agentic ACP](temporal.md)
167+
- **Getting started?** Learn about [Base Async ACP](base.md) first
168+
- **Ready for production?** Explore [Temporal Async ACP](temporal.md)
169169
- **Need to upgrade?** Check the [Migration Guide](../../concepts/migration_guide.md)
170170
- **New to Agentex?** Follow the [Quick Start Guide on GitHub](https://github.com/scaleapi/scale-agentex#quick-start)
171171
- **Ready to build?** Check out [Agentic Tutorials on GitHub](https://github.com/scaleapi/scale-agentex-python/tree/main/examples/tutorials/10_agentic)

agentex/docs/docs/acp/agentic/temporal.md renamed to agentex/docs/docs/acp/async/temporal.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Temporal Agentic ACP
1+
# Temporal Async ACP
22

3-
**Temporal Agentic ACP** provides production-ready agent development with **durable execution**, **fault tolerance**, and **automatic state management**. Instead of implementing ACP handlers directly, you implement Temporal workflows that are automatically integrated with the ACP protocol.
3+
**Temporal Async ACP** provides production-ready agent development with **durable execution**, **fault tolerance**, and **automatic state management**. Instead of implementing ACP handlers directly, you implement Temporal workflows that are automatically integrated with the ACP protocol.
44

55
## When to Use
66

@@ -26,11 +26,11 @@
2626

2727
### Not Ideal For:
2828

29-
**Learning Agentex basics** - Start with Base Agentic ACP
29+
**Learning Agentex basics** - Start with Base Async ACP
3030
**Simple prototypes** - Higher complexity overhead
3131
**Development without Temporal** - Requires Temporal infrastructure
3232

33-
## Key Differences from Base Agentic ACP
33+
## Key Differences from Base Async ACP
3434

3535
### No Manual ACP Handlers
3636

@@ -110,7 +110,7 @@ from agentex.lib.types.fastacp import TemporalACPConfig
110110

111111
# Create the ACP server
112112
acp = FastACP.create(
113-
acp_type="agentic",
113+
acp_type="async",
114114
config=TemporalACPConfig(
115115
type="temporal",
116116
temporal_address=os.getenv("TEMPORAL_ADDRESS", "localhost:7233")
@@ -320,7 +320,7 @@ if __name__ == "__main__":
320320

321321
## Next Steps
322322

323-
- **Getting started?** Learn about [Base Agentic ACP](base.md) first
323+
- **Getting started?** Learn about [Base Async ACP](base.md) first
324324
- **Need to migrate?** Check the [Migration Guide](../../concepts/migration_guide.md)
325325
- **New to Agentex?** Follow the [Quick Start Guide on GitHub](https://github.com/scaleapi/scale-agentex#quick-start)
326326
- **Ready to build?** Check out [Temporal Tutorials on GitHub](https://github.com/scaleapi/scale-agentex-python/tree/main/examples/tutorials/10_agentic/100_temporal)

agentex/docs/docs/acp/best-practices.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Guidelines for building robust, maintainable, and secure agents with ACP.
1414

1515
- **Async operations** - Use `await` for all ADK operations
1616
- **Efficient state access** - Batch state operations when possible
17-
- **Resource cleanup** - Always clean up resources in Agentic ACP
17+
- **Resource cleanup** - Always clean up resources in Async ACP
1818
- **Caching** - Cache expensive operations when appropriate
1919

2020
## Security

agentex/docs/docs/acp/overview.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Think of ACP as the "language" that agents and clients use to understand each ot
1919

2020
Agentex supports two distinct ACP types, each designed for different use cases:
2121

22-
| Feature | Sync ACP | Agentic ACP |
22+
| Feature | Sync ACP | Async ACP |
2323
|---------|----------|-------------|
2424
| **Best for** | Chat bots, simple Q&A | Complex workflows, stateful apps |
2525
| **Handlers** | 1 method (`on_message_send`) | 3 methods (`on_task_create`, `on_task_event_send`, `on_task_cancel`) |
@@ -37,7 +37,7 @@ Agentex supports two distinct ACP types, each designed for different use cases:
3737
- ✅ Quick responses - Fast, lightweight operations
3838
- ✅ Chat-like interfaces - Traditional conversational AI
3939

40-
**Use Agentic ACP when:**
40+
**Use Async ACP when:**
4141

4242
- ✅ Complex workflows - Multi-step processes with state
4343
- ✅ Persistent memory - Need to remember context across interactions
@@ -55,17 +55,17 @@ Perfect for simple chat bots and Q&A agents. Get started with the easiest approa
5555

5656
**[→ Read Sync ACP Guide](sync.md)**
5757

58-
### Agentic ACP
58+
### Async ACP
5959

6060
Powerful event-driven approach for complex agents. Choose between Base (learning/development) or Temporal (production).
6161

62-
**[→ Read Agentic ACP Overview](agentic/overview.md)**
62+
**[→ Read Async ACP Overview](async/overview.md)**
6363

6464
---
6565

6666
## Additional Resources
6767

68-
- **[Migration Guide](../concepts/migration_guide.md)** - Upgrade from Sync to Agentic, or Base to Temporal
68+
- **[Migration Guide](../concepts/migration_guide.md)** - Upgrade from Sync to Async, or Base to Temporal
6969
- **[Best Practices](best-practices.md)** - Guidelines for performance, security, and maintainability
7070

7171
---

agentex/docs/docs/acp/sync.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ The `@acp.on_message_send` handler receives:
9191

9292
### Not Ideal For:
9393

94-
**Multi-step workflows** - Use Agentic ACP
94+
**Multi-step workflows** - Use Async ACP
9595
**Complex state management** - Limited state tracking
9696
**Resource coordination** - No initialization/cleanup hooks
9797
**Long-running processes** - Better suited for quick responses
@@ -101,13 +101,13 @@ The `@acp.on_message_send` handler receives:
101101
- **Keep handlers simple** - Sync ACP is for straightforward logic
102102
- **Handle errors gracefully** - Return error messages to users
103103
- **Use optional state sparingly** - For simple session data only
104-
- **Consider migration** - Switch to Agentic ACP as complexity grows
104+
- **Consider migration** - Switch to Async ACP as complexity grows
105105

106106
---
107107

108108
## Next Steps
109109

110-
- **Need more complexity?** Learn about [Agentic ACP](agentic/overview.md)
110+
- **Need more complexity?** Learn about [Async ACP](agentic/overview.md)
111111
- **Ready to upgrade?** See the [Migration Guide](../concepts/migration_guide.md)
112112
- **New to Agentex?** Follow the [Quick Start Guide on GitHub](https://github.com/scaleapi/scale-agentex#quick-start)
113113
- **Ready to build?** Check out [Sync ACP Tutorials on GitHub](https://github.com/scaleapi/scale-agentex-python/tree/main/examples/tutorials/00_sync)

agentex/docs/docs/api/types.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,6 @@ For practical usage examples and patterns, see:
128128
- [TaskMessage Concepts](../concepts/task_message.md) - Working with messages
129129
- [Streaming Concepts](../concepts/streaming.md) - Real-time message streaming
130130
- [State Concepts](../concepts/state.md) - Managing persistent state
131-
- [Agent-to-Client Protocol (ACP)](../acp/overview.md) - Sync and Agentic ACP handler parameters explained
131+
- [Agent-to-Client Protocol (ACP)](../acp/overview.md) - Sync and Async ACP handler parameters explained
132132

133133

agentex/docs/docs/concepts/agents.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ The way you implement agents depends on which ACP (Agent-to-Client Protocol) typ
6767

6868
**Sync ACP** agents are the simplest form - just a single function that processes messages and returns responses.
6969

70-
**Agentic ACP** agents have multiple handler functions that manage the complete interaction lifecycle.
70+
**Async ACP** agents have multiple handler functions that manage the complete interaction lifecycle.
7171

7272
## Agent Relationships
7373

@@ -163,7 +163,7 @@ async def handle_message_send(params: SendMessageParams):
163163
content="Hello from the agent!"
164164
)
165165

166-
# Agentic ACP - Create messages explicitly
166+
# Async ACP - Create messages explicitly
167167
@acp.on_task_event_send
168168
async def handle_event_send(params: SendEventParams):
169169
await adk.messages.create(

0 commit comments

Comments
 (0)