Skip to content

Agents

Agents are the core logic units in GenAI workflows. They encapsulate all the intelligence, reasoning, and execution configuration required to perform a task. While tasks define when and where an agent is run, the agent itself defines how to act, including model behavior, tool usage, handoffs, and integration logic.

Agents are fully reusable across tasks and workflows.

agent.png


What an Agent Contains

Field Description
Name Unique identifier used across workflows and task assignments.
Instructions A system prompt or directive that guides the model’s behavior. Supports templating with input variables.
Model The LLM or other AI model the agent uses for reasoning. Configured via the Model Registry.
Tools A list of external tools (e.g., HTTP APIs, file readers, code runners) the agent can invoke autonomously at runtime.
MCP (Model Context Protocol) External context integration. Enables the agent to pull data from enterprise systems (CRMs, ERPs, etc.) before or during execution.
Handoffs Configured logic for passing control to downstream tasks. Can be conditional, sequential, or parallel.
Handoff Instructions Optional guidance to shape how the agent prepares output for the next step in the workflow.
Agent as a Tool Agents can be exposed as callable tools to other agents. This allows nested or hierarchical reasoning where one agent "delegates" to another.

Execution Behavior

When triggered by a task, an agent:

  1. Receives inputs (from prior task or initial workflow input).
  2. Executes its instructions using the assigned model.
  3. Calls tools if necessary to retrieve or act on external data.
  4. Uses MCPs to retrieve context or enrich prompts.
  5. Prepares output and passes it via handoff logic to the next task(s).

Agents can be run synchronously, asynchronously, or as part of a streaming chain during workflow execution.


Example Agent (Simplified JSON)

{
  "name": "DataValidationAgent",
  "instructions": "You are a compliance analyst. Validate the extracted contract data.",
  "model": "gpt-4-turbo",
  "tools": ["PolicyCheckerAPI", "TextComparer"],
  "mcp": "ContractDBServer",
  "handoffs": [
    {
      "target": "FlagReviewer",
      "condition": "output.contains_risk == true"
    }
  ],
  "handoff_instructions": "Pass all validated fields and flagged risks.",
  "expose_as_tool": true
}

Use Cases

Agent Type Example
Analytical Summarize sales trends using time-series charting tool
Retrieval-based Query knowledge base and synthesize multi-source insight
Validation Apply business rules using API tools and return pass/fail output
Planner/Coordinator Route requests to other agents or invoke tools conditionally

Best Practices

  • Keep instructions clear, goal-oriented, and role-specific.
  • Only expose necessary tools to reduce unintended side-effects.
  • Use handoff instructions to structure output passed to downstream tasks.
  • Reuse agents across workflows by keeping logic modular and generalized.
  • Enable agent-as-tool selectively to support nested delegation logic.