The code first creates a sample index, then demonstrates 3 sample Agentic RAG strategies to query it:
- Basic (No Reflection Included)
- Single Step Reflection
- Multi Step Reflection
-
An Azure subscription, with access to Azure OpenAI.
-
Bing Grounding to access public data on the web
-
Azure AI Search, any version, but make sure search service capacity is sufficient for the workload. We recommend Basic or higher for this demo.
-
A deployment of the
text-embedding-3-largeembedding model in your Azure OpenAI service. As a naming convention, we name deployments after the model name: "text-embedding-3-large". -
A deployment of a at least one chat completion model in your Azure OpenAI service. You can try
gpt-4o-minifor answer generation and query rewriting, andgpt-4ofor evaluation and reflection. -
Python (these instructions were tested with version 3.11.x)
We used Visual Studio Code with the Python extension to test this sample.
- Ensure your python environment is setup. You might want to setup a virtual environment
- Install requirements from
requirements.txt:pip install -r requirements.txt - Copy
sample.envto.envand fill out all environment variables. You do not need to provide a Search key if you are using keyless authentication, but you must provide an Azure OpenAI key - Run the ingestion script to setup your sample index:
python ingest.py
- Run the sample app to interact with the sample index:
chainlit run app.py - Navigate to
http://localhost:8000to chat - You can load a sample conversation using the settings button
- You can select which Agentic RAG strategy to use to answer any question
