Skill站外收录 @skilllib/skill-2014279412483567619
ms-agent-framework-rag
构建面向生产环境的检索增强生成系统,支持文档智能解析与向量化索引、语义与关键词混合检索、多角色智能体协同推理及结果溯源验证,适用于知识库问答、技术文档分析等复杂场景。
数据与分析 AI 技能
Skills.MD
# Microsoft Agent Framework - Agentic RAG System
This skill provides scaffolding and guidance for building production-ready Agentic RAG (Retrieval-Augmented Generation) systems using Microsoft Agent Framework with C#.
## Quick Start
Use the scaffolding script to create a new RAG system:
```bash
scripts/create_rag_system.sh <project-name> [--output-dir <path>]
```
Example:
```bash
scripts/create_rag_system.sh MyKnowledgeBase --output-dir ./my-rag-project
```
## Architecture Overview
An Agentic RAG system consists of:
1. **Ingestion Layer**: Document parsing, chunking, and embedding generation
2. **Vector Store**: Semantic search index (Azure AI Search, Qdrant, or Pinecone)
3. **Agent Framework**: Multi-agent orchestration with Microsoft AutoGen
4. **LLM Integration**: Azure OpenAI or OpenAI API for generation
5. **API Layer**: RESTful endpoints for querying
## Core Components
### 1. Semantic Search
- Use Azure AI Search for integrated vector + keyword search
- Store embeddings with metadata (source, timestamp, tags)
- Implement hybrid search (vector + BM25) for best results
See `references/semantic_search.md` for implementation details.
### 2. Multi-Agent System
Build specialized agents:
- **Research Agent**: Finds relevant documents
- **Synthesis Agent**: Combines information from multiple sources
- **Validation Agent**: Checks accuracy and citations
See `references/agent_patterns.md` for agent design patterns.
### 3. Document Processing
- Supported formats: PDF, DOCX, TXT, MD, HTML
- Chunking strategies: semantic, sliding window, hierarchical
- Metadata extraction: title, author, date, tags
See `references/document_processing.md` for chunking strategies.
## Available Scripts
### `create_rag_system.sh`
Scaffolds a complete RAG system with:
- Project structure following best practices
- Configuration files (appsettings.json)
- Docker compose for local development
- Example agents and tools
Usage:
```bash
scripts/create_rag_system.sh <project-name> [--output-dir <path>]
```
### `ingest_documents.sh`
Batch document ingestion:
```bash
scripts/ingest_documents.sh <source-dir> <index-name>
```
### `run_local.sh`
Start the RAG system locally:
```bash
scripts/run_local.sh <project-dir>
```
## Configuration
Required environment variables:
```bash
AZURE_OPENAI_ENDPOINT=<your-endpoint>
AZURE_OPENAI_API_KEY=<your-key>
AZURE_SEARCH_ENDPOINT=<your-search-endpoint>
AZURE_SEARCH_KEY=<your-search-key>
EMBEDDING_MODEL=text-embedding-ada-002
CHAT_MODEL=gpt-4
```
## Reference Documentation
- `references/semantic_search.md` - Vector search implementation
- `references/agent_patterns.md` - Multi-agent design patterns
- `references/document_processing.md` - Chunking and preprocessing
- `references/evaluation.md` - RAG quality metrics
## Best Practices
1. **Start Simple**: Begin with basic RAG, add agents incrementally
2. **Metadata Matters**: Rich metadata improves retrieval accuracy
3. **Hybrid Search**: Combine vector and keyword search
4. **Citation Tracking**: Always include source references
5. **Evaluation**: Use RAGAS framework for quality metrics
## Common Patterns
### Multi-Step Retrieval
For complex queries, use iterative refinement:
1. Initial search with broad query
2. Research agent expands with sub-queries
3. Synthesis agent combines results
4. Validation agent checks citations
### Citation Management
Always track:
- Document ID
- Page number
- Chunk index
- Relevance score
See `references/citations.md` for implementation.
## Troubleshooting
### Poor Retrieval Quality
- Adjust chunk size (try 512-1024 tokens)
- Use hybrid search instead of pure vector
- Add more metadata for filtering
- Consider re-embedding with different model
### Slow Performance
- Enable caching on vector queries
- Use streaming responses
- Implement async document ingestion
- Consider partitioning large indices
### High Costs
- Use smaller models for embeddings
- Cache frequently asked questions
- Implement result pagination
- Use batch processing for ingestion
评论 0
还没有评论,来抢沙发。
相关内容
同类或同场景的收录内容
building-with-kafka-strimzi
在 Kubernetes 上构建基于 Apache Kafka 的事件驱动系统,支持高可靠的消息传递、事务性处理与精确一次语义,结合 Strimzi 运营商实现集群自动化管理,利用 Schema Registry 保障事件模式演进,适用于微服务间解耦通信与实时数据流处理场景。
站外数据与分析
609 0.0
personal-tool-builder
专注于从个人真实痛点出发快速构建实用工具,涵盖命令行程序、本地优先应用和自动化脚本的开发与演进,强调先满足自身需求再逐步扩展,通过持续自用打磨功能,避免过度设计,确保工具简洁有效且长期可维护。
站外商业与营销
196 0.0
threejs-lighting
实现三维场景中的光照与阴影控制,支持多种光源类型及环境光照明,提供从基础布光到高级阴影优化的完整方案,适用于需要真实感渲染或性能平衡的可视化项目。
站外效率工具
442 0.0
aggregation-helper
提供数据聚合场景的自动化辅助能力,涵盖 SQL 查询编写、统计分析建模、可视化方案设计及商业智能配置,支持从需求理解到生产级代码生成的全流程指导。
站外效率工具数据与分析
217 0.0
举报「ms-agent-framework-rag」
举报信息仅审核团队可见,同一资产 24 小时内仅可举报一次