一键导入
rag-qa-engine
Interactive conversational RAG query engine for Q&A over documents
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Interactive conversational RAG query engine for Q&A over documents
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | rag-qa-engine |
| description | Interactive conversational RAG query engine for Q&A over documents |
| applyTo | **/*.agent.md |
RAG Reference: Retrieval-augmented Generation (RAG) in Azure AI Search - Microsoft Learn
Status: Production Version: 1.0 Last Updated: May 13, 2026
Provides an interactive conversational interface for querying documents via RAG. Users ask questions in natural language and receive answers from their indexed knowledge base with source attribution.
This skill:
from pathlib import Path
import sys
sys.path.insert(0, str(Path(__file__).parent / ".github" / "skills" / "rag-qa-engine"))
from chat_engine import RAGChatEngine
engine = RAGChatEngine(
azure_openai_endpoint="https://myapp-openai.openai.azure.com/",
azure_search_endpoint="https://myapp-search.search.windows.net/"
)
engine.connect()
response = engine.query("What is the procedure for X?")
print(response["answer"])
print(response["sources"])
exit_code = engine.run_interactive()
python .github/skills/rag-qa-engine/chat_engine.py
python run-rag.py --agent chat
| Parámetro | Tipo | Descripción | Ejemplo |
|---|---|---|---|
azure_openai_endpoint | str | Endpoint del servicio OpenAI | https://app-openai.openai.azure.com/ |
azure_search_endpoint | str | Endpoint de AI Search | https://app-search.search.windows.net/ |
| Parámetro | Tipo | Descripción |
|---|---|---|
question | str | Pregunta en lenguaje natural |
{
"answer": "str - Respuesta generada por RAG",
"sources": [
{
"title": "str - Nombre del documento",
"confidence": "float - 0.0-1.0"
}
],
"tokens_used": "int - Tokens OpenAI consumidos"
}
Loop de Q&A en tiempo real con:
You: [pregunta]quit, exit, salirInput del Usuario
↓
[Análisis de Pregunta]
↓
[Búsqueda Semántica] → Encontrar docs relevantes en Azure Search
↓
[Preparación de Contexto] → Formatear top-K docs como contexto
↓
[Llamada gpt-4o] → Generar respuesta con contexto
↓
[Atribución de Fuentes] → Devolver fuentes + confianza
↓
Mostrar al Usuario
Azure OpenAI Service
.envAzure AI Search
AZURE_OPENAI_ENDPOINT=https://[resource]-openai.openai.azure.com/
AZURE_OPENAI_API_KEY=<key>
AZURE_OPENAI_DEPLOYMENT_NAME=gpt-4o
AZURE_SEARCH_ENDPOINT=https://[resource]-search.search.windows.net/
AZURE_SEARCH_API_KEY=<key>
| Comando | Efecto |
|---|---|
quit | Finalizar sesión |
exit | Finalizar sesión |
salir | Finalizar sesión |
Ctrl+C | Interrumpir |
| línea vacía | Saltar, continuar prompt |
You: What are the procedures for X?
RAG: Based on your documentation, the procedures for X include...
Sources:
• procedures.docx (confidence: 0.95)
• manual_chapter_3.pdf (confidence: 0.87)
Tokens used: 342
You: [pregunta]
Error: Failed to connect to Azure Search
[Continúa solicitando]
Registrado en:
outputs/rag-chat.log (si logging de archivo habilitado)Reemplazar el mock engine con llamadas reales a Azure OpenAI y Azure Search usando las credenciales del .env.
Scale up or scale down Azure RAG configurations (Search, Log Analytics, Insights) and manage budgets/alerts automatically. Reversible changes with cost calculation before applying.
PowerShell helper for obtaining Azure Blob Storage credentials via Azure CLI. Provides connection strings used by RAG indexers and document upload pipelines to access Blob Storage.
Design document ingestion and indexing workflows for Azure AI Search, including chunking, metadata strategy, and incremental reindexing guidance.
Exposes RAG functionality as a REST API for external applications. Provides HTTP endpoints for document search and query with JSON request/response, async processing, CORS support, and observability metrics.
Monitors, diagnoses and troubleshoots RAG system health. Verifies Azure AI Search connectivity, index status, configuration, and provides real-time monitoring with actionable error reports.
Professional executive report generation using Claude Opus 4.7. Generates high-quality DOCX reports with professional formatting, compelling narratives, and quantified impact metrics. Perfect for client presentations and stakeholder communication.