Skip to content

Commit b4d37fb

Browse files
Merge pull request #597 from huggingface/migrate-tips
migrate-tips
2 parents bdcf382 + 6657b08 commit b4d37fb

118 files changed

Lines changed: 487 additions & 649 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

units/en/bonus-unit2/monitoring-and-evaluating-agents-notebook.mdx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@
66

77
# Bonus Unit 2: Observability and Evaluation of Agents
88

9-
<Tip>
10-
You can follow the code in <a href="https://colab.research.google.com/#fileId=https%3A//huggingface.co/agents-course/notebooks/blob/main/bonus-unit2/monitoring-and-evaluating-agents.ipynb" target="_blank">this notebook</a> that you can run using Google Colab.
11-
</Tip>
9+
> [!TIP]
10+
> You can follow the code in <a href="https://colab.research.google.com/#fileId=https%3A//huggingface.co/agents-course/notebooks/blob/main/bonus-unit2/monitoring-and-evaluating-agents.ipynb" target="_blank">this notebook</a> that you can run using Google Colab.
1211
1312
In this notebook, we will learn how to **monitor the internal steps (traces) of our AI agent** and **evaluate its performance** using open-source observability tools.
1413

units/en/unit1/actions.mdx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
# Actions: Enabling the Agent to Engage with Its Environment
22

3-
<Tip>
4-
In this section, we explore the concrete steps an AI agent takes to interact with its environment.
5-
6-
We’ll cover how actions are represented (using JSON or code), the importance of the stop and parse approach, and introduce different types of agents.
7-
</Tip>
3+
> [!TIP]
4+
> In this section, we explore the concrete steps an AI agent takes to interact with its environment.
5+
>
6+
> We’ll cover how actions are represented (using JSON or code), the importance of the stop and parse approach, and introduce different types of agents.
87
98
Actions are the concrete steps an **AI agent takes to interact with its environment**.
109

units/en/unit1/thoughts.mdx

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11

22
# Thought: Internal Reasoning and the ReAct Approach
33

4-
<Tip>
5-
6-
In this section, we dive into the inner workings of an AI agent—its ability to reason and plan. We’ll explore how the agent leverages its internal dialogue to analyze information, break down complex problems into manageable steps, and decide what action to take next.
7-
8-
Additionally, we introduce the ReAct approach, a prompting technique that encourages the model to think “step by step” before acting.
9-
10-
</Tip>
4+
> [!TIP]
5+
> In this section, we dive into the inner workings of an AI agent—its ability to reason and plan. We’ll explore how the agent leverages its internal dialogue to analyze information, break down complex problems into manageable steps, and decide what action to take next.
6+
>
7+
> Additionally, we introduce the ReAct approach, a prompting technique that encourages the model to think “step by step” before acting.
118
129
Thoughts represent the **Agent's internal reasoning and planning processes** to solve the task.
1310

@@ -85,10 +82,7 @@ Action: Finish["It's 18°C and cloudy in Paris."]
8582
| External tools | ❌ No | ✅ Yes (Actions + Observations) |
8683
| Best suited for | Logic, math, internal tasks | Info-seeking, dynamic multi-step tasks |
8784

88-
<Tip>
89-
90-
Recent models like **Deepseek R1** or **OpenAI’s o1** were fine-tuned to *think before answering*. They use structured tokens like `<think>` and `</think>` to explicitly separate the reasoning phase from the final answer.
91-
92-
Unlike ReAct or CoT — which are prompting strategies — this is a **training-level technique**, where the model learns to think via examples.
93-
94-
</Tip>
85+
> [!TIP]
86+
> Recent models like **Deepseek R1** or **OpenAI’s o1** were fine-tuned to *think before answering*. They use structured tokens like `<think>` and `</think>` to explicitly separate the reasoning phase from the final answer.
87+
>
88+
> Unlike ReAct or CoT — which are prompting strategies — this is a **training-level technique**, where the model learns to think via examples.

units/en/unit1/what-are-agents.mdx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,8 @@ The most common AI model found in Agents is an LLM (Large Language Model), which
8383

8484
Well known examples are **GPT4** from **OpenAI**, **LLama** from **Meta**, **Gemini** from **Google**, etc. These models have been trained on a vast amount of text and are able to generalize well. We will learn more about LLMs in the [next section](what-are-llms).
8585

86-
<Tip>
87-
It's also possible to use models that accept other inputs as the Agent's core model. For example, a Vision Language Model (VLM), which is like an LLM but also understands images as input. We'll focus on LLMs for now and will discuss other options later.
88-
</Tip>
86+
> [!TIP]
87+
> It's also possible to use models that accept other inputs as the Agent's core model. For example, a Vision Language Model (VLM), which is like an LLM but also understands images as input. We'll focus on LLMs for now and will discuss other options later.
8988
9089
## How does an AI take action on its environment?
9190

units/en/unit1/what-are-llms.mdx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,8 @@ The table below illustrates the diversity of special tokens.
118118
</tbody>
119119
</table>
120120

121-
<Tip>
122-
123-
We do not expect you to memorize these special tokens, but it is important to appreciate their diversity and the role they play in the text generation of LLMs. If you want to know more about special tokens, you can check out the configuration of the model in its Hub repository. For example, you can find the special tokens of the SmolLM2 model in its <a href="https://huggingface.co/HuggingFaceTB/SmolLM2-135M-Instruct/blob/main/tokenizer_config.json">tokenizer_config.json</a>.
124-
125-
</Tip>
121+
> [!TIP]
122+
> We do not expect you to memorize these special tokens, but it is important to appreciate their diversity and the role they play in the text generation of LLMs. If you want to know more about special tokens, you can check out the configuration of the model in its Hub repository. For example, you can find the special tokens of the SmolLM2 model in its <a href="https://huggingface.co/HuggingFaceTB/SmolLM2-135M-Instruct/blob/main/tokenizer_config.json">tokenizer_config.json</a>.
126123
127124
## Understanding next token prediction.
128125

units/en/unit2/langgraph/document_analysis_agent.mdx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@ The workflow we’ll build follows this structured schema:
1818

1919
![Butler's Document Analysis Workflow](https://huggingface.co/datasets/agents-course/course-images/resolve/main/en/unit2/LangGraph/alfred_flow.png)
2020

21-
<Tip>
22-
You can follow the code in <a href="https://huggingface.co/agents-course/notebooks/blob/main/unit2/langgraph/agent.ipynb" target="_blank">this notebook</a> that you can run using Google Colab.
23-
</Tip>
21+
> [!TIP]
22+
> You can follow the code in <a href="https://huggingface.co/agents-course/notebooks/blob/main/unit2/langgraph/agent.ipynb" target="_blank">this notebook</a> that you can run using Google Colab.
2423
2524
## Setting Up the environment
2625

units/en/unit2/langgraph/first_graph.mdx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@ Now that we understand the building blocks, let's put them into practice by buil
99

1010
This example demonstrates how to structure a workflow with LangGraph that involves LLM-based decision-making. While this can't be considered an Agent as no tool is involved, this section focuses more on learning the LangGraph framework than Agents.
1111

12-
<Tip>
13-
You can follow the code in <a href="https://huggingface.co/agents-course/notebooks/blob/main/unit2/langgraph/mail_sorting.ipynb" target="_blank">this notebook</a> that you can run using Google Colab.
14-
</Tip>
12+
> [!TIP]
13+
> You can follow the code in <a href="https://huggingface.co/agents-course/notebooks/blob/main/unit2/langgraph/mail_sorting.ipynb" target="_blank">this notebook</a> that you can run using Google Colab.
1514
1615
## Our Workflow
1716

units/en/unit2/langgraph/introduction.mdx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,8 @@ In this unit, you'll discover:
1616
### 4️⃣ [Alfred, the document Analyst agent](./document_analysis_agent)
1717
### 5️⃣ [Quiz](./quizz1)
1818

19-
<Tip warning={true}>
20-
The examples in this section require access to a powerful LLM/VLM model. We ran them using the GPT-4o API because it has the best compatibility with langGraph.
21-
</Tip>
19+
> [!WARNING]
20+
> The examples in this section require access to a powerful LLM/VLM model. We ran them using the GPT-4o API because it has the best compatibility with langGraph.
2221
2322
By the end of this unit, you'll be equipped to build robust, organized and production ready applications !
2423

units/en/unit2/llama-index/agents.mdx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ LlamaIndex supports **three main types of reasoning agents:**
1616
2. `ReAct Agents` - These can work with any AI that does chat or text endpoint and deal with complex reasoning tasks.
1717
3. `Advanced Custom Agents` - These use more complex methods to deal with more complex tasks and workflows.
1818

19-
<Tip>Find more information on advanced agents on <a href="https://github.com/run-llama/llama_index/blob/main/llama-index-core/llama_index/core/agent/workflow/base_agent.py">BaseWorkflowAgent</a></Tip>
19+
> [!TIP]
20+
> Find more information on advanced agents on <a href="https://github.com/run-llama/llama_index/blob/main/llama-index-core/llama_index/core/agent/workflow/base_agent.py">BaseWorkflowAgent</a>
2021
2122
## Initialising Agents
2223

23-
<Tip>
24-
You can follow the code in <a href="https://huggingface.co/agents-course/notebooks/blob/main/unit2/llama-index/agents.ipynb" target="_blank">this notebook</a> that you can run using Google Colab.
25-
</Tip>
24+
> [!TIP]
25+
> You can follow the code in <a href="https://huggingface.co/agents-course/notebooks/blob/main/unit2/llama-index/agents.ipynb" target="_blank">this notebook</a> that you can run using Google Colab.
2626
2727
To create an agent, we start by providing it with a **set of functions/tools that define its capabilities**.
2828
Let's look at how to create an agent with some basic tools. As of this writing, the agent will automatically use the function calling API (if available), or a standard ReAct agent loop.
@@ -155,6 +155,7 @@ agent = AgentWorkflow(
155155
response = await agent.run(user_msg="Can you add 5 and 3?")
156156
```
157157

158-
<Tip>Haven't learned enough yet? There is a lot more to discover about agents and tools in LlamaIndex within the <a href="https://docs.llamaindex.ai/en/stable/examples/agent/agent_workflow_basic/">AgentWorkflow Basic Introduction</a> or the <a href="https://docs.llamaindex.ai/en/stable/understanding/agent/">Agent Learning Guide</a>, where you can read more about streaming, context serialization, and human-in-the-loop!</Tip>
158+
> [!TIP]
159+
> Haven't learned enough yet? There is a lot more to discover about agents and tools in LlamaIndex within the <a href="https://docs.llamaindex.ai/en/stable/examples/agent/agent_workflow_basic/">AgentWorkflow Basic Introduction</a> or the <a href="https://docs.llamaindex.ai/en/stable/understanding/agent/">Agent Learning Guide</a>, where you can read more about streaming, context serialization, and human-in-the-loop!
159160
160161
Now that we understand the basics of agents and tools in LlamaIndex, let's see how we can use LlamaIndex to **create configurable and manageable workflows!**

units/en/unit2/llama-index/components.mdx

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,8 @@ Now, let's dive a bit deeper into the components and see how you can **combine c
2727

2828
## Creating a RAG pipeline using components
2929

30-
<Tip>
31-
You can follow the code in <a href="https://huggingface.co/agents-course/notebooks/blob/main/unit2/llama-index/components.ipynb" target="_blank">this notebook</a> that you can run using Google Colab.
32-
</Tip>
30+
> [!TIP]
31+
> You can follow the code in <a href="https://huggingface.co/agents-course/notebooks/blob/main/unit2/llama-index/components.ipynb" target="_blank">this notebook</a> that you can run using Google Colab.
3332
3433
There are five key stages within RAG, which in turn will be a part of most larger applications you build. These are:
3534

@@ -50,7 +49,8 @@ There are three main ways to load data into LlamaIndex:
5049
2. `LlamaParse`: LlamaParse, LlamaIndex's official tool for PDF parsing, available as a managed API.
5150
3. `LlamaHub`: A registry of hundreds of data-loading libraries to ingest data from any source.
5251

53-
<Tip>Get familiar with <a href="https://docs.llamaindex.ai/en/stable/module_guides/loading/connector/">LlamaHub</a> loaders and <a href="https://github.com/run-llama/llama_cloud_services/blob/main/parse.md">LlamaParse</a> parser for more complex data sources.</Tip>
52+
> [!TIP]
53+
> Get familiar with <a href="https://docs.llamaindex.ai/en/stable/module_guides/loading/connector/">LlamaHub</a> loaders and <a href="https://github.com/run-llama/llama_cloud_services/blob/main/parse.md">LlamaParse</a> parser for more complex data sources.
5454
5555
**The simplest way to load data is with `SimpleDirectoryReader`.**
5656
This versatile component can load various file types from a folder and convert them into `Document` objects that LlamaIndex can work with.
@@ -124,7 +124,8 @@ pipeline = IngestionPipeline(
124124
)
125125
```
126126

127-
<Tip>An overview of the different vector stores can be found in the <a href="https://docs.llamaindex.ai/en/stable/module_guides/storing/vector_stores/">LlamaIndex documentation</a>.</Tip>
127+
> [!TIP]
128+
> An overview of the different vector stores can be found in the <a href="https://docs.llamaindex.ai/en/stable/module_guides/storing/vector_stores/">LlamaIndex documentation</a>.
128129
129130

130131
This is where vector embeddings come in - by embedding both the query and nodes in the same vector space, we can find relevant matches.
@@ -176,7 +177,8 @@ Once again, this is fully customisable but there are three main strategies that
176177
- `compact` (default): similar to refining but concatenating the chunks beforehand, resulting in fewer LLM calls.
177178
- `tree_summarize`: create a detailed answer by going through each retrieved text chunk and creating a tree structure of the answer.
178179

179-
<Tip>Take fine-grained control of your query workflows with the <a href="https://docs.llamaindex.ai/en/stable/module_guides/deploying/query_engine/usage_pattern/#low-level-composition-api">low-level composition API</a>. This API lets you customize and fine-tune every step of the query process to match your exact needs, which also pairs great with <a href="https://docs.llamaindex.ai/en/stable/module_guides/workflow/">Workflows</a> </Tip>
180+
> [!TIP]
181+
> Take fine-grained control of your query workflows with the <a href="https://docs.llamaindex.ai/en/stable/module_guides/deploying/query_engine/usage_pattern/#low-level-composition-api">low-level composition API</a>. This API lets you customize and fine-tune every step of the query process to match your exact needs, which also pairs great with <a href="https://docs.llamaindex.ai/en/stable/module_guides/workflow/">Workflows</a>
180182
181183
The language model won't always perform in predictable ways, so we can't be sure that the answer we get is always correct. We can deal with this by **evaluating the quality of the answer**.
182184

@@ -190,7 +192,8 @@ Let's look at the three main evaluators available:
190192
- `AnswerRelevancyEvaluator`: Evaluate the relevance of the answer by checking if the answer is relevant to the question.
191193
- `CorrectnessEvaluator`: Evaluate the correctness of the answer by checking if the answer is correct.
192194

193-
<Tip>Want to learn more about agent observability and evaluation? Continue your journey with the <a href="https://huggingface.co/learn/agents-course/bonus-unit2/introduction">Bonus Unit 2</a>.</Tip>
195+
> [!TIP]
196+
> Want to learn more about agent observability and evaluation? Continue your journey with the <a href="https://huggingface.co/learn/agents-course/bonus-unit2/introduction">Bonus Unit 2</a>.
194197
195198
```python
196199
from llama_index.core.evaluation import FaithfulnessEvaluator
@@ -238,6 +241,7 @@ llama_index.core.set_global_handler(
238241
)
239242
```
240243

241-
<Tip>Want to learn more about components and how to use them? Continue your journey with the <a href="https://docs.llamaindex.ai/en/stable/module_guides/">Components Guides</a> or the <a href="https://docs.llamaindex.ai/en/stable/understanding/rag/">Guide on RAG</a>.</Tip>
244+
> [!TIP]
245+
> Want to learn more about components and how to use them? Continue your journey with the <a href="https://docs.llamaindex.ai/en/stable/module_guides/">Components Guides</a> or the <a href="https://docs.llamaindex.ai/en/stable/understanding/rag/">Guide on RAG</a>.
242246
243247
We have seen how to use components to create a `QueryEngine`. Now, let's see how we can **use the `QueryEngine` as a tool for an agent!**

0 commit comments

Comments
 (0)