From the course: Build with AI: Agentic Applications with LlamaIndex and MCP

Unlock this course with a free trial

Join today to access over 25,200 courses taught by industry experts.

Use Weaviate Query Agent

Use Weaviate Query Agent

Previously, we built a functional shopping assistant that can search for products and answer questions. But to go from a simple prototype to a production-ready application that users can trust, we need more control. So let's upgrade our agent by exploring advanced patterns. We'll give it custom personality, focus its knowledge on the most relevant data, enforce business rules, and make it feel more responsive. As usual, we'll get started by connecting to a Weaviate instance with a Weaviate URL and the API key. And now, let's instantiate our query agent. This time, we're going to do it slightly differently by giving it a personality. By default, its tone is going to be neutral. I want it to sound like a helpful fashion expert who specializes in vintage clothing. We can do exactly this with a custom system prompt that you see right here. In order to use that, we'll just instantiate a query agent up here with the same Weaviate client and a set of collections to use. which is e-commerce…

Contents