Tools
Define and customize tools
Letta Tools
By default, agents in Letta are created with the following tools:
Tool | Description |
---|---|
send_message | Sends a message to the human user. |
conversation_search | Search prior conversation history |
conversation_search_date | Search prior conversation history using a date range |
archival_memory_insert | Add a memory to archival memory |
archival_memory_search | Search archival memory via embedding search |
Excluding default tools
To skip adding default tools, you can add in include_default_tools=False
to the agent creation:
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 Libraries
Letta also has early support for adding tools from external libraries like Langchain, Composio, and CrewAI. These integrations work by converting external libraries’ tools into Letta tools.
Langchain Tools
Letta supports adding tools from Langchain. To use tools from Langchain, make sure you run pip install 'letta[external-tools]'
to install the necessary dependencies.
Now, you can include to tool when you create agents with Letta. See a working example here.
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.
CrewAI Tools
Letta also supports adding tools from CrewAI. Make sure you first run pip install 'letta[external-tools]'
to install the necessary dependencies.
Now, you can include the tool when you create agents with Letta. See a working example here.