Define and customize tools
Letta Tools
By default, agents in Letta are created with the following tools:
Custom Tools
You can create custom tools in Letta in Python. When you define the function for the tool, you must make sure to have a properly formatting docstring for Letta to parse the function schema.
Adding tools to agents
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.
External Tool Libraries
Letta also has early support for adding tools from the external tool library Composio. This integrations works by converting the external library tools into Letta tools.
Composio Tools
To use Letta with Composio tools, make sure you install dependencies with pip install 'letta[external-tools]
. Then, make sure you log in to Composio and add any necessary authentication.
For example, to use
Now, you can include the tool to be used with your agent. See a working example here.
Excluding default tools
To skip adding default tools when creating a new agent, you can add in include_default_tools=False
to the agent creation:
This will create an agent with no tools, so the agent will have no ability to manage memory or search conversation history.
Tool Rules (Graphs)
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.