0

Create an Agentic RAG using OpenVINO and LlamaIndex

An agent is an automated reasoning and decision engine. It takes in a user input/query and can make internal decisions for executing that query in order to return the correct result. The key agent components can include, but are not limited to:

Example · مثال

Content

Create an Agentic RAG using OpenVINO and LlamaIndex

An agent is an automated reasoning and decision engine. It takes in a user input/query and can make internal decisions for executing that query in order to return the correct result. The key agent components can include, but are not limited to:

  • Breaking down a complex question into smaller ones
  • Choosing an external Tool to use + coming up with parameters for calling the Tool
  • Planning out a set of tasks
  • Storing previously completed tasks in a memory module

LlamaIndex is a framework for building context-augmented generative AI applications with LLMs.LlamaIndex imposes no restriction on how you use LLMs. You can use LLMs as auto-complete, chatbots, semi-autonomous agents, and more. It just makes using them easier. You can build agents on top of your existing LlamaIndex RAG pipeline to empower it with automated decision capabilities. A lot of modules (routing, query transformations, and more) are already agentic in nature in that they use LLMs for decision making.

!agentic-rag

This example will demonstrate using RAG engines as a tool in an agent with OpenVINO and LlamaIndex.

Notebook Contents

The tutorial consists of the following steps:

  • Prerequisites
  • Create tools
  • Create prompt template
  • Create LLM
  • Download model
  • Select inference device for LLM
  • Create agent
  • Run the agent
  • Interactive Demo
  • Use built-in tool
  • Create customized tools
  • Create AI agent demo with Gradio UI

Installation Instructions

This is a self-contained example that relies solely on its own code.</br> We recommend running the notebook in a virtual environment. You only need a Jupyter server to start. For details, please refer to [Installation Guide](../../README.md).

Source and license

Source
Intel OpenVINO Notebooks
Original
openvinotoolkit/openvino_notebooks/notebooks/llm-agent-rag-llamaindex
License
Apache-2.0