Agents
Agent
Parameter | Type | Default | Description |
---|---|---|---|
model | Optional[Model] | None | Model to use for this Agent |
name | Optional[str] | None | Agent name |
agent_id | Optional[str] | None | Agent UUID (autogenerated if not set) |
agent_data | Optional[Dict[str, Any]] | None | Metadata associated with this agent |
introduction | Optional[str] | None | Agent introduction. This is added to the chat history when a run is started. |
user_id | Optional[str] | None | ID of the user interacting with this agent |
user_data | Optional[Dict[str, Any]] | None | Metadata associated with the user interacting with this agent |
session_id | Optional[str] | None | Session UUID (autogenerated if not set) |
session_name | Optional[str] | None | Session name |
session_state | Optional[Dict[str, Any]] | None | Session state (stored in the database to persist across runs) |
context | Optional[Dict[str, Any]] | None | Context available for tools and prompt functions |
add_context | bool | False | If True, add the context to the user prompt |
resolve_context | bool | True | If True, resolve the context (i.e. call any functions in the context) before running the agent |
memory | Optional[Memory] | None | Agent Memory |
add_history_to_messages | bool | False | Add chat history to the messages sent to the Model |
num_history_responses | int | 3 | Number of historical responses to add to the messages |
knowledge | Optional[AgentKnowledge] | None | Agent Knowledge |
add_references | bool | False | Enable RAG by adding references from AgentKnowledge to the user prompt |
retriever | Optional[Callable[..., Optional[List[Dict]]]] | None | Function to get references to add to the user_message |
references_format | Literal["json", "yaml"] | "json" | Format of the references |
storage | Optional[AgentStorage] | None | Agent Storage |
extra_data | Optional[Dict[str, Any]] | None | Extra data stored with this agent |
tools | Optional[List[Union[Toolkit, Callable, Function]]] | None | A list of tools provided to the Model |
show_tool_calls | bool | False | Show tool calls in Agent response |
tool_call_limit | Optional[int] | None | Maximum number of tool calls allowed |
tool_choice | Optional[Union[str, Dict[str, Any]]] | None | Controls which (if any) tool is called by the model |
reasoning | bool | False | Enable reasoning by working through the problem step by step |
reasoning_model | Optional[Model] | None | Model to use for reasoning |
reasoning_agent | Optional[Agent] | None | Agent to use for reasoning |
reasoning_min_steps | int | 1 | Minimum number of reasoning steps |
reasoning_max_steps | int | 10 | Maximum number of reasoning steps |
read_chat_history | bool | False | Add a tool that allows the Model to read the chat history |
search_knowledge | bool | True | Add a tool that allows the Model to search the knowledge base |
update_knowledge | bool | False | Add a tool that allows the Model to update the knowledge base |
read_tool_call_history | bool | False | Add a tool that allows the Model to get the tool call history |
system_message | Optional[Union[str, Callable, Message]] | None | Provide the system message as a string or function |
system_message_role | str | "system" | Role for the system message |
create_default_system_message | bool | True | If True, create a default system message using agent settings |
description | Optional[str] | None | A description of the Agent that is added to the start of the system message |
goal | Optional[str] | None | The goal of this task |
instructions | Optional[Union[str, List[str], Callable]] | None | List of instructions for the agent |
expected_output | Optional[str] | None | Provide the expected output from the Agent |
additional_context | Optional[str] | None | Additional context added to the end of the system message |
markdown | bool | False | If markdown=true, add instructions to format the output using markdown |
add_name_to_instructions | bool | False | If True, add the agent name to the instructions |
add_datetime_to_instructions | bool | False | If True, add the current datetime to the instructions |
add_state_in_messages | bool | False | If True, add the session state variables in messages |
add_messages | Optional[List[Union[Dict, Message]]] | None | A list of extra messages added after the system message |
user_message | Optional[Union[List, Dict, str, Callable, Message]] | None | Provide the user message |
user_message_role | str | "user" | Role for the user message |
create_default_user_message | bool | True | If True, create a default user message |
retries | int | 0 | Number of retries to attempt |
delay_between_retries | int | 1 | Delay between retries |
exponential_backoff | bool | False | If True, the delay between retries is doubled each time |
response_model | Optional[Type[BaseModel]] | None | Provide a response model to get the response as a Pydantic model |
parse_response | bool | True | If True, the response is converted into the response_model |
use_json_mode | bool | False | If response_model is set, sets the response "mode" of the model, i.e. if the model should explicitly respond with a JSON object instead of a Pydantic model |
save_response_to_file | Optional[str] | None | Save the response to a file |
stream | Optional[bool] | None | Stream the response from the Agent |
stream_intermediate_steps | bool | False | Stream the intermediate steps from the Agent |
team | Optional[List[Agent]] | None | The team of agents that this agent can transfer tasks to |
team_data | Optional[Dict[str, Any]] | None | Data shared between team members |
role | Optional[str] | None | If this Agent is part of a team, this is the role of the agent |
respond_directly | bool | False | If True, member agent responds directly to user |
add_transfer_instructions | bool | True | Add instructions for transferring tasks to team members |
team_response_separator | str | "\n" | Separator between responses from the team |
debug_mode | bool | False | Enable debug logs |
monitoring | bool | False | Log Agent information to agno.com for monitoring |
telemetry | bool | True | Log minimal telemetry for analytics |