Tools
Tools allow agents to take actions by executing Python code. Letta uses tools to manage memory and even to send messages to the end user. You can add custom tools to Letta by defining your own tools, and also customize the execution environment of the tools. You can import external tool libraries like Composio.
Default Tools
By default, agents in Letta are created with the following tools:
Letta also includes a set of pre-made tools designed for multi-agent interaction. See our guide on multi-agent for more information.
You can disable the default tools by passing include_base_tools=False
to the agent creation.
Defining Custom Tools
You can create custom tools in Letta using the SDKs, as well as via the ADE tool builder. See more on defining custom tools here.
Once the tool is created, you can add it to an agent by passing the tool name to the tools
parameter in the agent creation.
Tool Execution
You can custom the enviornment that your tool runs in (the Python package dependencies and environment variables) by setting a tool execution environment. See more here.
Tool Environment Variables
You can set agent-scoped environment variables for your tools. These environment variables will be accessible in the sandboxed environment that any of the agent tools are run in.
For example, if you define a custom tool that requires an API key to run (e.g. EXAMPLE_TOOL_API_KEY
), you can set the variable at time of agent creation by using the tool_exec_environment_variables
parameter:
Tool Rules
Tool rules allow you to define graph-like constrains on your tools, such as requiring that a tool terminate agent execution or be followed by another tool.
Read more about tool rules here.
External Tool Libraries
Letta also has early support for adding tools from external tool libraries via MCP and Composio.
For more information on setting up MCP servers, see our MCP guide.
For more information on setting up Composio tools, see our Composio guide.