Skip to main content

Attributes

The DeepAgent class accepts the following initialization parameters:
AttributeTypeDefaultDescription
modelstr | Model"openai/gpt-4o"Model identifier or Model instance
subagentsList[Agent] | NoneNoneList of Agent instances to use as subagents (each must have a name)
instructionsstr | NoneNoneAdditional instructions to append to system prompt
tool_call_limitint100Maximum tool calls per execution
memoryMemory | NoneAuto-createdMemory instance (auto-created with InMemoryStorage if not provided)

Configuration Example

from upsonic import DeepAgent, Agent, Task

# Create specialized subagents
researcher = Agent(
    "openai/gpt-4o",
    name="researcher",
    system_prompt="You are a research expert"
)

writer = Agent(
    "openai/gpt-4o",
    name="writer",
    system_prompt="You are a technical writer"
)

# Create deep agent with subagents
agent = DeepAgent(
    model="openai/gpt-4o",
    subagents=[researcher, writer],
    instructions="Focus on clarity and accuracy",
    tool_call_limit=150
)

# Create task
task = Task(
    description="Research AI frameworks and write a comprehensive comparison"
)

# Execute
result = agent.do(task)
print(result)