Introducing Agentic RAG Python Sample – IT Support Ticket Search
A Python sample demonstrating how to build an agentic, multi-agent RAG system using Microsoft’s Agent Framework
I finally finished up the code for the Agentic RAG sample that has been a long time in the making … it will answer all the question types I’ve been after for awhile now:
These were inspired by the https://github.com/amazon-science/mintaka project that I discovered a long time ago.
The final project is a real-world, practical example of an Agentic Retrieval-Augmented Generation (RAG) application built in Python using Microsoft’s Agent Framework.
If you’ve been curious about what agentic RAG actually looks like in code — not just diagrams and theory — this repo is meant to be a hands-on starting point.
GitHub repo
https://github.com/JasonHaley/agent-framework-agentic-rag-python
What It Is
At its core, this sample application demonstrates how to combine:
- Agentic RAG patterns – AI agents that reason about a user’s query and decide how retrieval should happen
- Microsoft Agent Framework (Python) – for orchestrating multiple collaborating agents
- Azure AI Search – hybrid keyword + vector search
- Azure OpenAI – for embeddings, classification, and response generation
The sample uses a Kaggle dataset from Tobias Bueck. (2025). Customer IT Support - Ticket Dataset. I have filtered out the non-english tickets and added a random create date in order to perform additional search types.
The demo allows users to ask questions such as:
- “What problems are there with Surface devices?” (Simple question)
- “Are there any issues for Dell XPS laptops?” (Yes/No)
- “How many tickets were logged and Incidents for Human Resources and low priority?” (Count)
- “Do we have more issues with MacBook Air computers or Dell XPS laptops?” (Comparative)
- “Which Dell XPS issue does not mention Windows?” (Difference)
- “What issues are for Dell XPS laptops and the user tried Win + Ctrl + Shift + B?” (Intersection)
- “What department had consultants with Login Issues?” (Multi-hop)
- “What is the last issue for the HR department?” (Ordinal)
- “Which department has the most high priority incidents?” (Superlative)
Rather than using a single “one-shot” RAG flow, the system classifies the question and routes it to specialized agents that know how to answer that type of query.
Why “Agentic” RAG?
Traditional RAG pipelines usually look like this:
User Query → Retrieve Documents → Generate Answer
That works well — until queries get more complex.
Agentic RAG adds a decision-making layer:
- An agent reasons about what kind of question the user is asking
- It selects the right retrieval strategy
- It may delegate work to other agents
- The final answer is synthesized from the agent’s results
This enables:
- Better handling of counting, filtering, and comparison questions
- Cleaner separation of concerns
- More extensible architectures as applications grow
Architecture Overview
At a high level, the flow looks like this:
Each agent has a focused responsibility:
- Classifying intent
- Executing targeted search queries
- Aggregating or counting results
- Returning structured outputs for response generation
What’s In the Repository
The repo includes:
- Agent implementations for classification and query execution
- Search utilities for working with Azure AI Search
- A runnable Python app that supports demo and interactive modes
- Infrastructure files to provision Azure resources using
azd - Clear examples you can adapt for your own datasets
It’s designed to be explored, modified, and extended — not just read.
NOTE: I am also planning to extend it in the near future to do more
Running the Sample
The application supports two main modes:
Demo Mode
Runs a predefined set of example queries so you can quickly see how the agents behave.
Interactive Mode
Ask your own questions and watch how they’re classified and routed in real time.
Requirements
- Python 3.11–3.14
- An Azure subscription
- Azure OpenAI
- Azure AI Search
The README walks through setup, provisioning, and execution step-by-step.
Who This Is For
This project is a good fit if you’re:
- Exploring agentic RAG beyond basic demos
- Building RAG systems that need query routing and specialized agents
- Evaluating Microsoft’s Agent Framework for real applications
- Looking for a Python-first, Azure-native reference implementation
Go Take a Look
If this sounds useful:
- ⭐ Star the repo
- 🔀 Fork it and experiment
- 🧠 Adapt the patterns to your own domain
👉 https://github.com/JasonHaley/agent-framework-agentic-rag-python
More agentic RAG content and deeper dives are coming — this repo is just the starting point.
BTW: a .NET version is coming soon
If you have a comment, please message me @haleyjason on twitter/X.