Principle:ANative Lab EvoAgentX Declarative Agent Design
| Knowledge Sources | |
|---|---|
| Domains | Agents, Architecture |
| Last Updated | 2026-10-21 00:00 GMT |
Overview
Design pattern for creating LLM-powered agents declaratively by specifying inputs, outputs, prompt templates, and parse modes without writing custom action classes.
Description
Declarative Agent Design is an approach where an agent's behavior is fully specified through configuration (name, description, prompt, I/O schemas, parse mode) rather than subclassing an agent class. The framework dynamically generates the action class, input/output Pydantic models, and parsing logic from the specification. This dramatically reduces the barrier to creating specialized agents: a user defines what the agent should do (via prompt) and what it should produce (via outputs + parse_mode), and the framework handles execution, tool-calling, and output extraction.
Usage
Use this principle when you need to create specialized LLM agents for specific tasks (summarization, classification, extraction, translation) without writing custom Python classes. This is the standard approach in EvoAgentX via `CustomizeAgent`. It is ideal for:
- Rapid prototyping of single-purpose agents
- Multi-agent workflows where each node is a declaratively-defined agent
- Scenarios where agent configurations need to be serialized and shared
Theoretical Basis
The declarative pattern separates agent specification from agent execution. The specification is a data structure:
# Abstract pattern (not real implementation)
agent = Agent(
name="...",
prompt="Process {input}",
inputs=[{"name": "input", "type": "str", ...}],
outputs=[{"name": "result", "type": "str", ...}],
parse_mode="title",
)
# Framework auto-generates: Action class, ActionInput/ActionOutput models, parser
result = agent(inputs={"input": "value"})
Key theoretical properties:
- Schema-driven I/O: Input/output schemas become Pydantic models with JSON schema generation
- Parse mode dispatch: The framework selects the appropriate parser based on `parse_mode`
- Tool-calling loop: When tools are attached, the agent enters a multi-step tool-calling loop