Skip to content

Commit

Permalink
improve docs
Browse files Browse the repository at this point in the history
  • Loading branch information
rcarrata committed Dec 4, 2024
1 parent 2d9f6d6 commit ef351bb
Show file tree
Hide file tree
Showing 21 changed files with 260 additions and 70 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 10 additions & 9 deletions content/modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,21 @@
* 5. Agentic-AI-Based Integrations
** xref:05-01-what-is-an-ai-agent.adoc[5.1 What is an AI Agent?]
** xref:05-02-agentic-architectures.adoc[5.1 Agentic Architectures]
** xref:05-03-routing-collaboration.adoc[5.3 Routing & Collaboration (AI Agents & Single LLM)]
** xref:05-04-routing-single-llm-agent-tools.adoc[5.4 Routing (Single LLM + Single Agent & Multiple Tools)]
** xref:05-05-collaboration-single-llm-agents.adoc[5.5 Collaboration (Single LLM & Multiple Agents)]
** xref:05-06-multiple-llms.adoc[5.6 Multiple Agent & Multi LLMs]
** xref:05-02-agentic-architectures.adoc[5.2 Agentic Architectures]
** xref:05-03-routing-collaboration.adoc[5.3 Agentic Routing]
** xref:05-04-tool-calling.adoc[5.4 Tool-Calling Agents]
** xref:05-05-sql-agents.adoc[5.5 SQL Retriever Agents]
** xref:05-06-react-implementation.adoc[5.6 ReAct Implementation]
** xref:05-07-deploying-agents.adoc[5.6 Deploying Agents From Notebook to Production]
* 6. Advanced Agentic AI
** xref:06-01-react-implementation.adoc[6.1 ReAct Implementation]
** xref:06-02-human-loop.adoc[6.2 Human in the Loop]
** xref:06-03-building-supervisors.adoc[6.3 Building Supervisors]
** xref:06-01-multi-agents.adoc[6.1 Multi-Agent Collaboration]
** xref:06-02-building-supervisors.adoc[6.2 Building Supervisors]
** xref:06-03-human-loop.adoc[6.3 Human in the Loop]
** xref:06-04-hierarchical-team-agents.adoc[6.4 Hierarchical Team Agents]
* 7. Enhance RAG with Agentic AI
** xref:07-01-adaptive-rag.adoc[7.1 Adaptive RAG]
** xref:07-01-agentic-rag.adoc[7.1 Agentic RAG]
** xref:07-02-self-rag.adoc[7.2 Self RAG]
* 8. End of Lab
Expand Down
22 changes: 18 additions & 4 deletions content/modules/ROOT/pages/03-04-crew-ai.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,26 @@ include::_attributes.adoc[]
* **Company**: CrewAI Inc.
* **License**: MIT
**AI Agents** by CrewAI Inc. is an open-source framework specifically designed for building scalable, multi-agent systems capable of tackling practical, industry-driven tasks. Built with flexibility and ease of use in mind, this framework empowers developers to create intelligent, customizable agents that interact and collaborate seamlessly within complex workflows.
**AI Agents** by CrewAI Inc. is an open-source framework specifically designed for building scalable, multi-agent
systems capable of tackling practical, industry-driven tasks. Built with flexibility and ease of use in mind, this
framework empowers developers to create intelligent, customizable agents that interact and collaborate seamlessly
within complex workflows.

== Key Features and Capabilities

- **Streamlined Modeling and Deployment**: CrewAI’s framework simplifies the process of modeling and managing multi-agent systems, allowing each agent to operate independently while remaining adaptable to specific workflows. This approach enables developers to design sophisticated systems tailored to diverse industry needs, such as customer support automation, process optimization, and more.
- **Streamlined Modeling and Deployment**: CrewAI’s framework simplifies the process of modeling and managing
multi-agent systems, allowing each agent to operate independently while remaining adaptable to specific workflows.
This approach enables developers to design sophisticated systems tailored to diverse industry needs, such as customer
support automation, process optimization, and more.

- **Seamless Integration with Human Oversight and External Tools**: Many real-world applications require a combination of autonomous operation and human supervision. CrewAI’s framework supports built-in Human-in-the-Loop functionality, allowing agents to defer to human input when necessary, particularly in high-stakes scenarios. Additionally, agents can integrate with a range of external tools to access data from APIs, databases, and other resources, making them capable of performing complex, data-driven tasks. For even more versatility, agents can execute code directly, equipping them to handle complex calculations and respond to dynamic conditions in real-time.
- **Seamless Integration with Human Oversight and External Tools**: Many real-world applications require a combination
of autonomous operation and human supervision. CrewAI’s framework supports built-in Human-in-the-Loop functionality,
allowing agents to defer to human input when necessary, particularly in high-stakes scenarios. Additionally, agents
can integrate with a range of external tools to access data from APIs, databases, and other resources, making them
capable of performing complex, data-driven tasks. For even more versatility, agents can execute code directly, equipping
them to handle complex calculations and respond to dynamic conditions in real-time.

- **Flexible Open-Source and Enterprise Solutions**: CrewAI Inc. offers an open-source version under the **MIT license**, promoting collaboration within the developer community. For enterprises, CrewAI also provides **CrewAI+**, an advanced version with a no-code interface, ready-made templates for common use cases, and enhanced capabilities for managing agents at scale in production environments.
- **Flexible Open-Source and Enterprise Solutions**: CrewAI Inc. offers an open-source version under the **MIT license**,
promoting collaboration within the developer community. For enterprises, CrewAI also provides **CrewAI+**, an advanced
version with a no-code interface, ready-made templates for common use cases, and enhanced capabilities for managing agents
at scale in production environments.
17 changes: 12 additions & 5 deletions content/modules/ROOT/pages/05-01-what-is-an-ai-agent.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ include::_attributes.adoc[]

An Agent is an autonomous system that leverages Large Language Models (LLMs) to perform tasks by understanding,
reasoning, planning, and executing actions with minimal human intervention. AI agents are designed to break down
complex problems into manageable steps, utilizing tools, accessing memory, and adapting their behavior based on the provided context.
complex problems into manageable steps, utilizing tools, accessing memory, and adapting their behavior based on the
provided context.

At its core, an agent is structured to:

Expand All @@ -19,13 +20,19 @@ image::02/02-01-agentic-vs-non-agentic.png[AI Agents Diagram]

== Key Components of an AI Agent:

- **Profiling Module (Agent Core)**: This is the agent's decision-making hub. It defines the role and goals of the agent (e.g., financial analyst, teacher), selects appropriate tools, and coordinates task execution. The agent's "profile" helps determine its behavior and interaction style based on its role.
- **Profiling Module (Agent Core)**: This is the agent's decision-making hub. It defines the role and goals of
the agent (e.g., financial analyst, teacher), selects appropriate tools, and coordinates task execution.
The agent's "profile" helps determine its behavior and interaction style based on its role.

- **Memory Module**: The agent uses memory to track past interactions and experiences. Short-term memory stores context-relevant information (e.g., current session details), while long-term memory retains important information over time, which the agent can refer back to when needed.
- **Memory Module**: The agent uses memory to track past interactions and experiences. Short-term memory stores
context-relevant information (e.g., current session details), while long-term memory retains important information
over time, which the agent can refer back to when needed.

- **Tools Module**: External resources (e.g., APIs, databases) that the agent can call upon to complete tasks, like retrieving real-time data, performing calculations, or interacting with other systems.
- **Tools Module**: External resources (e.g., APIs, databases) that the agent can call upon to complete tasks,
like retrieving real-time data, performing calculations, or interacting with other systems.

- **Planning Module**: This module allows the agent to break down complex tasks into smaller, manageable sub-tasks. By planning step-by-step, the agent can tackle intricate queries and tasks with greater efficiency and precision.
- **Planning Module**: This module allows the agent to break down complex tasks into smaller, manageable sub-tasks.
By planning step-by-step, the agent can tackle intricate queries and tasks with greater efficiency and precision.

image::02/02-02-agentic-components.png[AI Agents Diagram]

Expand Down
7 changes: 5 additions & 2 deletions content/modules/ROOT/pages/05-02-agentic-architectures.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@ This flexibility allows agents to solve a wider range of problems, adapting thei

image::05/05-02-agents.png[Agentic Integrations]

1. **Router Agents**: These agents make single-step decisions, selecting from a predefined set of options. They often use structured outputs and prompt engineering to ensure reliable decision-making.
1. **Router Agents**: These agents make single-step decisions, selecting from a predefined set of options.
They often use structured outputs and prompt engineering to ensure reliable decision-making.
2. **Tool-Calling Agents**: These agents use tools like APIs, databases, or code interpreters to solve tasks beyond the LLM’s capabilities. The LLM selects the appropriate tool based on the user input, executing multi-step workflows with access to external resources.
2. **Tool-Calling Agents**: These agents use tools like APIs, databases, or code interpreters to solve tasks
beyond the LLM’s capabilities. The LLM selects the appropriate tool based on the user input, executing multi-step
workflows with access to external resources.
3. **ReAct Agents**: A general-purpose architecture that combines **Tool Calling**, **Memory**, and **Planning**:
- **Tool Calling**: Allows the LLM to invoke various tools dynamically.
Expand Down
47 changes: 45 additions & 2 deletions content/modules/ROOT/pages/05-03-routing-collaboration.adoc
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.

This file was deleted.

48 changes: 48 additions & 0 deletions content/modules/ROOT/pages/05-04-tool-calling.adoc
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.

This file was deleted.

44 changes: 44 additions & 0 deletions content/modules/ROOT/pages/05-05-sql-agents.adoc
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.
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ This structured loop ensures logical task progression and actionable outcomes.

image::04/04-07-react-final.png[ReAct Final]

== Exercise: ReAct 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-simple-agent-routing.ipynb` and follow the instructions.

== Advantages of ReAct Agents

- **Adaptability**: Handles dynamic tasks by reasoning through unexpected scenarios and acting accordingly.
Expand Down
5 changes: 5 additions & 0 deletions content/modules/ROOT/pages/05-07-deploying-agents.adoc
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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
= Multiple LLMs
= Multi-Agent Collaboration
include::_attributes.adoc[]
:slide:

Expand Down
Loading

0 comments on commit ef351bb

Please sign in to comment.