Lab5 RAG

agentslabsarize-tutorialsagent-mastery-courseLLMPython

Arize Agent Mastry Course: RAG & Agentic RAG

In the previous lab, we explored tools in depth and saw how enhancing them can strengthen our agents’ responses. Another powerful way to improve performance is by using Retrieval-Augmented Generation (RAG) to give the agent access to specific data sources. In this lab, the agent will retrieve relevant documents from a vector database and use that information to answer queries. We’ll continue building on the agent we created earlier.

Set Up

[ ]
[ ]
[ ]

Define Tools

The tool implementation for essential_info and budget_basics is unchanged.

[ ]
[ ]
[ ]

Create RAG System for Local Flavor Tool

Now it’s time to make our local_flavor tool even smarter by giving it access to a rich database of travel destination insights. We’ll use ChromaDB as the vector database and a Sentence Transformer model to generate embeddings that allow the tool to find and retrieve the most relevant information.

[ ]

Download and upload local_flavor.json file provided to you here:

[ ]
[ ]
[ ]

Define Agent

[ ]
[ ]

Now, if we inspect the trace, we can see that the local_flavor tool retrieves documents from the vector database. These retrieved documents are then used to generate tailored local recommendations.

RAG