One-off vs Conversational
Choosing the right agent pattern
Agents can be designed for one-off tasks or multi-turn conversations. Understanding when to use each pattern helps you build better AI applications.
Two Patterns
| Pattern | Handler | Input | Output |
|---|---|---|---|
| One-off | invoke | Structured data | Structured result |
| Conversational | chat | Message history | Assistant response |
One-off Agents (Invoke)
One-off agents process a single request and return a result. They're stateless — each request is independent.
When to Use
- Data processing and transformation
- Content generation (articles, summaries, code)
- API-like operations
- Batch processing
- Single-step automation
Use Cases
| Use Case | Input | Output |
|---|---|---|
| Summarize article | { "text": "..." } | { "summary": "..." } |
| Extract data | { "document": "..." } | { "entities": [...] } |
| Generate code | { "prompt": "..." } | { "code": "..." } |
| Translate text | { "text": "...", "to": "es" } | { "translation": "..." } |
| Analyze sentiment | { "reviews": [...] } | { "scores": [...] } |
Example
POST /agent/summarizer/invoke
{
"input": {
"text": "Long article text here...",
"maxLength": 100
}
}
Response:
{
"output": "Brief summary of the article..."
}Conversational Agents (Chat)
Conversational agents handle multi-turn dialogues. They receive the full message history and generate contextual responses.
When to Use
- Customer support bots
- AI assistants
- Interactive tutorials
- Guided workflows
- Any dialogue-based interaction
Use Cases
| Use Case | Description |
|---|---|
| Support bot | Answer questions, troubleshoot issues |
| Sales assistant | Guide users through product selection |
| Onboarding agent | Walk new users through setup |
| Coding assistant | Help with code, remember context |
| Personal assistant | Schedule, remind, manage tasks |
Example
POST /agent/support-bot/chat
{
"messages": [
{ "role": "user", "content": "I can't log in" },
{ "role": "assistant", "content": "I can help! What error do you see?" },
{ "role": "user", "content": "It says invalid password" }
]
}
Response:
{
"message": {
"role": "assistant",
"content": "Try resetting your password at reminix.com/reset"
}
}Combining Both
Many agents benefit from both patterns:
| Scenario | Invoke | Chat |
|---|---|---|
| Writing assistant | "Generate blog post" | "Help me brainstorm ideas" |
| Code agent | "Refactor this function" | "Explain this error" |
| Data agent | "Process this CSV" | "What columns should I include?" |
You can implement both handlers in a single agent:
Agent("writing-assistant")
├── invoke → Generate content
└── chat → Discuss ideasQuick Decision Guide
Need conversation history?
├── Yes → Use Chat
└── No → Is it a single task?
├── Yes → Use Invoke
└── No → Consider bothNext Steps
- Invoke, Chat & Streaming — Technical details
- Python Examples — See implementations
- TypeScript Examples — See implementations