Module 9 Wrap-up: Giving Your Agent Powers
Hands-on: Build a toolbox for an agent that can multiply numbers and search Wikipedia.
Module 9 Wrap-up: The Toolsmith
You have learned that LLMs don't have to be "Shut-in researchers." By providing Custom Tools and Community Integrations, you have given your AI the ability to interact with the world. This is the Final Ingredient required to build an autonomous Agent.
Hands-on Exercise: The Calculator-Researcher
1. The Goal
Create a list of 2 tools:
- A custom
@toolthat calculates the area of a circle given a radius. - A standard
Wikipediasearch tool.
2. The Implementation Plan
- Define the
calculate_areafunction with a clear docstring. - Import
WikipediaQueryRun. - Store them in a list called
tools = [...]. - Test: Call
calculate_area.invoke(5)and see the result.
Module 9 Summary
- Tools: Abstractions that allow LLMs to take action.
- Descriptions: The "Manual" the AI reads to understand the tool.
- Decorator: Using
@toolto instantly convert Python code. - Community: Using pre-built tools like Tavily or Wikipedia.
- Safety: Understanding the risks of tools like
PythonREPL.
Coming Up Next...
In Module 10, we bring everything together into Agents. We will learn about the Reasoning Loop, and how a model uses these tools to solve complex, multi-step problems autonomously.
Module 9 Checklist
- I have converted a Python function into a tool using
@tool. - My tool docstrings are descriptive and helpful for an AI.
- I understand the JSON schema that is generated by the decorator.
- I have used the
TavilyorWikipediatool in a script. - I know why small, atomic tools are better than large, complex ones.