Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[UNIT] Use case Agentic RAG with LlamaIndex - release TBD #232

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions units/en/_toctree.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,9 @@
sections:
- local: communication/next-units
title: Next Units
- title: Unit 3.2 Use Cases - Agentic RAG
sections:
- local: unit3/agentic-rag/gala.mdx
title: A Gala to Remember
- local: unit3/agentic-rag/agentic-rag.mdx
title: Agentic Retrieval Augmented Generation (RAG)
34 changes: 34 additions & 0 deletions units/en/unit3/agentic-rag/agentic-rag.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Agentic Retrieval Augmented Generation (RAG)

In this unit, we'll be taking a look at how we can use Agentic RAG to help Alfred, your friendly neighborhood agent, prepare for the amazing gala.

<Tip>We know we've already discussed Retrieval Augmented Generation (RAG) and agentic RAG in the previous unit, so feel free to skip ahead if you're already familiar with the concepts.</Tip>

LLMs are trained on enormous bodies of data to learn general knowledge.
However, the world knowledge model of LLMs may not always be relevant and up-to-date data.
**RAG solves this problem by finding and retrieving relevant information from your data and forward that to the LLM.**

![RAG](https://huggingface.co/datasets/agents-course/course-images/resolve/main/en/unit2/rag.png)

Now, think about how Alfred works:

1. We've ask Alfred to help plan a gala
2. Alfred needs to find the latest news and weather information
3. Alfred needs to strcucture and search the guest information

Just as Alfred needs to search through your household information to be helpful, any agent needs a way to find and understand relevant data.
As we've seen in the previous unit, the `QueryEngine` in LlamaIndex provides exactly this capability.
Even better, it can be converted as an agentic tool that can be used by an agent, opening up the gateway to agentic RAG.

**Agentic RAG is a powerful way to use agents to answer questions about your data.** We can pass various tools to Alfred to help him answer questions.
However, instead of answering the question on top of documents automatically, Alfred can decide to use any other tool or flow to answer the question.

![Agentic RAG](https://huggingface.co/datasets/agents-course/course-images/resolve/main/en/unit2/agentic-rag.png)

Let's start creating the tools for our agentic RAG workflow!






31 changes: 31 additions & 0 deletions units/en/unit3/agentic-rag/gala.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# A Gala to Remember

And then, it was time to get our hands dirty with an actual use case. Let's set the stage!

**You decided to host the most extravagant and opulent party of the century.** This means, lavish feasts, enchanting dancers, renowned DJs, exquisite drinks, a breathtaking fireworks display and much more.

Alfred, your friendly neighborhood agent, is getting ready to watch over your all of the needs for this party and **Alfred is going to manage everything himself**. In order to do so, he needs to have access to all of the information about the party, including the menu, the guests, the schedule, weather forecasts and much more!

Not only that, but he also needs to make sure that the party is going to be a success, so **he needs to be able to answer any questions about the party during the party**, while also being able to handle any unexpected situations that may arise.

He can't do this alone, so we need to make sure that Alfred has access to all of the information and tools he needs.

First, let's give him a list of hard requirements for the gala.

## The gala requirements

A properly educated person in the age of the **renaissance** needs to have three main traits.
He or she needed to profound in the **knowledge of sports, culture, and science**. So, we need to make sure we can impress our guests with our knowledge and provide them with a gala that is truly unforgettable.

According to etiquette, a good host also needs to be aware of all actualities in the news, as well as the information of any guests that might show up at a hosted party, including their allergies, and preferences.
To avoid any confliect, there are some things that are just not acceptable at a gala because we want it to be an inclusive and open party, such as **politics** and **religion**.

Lastly, we need to make sure that we've got some general knowledge about the weather to ensure we can continuously find a real-time update to ensure perfect timing to launch the fireworks and end the gala with a bang! 🎆

As you can see, Alfred needs a lot of information to be able to host the gala.
Luckily, we can help and prepare Alfred by giving him some Retrieval Augmented Generation (RAG) training!





Loading