RAG Example using LlamaIndex
This repository showcases three ways to build a voice assistant with Retrieval-Augmented Generation (RAG) using LlamaIndex:
-
chat_engine.py: Utilizes LlamaIndex'sas_chat_enginefor a straightforward, integrated solution. Trade-off: Lacks function calling support, limiting advanced interactions. -
query_engine.py: Uses an LLM that supports function calling (e.g., OpenAI's models) to define custom functions likequery_infofor retrieval. Trade-off: Requires additional setup but offers greater flexibility. -
retrieval.py: Manually injects retrieved context into the system prompt using LlamaIndex's retriever. Trade-off: Provides fine-grained control but involves complex prompt engineering.
Current recommended way: Use query_engine.py for its balance of flexibility and control, enabling function calling and custom behaviors without excessive complexity.