Appearance
Agent
An Agent block is what yaml_to_agent builds. It names the agent, sets the instruction, and points at a model. Tools, HTTP tools, and structured output are optional. Memory, RAG, guardrails, MCP, plugins, and a sandbox are added to the same block. Each has its own page.
Example
agent.yaml:
yaml
openai:
type: OpenAIModel
model_id: "{{$OPENAI_MODEL:gpt-4o-mini}}"
assistant:
type: Agent
name: Assistant
description: Answers general questions in a few sentences.
system_prompt: |
You are a concise assistant.
Answer in at most three sentences.
model: ${openai}
tools:
- elsai_tools.current_timepython
from elsai.config import yaml_to_agent
agent = yaml_to_agent("agent.yaml", entry="assistant")
print(agent("What is the capital of India?"))
print(agent("What time is it right now?"))Set OPENAI_API_KEY before running. The elsai_tools.current_time tool needs elsai-agents-tools. Use tools: [] for an agent with no tools.
The Agent block
| Key | What it holds |
|---|---|
type | Always Agent |
name, description | Labels for the agent. Not the system prompt |
system_prompt | The instruction, as a plain string |
model | The chat model. See Model |
tools | Prebuilt tools, custom tools, or other agents. See Tools |
http | HTTP endpoints declared as tools. See HTTP tools |
structured_output | A Pydantic class the answer must fill. See Structured output |
structured_output_prompt | Extra instruction used when the schema is filled |
plugins | Skills, project context, steering, or SandboxPlugin. See Plugins |
sandbox_mode, execution_backend | A workspace for this agent. See Sandbox |
sandbox, sandbox_attach_mode | A shared workspace, and whether this agent can change it |
sandbox_output_offload | Where large sandbox tool results are stored |
memory, knowledge, guardrails, and mcp are also keys on this block. workspace_root, workspace_sync_policy, and sandbox_manager belong with the direct sandbox path. An unknown key is rejected when the agent is built. system_prompt is a plain string.