Runs
Runs are single executions of an agent. Unlike threads, runs do not store history β they are stateless and focused only on the current input and output.
How Runs Work
- You send an input to the agent.
- The agent processes it, possibly using tools, contexts, or knowledge bases.
- A run produces an output (like a message, tool call, or structured response).
Runs are lightweight and disposable. They are useful when you don't need long-term memory or history.
Why Use Runs?
- Simplicity: Get one-off answers without storing a chat log.
- Efficiency: Use fewer resources than managing full threads.
- Integration: Call agents directly from APIs or workflows.
Examples
- FAQ Bot: Ask a one-off question like βWhat's the refund policy?β
- Task Automation: Run an agent to generate a report or send a Slack message.
- Form Processing: Feed structured inputs and get structured outputs.
Things to Know
- Runs are stateless. They don't know what happened before or after.
- You can use contexts or knowledge bases inside a run for richer outputs.
- If you need history, use a thread instead.
π Think of Runs as one-time function calls to your agent β simple, focused, and without memory.