Skip to main content
Complete reference for the Laddr agent configuration schema.

Agent Configuration

from laddr import Agent

agent = Agent(
    name="researcher",
    role="Web Research Specialist",
    goal="Search the web and summarize findings",
    backstory="You are a research-focused agent...",
    llm=llm_config,
    tools=[tool1, tool2],
    max_retries=1,
    max_iterations=3,
    max_tool_calls=10,
    timeout=300,
    trace_enabled=True,
    instructions="Custom instructions...",
    is_coordinator=False
)


Required Fields

FieldTypeDescription
namestrUnique agent identifier
rolestrAgent’s role description
goalstrPrimary objective or task
backstorystrContext that shapes behavior
llmLLMLLM configuration object

Optional Fields

FieldTypeDefaultDescription
toolslist[]List of tool functions
max_retriesint1Number of retries for failed tasks
max_iterationsint3Maximum reasoning loops
max_tool_callsint10Maximum tool calls per iteration
timeoutint300Task timeout in seconds
trace_enabledboolTrueEnable execution tracing
instructionsstrNoneCustom instructions for behavior
is_coordinatorboolFalseEnable delegation tools

LLM Configuration

OpenAI

from laddr.llms import openai

llm = openai(
    model="gpt-4o-mini",
    temperature=0.0,
    max_tokens=2000
)

Gemini

from laddr.llms import gemini

llm = gemini(
    model="gemini-2.5-flash",
    temperature=0.0
)

Anthropic

from laddr.llms import anthropic

llm = anthropic(
    model="claude-3-5-sonnet-20241022",
    temperature=0.0
)

Ollama

from laddr.llms import ollama

llm = ollama(
    model="llama3.2:latest",
    base_url="http://localhost:11434"
)


Example Configuration

from laddr import Agent
from laddr.llms import gemini
from tools.web_tools import web_search

researcher = Agent(
    name="researcher",
    role="Web Research Specialist",
    goal="Search the web and summarize findings",
    backstory="""You are a research-focused agent who finds accurate
    data online and presents it clearly.""",
    llm=gemini(model="gemini-2.5-flash", temperature=0.0),
    tools=[web_search],
    max_retries=1,
    max_iterations=3,
    max_tool_calls=2,
    timeout=45,
    trace_enabled=True,
    instructions="""
    When researching:
    1. Use web_search to find information
    2. Prioritize recent sources
    3. Cite sources in your response
    """
)


Next Steps