Skip to content

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_time
python
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 ​

KeyWhat it holds
typeAlways Agent
name, descriptionLabels for the agent. Not the system prompt
system_promptThe instruction, as a plain string
modelThe chat model. See Model
toolsPrebuilt tools, custom tools, or other agents. See Tools
httpHTTP endpoints declared as tools. See HTTP tools
structured_outputA Pydantic class the answer must fill. See Structured output
structured_output_promptExtra instruction used when the schema is filled
pluginsSkills, project context, steering, or SandboxPlugin. See Plugins
sandbox_mode, execution_backendA workspace for this agent. See Sandbox
sandbox, sandbox_attach_modeA shared workspace, and whether this agent can change it
sandbox_output_offloadWhere 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.


Copyright © 2026 elsai foundry.