-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
260 additions
and
70 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 45 additions & 2 deletions
47
content/modules/ROOT/pages/05-03-routing-collaboration.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,48 @@ | ||
= Routing collaboration | ||
= Agentic Routing | ||
include::_attributes.adoc[] | ||
:slide: | ||
|
||
TBD | ||
## **Overview** | ||
|
||
A **Router** is a specialized agent architecture that enables an LLM to select a single step | ||
from a predefined set of options. It offers a constrained yet effective way to control decision-making, | ||
ensuring precision and reliability in specific applications. | ||
|
||
Routers are ideal for scenarios where an LLM must make a single decision or route a task based on | ||
context, without the complexity of managing an entire control flow. | ||
|
||
## **Key Features of Routers** | ||
|
||
1. **Decision-Making Scope**: | ||
- The LLM is presented with a predefined set of options (e.g., tools, APIs, or pathways). | ||
- It selects the most appropriate option based on the input context. | ||
2. **Deterministic Output**: | ||
- The LLM's decision is limited to a constrained set of outcomes, enhancing predictability. | ||
3. **Focused Control**: | ||
- Routers are designed to handle specific, single-choice decisions, reducing complexity while maintaining flexibility. | ||
## **How Routers Work** | ||
|
||
1. **Input**: The router receives a user query or task. | ||
2. **Evaluation**: The LLM evaluates the query against predefined options. | ||
3. **Routing**: It selects the appropriate step or tool to proceed. | ||
4. **Execution**: The selected tool or path is executed to complete the task. | ||
![Router Architecture Diagram](02/02-03-router-architecture.png) | ||
|
||
## **Examples of Router Applications** | ||
|
||
- **Tool Selection**: An LLM determines which tool to call for specific tasks, such as querying a database or sending an email. | ||
- **Pathway Routing**: Routing queries to different models or workflows based on their complexity or type. | ||
- **Validation**: Deciding if additional steps are needed or if a generated response is sufficient. | ||
## **Benefits of Routers** | ||
|
||
- **Efficiency**: Simplifies decision-making with predefined choices. | ||
- **Reliability**: Constrained options reduce the likelihood of errors. | ||
- **Flexibility**: Can adapt to various tasks within the defined scope. | ||
Routers exemplify a minimal yet powerful approach to enabling control flow in LLM-based systems, making them a | ||
cornerstone of modern AI agent architectures. |
5 changes: 0 additions & 5 deletions
5
content/modules/ROOT/pages/05-04-routing-single-llm-agent-tools.adoc
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
= Tool Calling in AI Agents | ||
include::_attributes.adoc[] | ||
:slide: | ||
|
||
== **Overview** | ||
|
||
While routers provide a limited decision-making scope, tool-calling agents expand the capabilities of an LLM by | ||
allowing it to interact with external systems. This approach empowers agents to dynamically solve problems by | ||
utilizing tools, accessing memory, and planning multi-step actions. | ||
|
||
Tool calling agents enable: | ||
|
||
1. **Multi-Step Decision Making**: The LLM can orchestrate a sequence of decisions to achieve complex objectives. | ||
2. **Tool Access**: The LLM can select and use various tools as needed to interact with external systems and APIs. | ||
|
||
This architecture allows for more dynamic and flexible behaviors, enabling agents to solve intricate tasks by | ||
leveraging external resources efficiently. | ||
|
||
== **Tool Calling** | ||
|
||
Tools are essential for enabling agents to interact with external systems, such as APIs or databases. | ||
Since external systems often require specific input schemas or payloads, a tool-calling agent bridges | ||
the gap between natural language inputs and the structured requirements of these systems. | ||
|
||
=== How Tool Calling Works: | ||
|
||
1. **Tool Awareness**: The agent is given knowledge of the required input schema for each tool (e.g., parameters or payloads). | ||
2. **Decision Making**: Based on user input, the LLM decides whether to call a tool and selects the appropriate one. | ||
3. **Execution**: The agent uses the tool to perform a task, ensuring the input and output align with the tool's requirements. | ||
4. **Result Handling**: The output from the tool is processed and incorporated into the agent’s response or subsequent actions. | ||
|
||
== Exercise: Tool Calling and Routing Agents - Practical Example | ||
|
||
Let's see the Tool Calling and Routing Agents in Action! | ||
|
||
From the `agentic-workshop/lab-materials/05` folder, please open the notebook called `5.1-agent-routing.ipynb` and follow the instructions. | ||
|
||
=== Example Use Cases: | ||
|
||
- **API Interaction**: The agent queries a weather API using structured inputs to fetch real-time data. | ||
- **Data Retrieval**: The agent retrieves information from a database using a specific query format. | ||
- **Calculations**: The agent performs numerical calculations by calling a computation tool. | ||
|
||
== **Benefits of Tool Calling** | ||
|
||
- **Expanded Functionality**: Allows agents to perform tasks beyond natural language processing by integrating with external systems. | ||
- **Dynamic Problem-Solving**: Empowers agents to adapt and plan multi-step actions involving tool usage. | ||
- **Structured Interactions**: Ensures inputs and outputs adhere to predefined schemas, improving reliability and consistency. |
5 changes: 0 additions & 5 deletions
5
content/modules/ROOT/pages/05-05-collaboration-single-llm-agents.adoc
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
= SQL Retriever Agents | ||
include::_attributes.adoc[] | ||
:slide: | ||
|
||
SQL Retriever Agents leverage the power of LLMs to interact with SQL databases, enabling dynamic and | ||
intelligent query generation. | ||
These agents can answer complex questions by accessing structured data and | ||
executing multi-step processes to retrieve and analyze information. | ||
|
||
== **How SQL Retriever Agents Work** | ||
|
||
SQL Retriever Agents operate by combining LLM capabilities with structured database interactions. | ||
|
||
The process typically involves the following steps: | ||
|
||
1. **Retrieve Tables**: The agent queries the database to get a list of tables and their metadata. | ||
2. **Identify Relevant Tables**: The agent determines which tables are most relevant to the user’s query. | ||
3. **Understand Table Structure**: The agent fetches the schema or structure of the relevant tables. | ||
4. **Generate Query**: The agent creates an SQL query based on the user’s input and the table structure. | ||
5. **Validate Query**: The agent checks the query for errors or inconsistencies. | ||
6. **Execute Query**: The agent runs the query and retrieves the data. | ||
7. **Handle Errors**: The agent refines the query if needed to resolve any issues. | ||
8. **Provide Results**: The agent formats the retrieved data into a clear and concise response. | ||
|
||
image::05/05-07-sql-agents.png[SQL Agents] | ||
|
||
== Exercise: SQL Retriever Agents - Practical Example | ||
|
||
Let's see the SQL Retriever Agents in Action! | ||
|
||
From the `agentic-workshop/lab-materials/05` folder, please open the notebook called `4.5-sql-agents.ipynb` and follow the instructions. | ||
|
||
== **Example Use Cases** | ||
|
||
- **Data Analytics**: Generating reports or extracting key insights from large datasets in SQL databases. | ||
- **Customer Queries**: Answering natural language questions about a database, such as “What were the top sales last quarter?” | ||
- **Operational Efficiency**: Automating routine SQL tasks, such as generating performance metrics or updating data. | ||
|
||
== **Benefits of SQL Retriever Agents** | ||
|
||
- **Dynamic Querying**: Allows agents to adapt queries to user input and database schema dynamically. | ||
- **Error Mitigation**: By iteratively refining queries, agents ensure accurate results even when errors occur. | ||
- **Ease of Use**: Enables users to query complex databases using natural language, removing the need for SQL expertise. | ||
- **Scalability**: SQL Retriever Agents can operate across multiple databases and integrate with broader workflows seamlessly. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
= Deploying Agents from Notebook to Production | ||
include::_attributes.adoc[] | ||
:slide: | ||
|
||
TBD |
2 changes: 1 addition & 1 deletion
2
...dules/ROOT/pages/05-06-multiple-llms.adoc → ...odules/ROOT/pages/06-01-multi-agents.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
= Multiple LLMs | ||
= Multi-Agent Collaboration | ||
include::_attributes.adoc[] | ||
:slide: | ||
|
||
|
File renamed without changes.
Oops, something went wrong.