Managed Deep Agents - Tools
This video details how to extend the functionality of a managed deep agent by implementing custom tools. Tools allow agents to interact with external systems (like databases or proprietary APIs) beyond built-in capabilities. Custom tools are defined as standard Python/TypeScript functions decorated with `@tool` and require detailed docstrings, which guide the Large Language Model (LLM) on how and when to use them.
Key takeaways
-
Purpose of Tools
Tools give agents capability by allowing interaction with the outside world, such as looking up data in databases or taking actions via external APIs. Built-in tools (e.g., web search) are provided by the underlying model, while custom tools address specific organizational needs.
-
Defining Custom Tools
In Python, a custom tool is defined as a function decorated with `@tool` from `LangChain tools`. The function's name becomes the tool name, its parameters are what the LLM must fill out, and the docstring serves as the primary description for the agent.
-
Integration Process
2:00
To use a custom tool, define it in a separate file (e.g., `tools/lookup.py`), and then import and pass the function reference into the agent definition script.