About the workshop
Introduction¶
Welcome to our workshop! In this workshop we'll be using the open-sourced IBM Granite AI foundation models to develop AI agents.
An AI agent is an autonomous software system powered by large language models (LLMs) that perceives its environment, reasons, plans, and takes actions using external tools to achieve specific goals with little to no human supervision.
By the end of this workshop, you will learn about:
Function Calling Agents¶
A function calling agent is an AI system that can intelligently select and invoke predefined functions or tools to accomplish tasks. Instead of just generating text responses, it can:
- Analyze user requests to determine which functions are needed
- Extract parameters from natural language and format them correctly
- Execute functions by making structured API calls with proper arguments
- Process results and integrate them into coherent responses
Plan-and-Solve Agents¶
Plan-and-Solve Agents consist of a planner node and Function Calling (FC) node. The planner node is responsible for considering the query, coming up with reasoning and generating a complete plan for execution, selecting the tools to use and their ordering. The output of the planner node is passed to the FC node which loads up the tool calls, assisted by the LLM to set the tool call parameters. Once the FC node has executed the plan, the agent may or may not invoke the planner node again to determine if some additional steps are required based on the tool results.
Route-and-Solve Agents¶
Route-and-Solve Agents consist of a router and multiple function calling nodes. Each of the function calling nodes has, in its toolkit, a subset of the complete list of tools. This enables a sort of semantic grouping of the tools into different categories, that the router can select from based on the end user query. This approach can be thought of as a Router which routes to multiple function calling sub-agents.
ToolRAG Agents¶
ToolRAG Agents operate by first doing RAG on the set of available tools based on the query and only show a subset of the toolset to the model to select from for a given query. This pre-filtering approach reduces the likelihood of the model choosing the wrong tools as it is already being shown a smaller set of relevant tools to pick from.
ReAct Agents¶
ReAct and Reasoning Agents are similar to function calling agents but with additional reasoning. They justify which tool to use with some prerequisite reasoning to help correctly identify the tool to use and run. Each tool selection is followed by another iteration to see if the agent reasons to select another tool or is ready to answer.
About this workshop¶
The introductory page of the workshop is broken down into the following sections:
Agenda¶
| Lab | Description |
|---|---|
| Lab 0. Pre-work | Pre-work for the workshop |
| Lab 1. Function Calling Agent | Build a simple function calling agent with Granite |
| Lab 2. Plan-and-Solve Agent | Build a plan-and-solve agent with Granite |
| Lab 3. Route-and-Solve Agent | Build a route-and-solve agent with Granite |
| Lab 4. ToolRAG Agent | Build a tool RAG agent with Granite. |
| Lab 5. ReAct Agent | Build a ReAct agent with Granite |
Technology Used¶
The following technology is used in the workshop:
Credits¶
- BJ Hargrave
- Prattyush Mangal
- Jacques-Sylvain Lecointre
- Aditya Gidh
- Shonda Witherspoon
- The notebooks used in this workshop are versions of notebooks from the Granite Agent Cookbook modified for the workshop needs