Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

AgenticRAG — Agentic RAG with Semantic Kernel + Azure AI Search

Overview

AgenticRAG demonstrates an agentic Retrieval-Augmented Generation (RAG) pattern using Microsoft Semantic Kernel and Azure AI Search. The service exposes simple HTTP endpoints that accept a user prompt and return answers produced either by a "traditional" RAG prompt or by an agent-driven RAG flow.

Key Components

Features

  • Traditional RAG: fetches top context from Azure AI Search and prompts the model.
  • Agentic RAG: uses Semantic Kernel agents for multi-step reasoning and tool invocation.
  • CORS and static file hosting for quick front-end experiments.

Environment variables

Set these environment variables before running the app (names come from AgenticRAG/AgenticRAG/Constants/EnvVariables.cs):

  • AZURE_OPENAI_URL — Azure OpenAI endpoint URL
  • AZURE_OPENAI_KEY — Azure OpenAI key
  • AZURE_AI_SEARCH_URL — Azure Cognitive Search endpoint
  • AZURE_AI_SEARCH_KEY — Azure Cognitive Search key
  • EMBEDDING_DEPLOYMENT_NAME — embedding deployment name
  • INDEX_NAME — search index name
  • GPT_DEPLOYMENT_NAME — chat / completion deployment name

Quickstart (local)

  1. Open a terminal and set the environment variables (PowerShell example):
$env:AZURE_OPENAI_URL="https://your-openai-endpoint"
$env:AZURE_OPENAI_KEY="your-openai-key"
$env:AZURE_AI_SEARCH_URL="https://your-search-endpoint"
$env:AZURE_AI_SEARCH_KEY="your-search-key"
$env:EMBEDDING_DEPLOYMENT_NAME="your-embedding-deployment"
$env:INDEX_NAME="your-index-name"
$env:GPT_DEPLOYMENT_NAME="your-gpt-deployment"
  1. Restore and run the API from the solution folder:
cd AgenticRAG
dotnet restore
dotnet run --project AgenticRAG/AgenticRAG.csproj

The API runs on the configured Kestrel port (HTTPS). In development the Swagger UI is enabled.

API Endpoints

  • POST /traditionalRag — body: { "prompt": "..." } — returns a JSON Response with Content containing the answer.
  • POST /agenticRag — body: { "prompt": "..." } — runs the agentic RAG flow and returns Content.

Example curl (replace host and port):

curl -X POST https://localhost:5001/traditionalRag \
	-H "Content-Type: application/json" \
	-d '{"prompt":"Plan a 3-day trip to Paris focused on museums"}'

Where to look in the code

Notes and next steps

  • Replace the WeatherPlugin stub with real tool integrations as needed.
  • Add index population scripts for Azure Cognitive Search if you want reproducible demos.

About

AgenticRAG: ASP.NET demo combining Microsoft Semantic Kernel agents with Azure Cognitive Search for agentic Retrieval‑Augmented Generation (RAG). It retrieves context via vector search and uses agents for stepwise reasoning to produce concise, context‑aware responses.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages