Skills Plugins MCP Prompt Model 博客 我的中心
生活与工具 #data #database #ai

rag-implementation

Build Retrieval-Augmented Generation (RAG) systems for LLM applications with vector databases and semantic search. Use when implementing knowledge-grounded AI, building document Q&A systems, or integrating LLMs with external knowledge bases.

DeepseekModel 官方收录技能 质量 优秀 · 90 v1.0.0

获取

https://deepseekmodel.com/api/download.php?id=wshobson-agents-plugins-llm-application-dev-skills-rag-implementation-skill-md&format=skill
下载 .skill 标准格式,含 system_prompt 与 model_config,导入任意 Agent 框架即可使用
.skill 文件中 system_prompt 字段的实际内容。
name rag-implementation description Build Retrieval-Augmented Generation (RAG) systems for LLM applications with vector databases and semantic search. Use when implementing knowledge-grounded AI, building document Q&A systems, or integrating LLMs with external knowledge bases. RAG Implementation Master Retrieval-Augmented Generation (RAG) to build LLM applications that provide accurate, grounded responses using external knowledge sources. When to Use This Skill Building Q&A systems over proprietary documents Creating chatbots with current, factual information Implementing semantic search with natural language queries Reducing hallucinations with grounded responses Enabling LLMs to access domain-specific knowledge Building documentation assistants Creating research tools with source citation Core Components 1. Vector Databases Purpose : Store and retrieve document embeddings efficiently Options: Pinecone : Managed, scalable, serverless Weaviate : Open-source, hybrid search, GraphQL Milvus : High performance, on-premise Chroma : Lightweight, easy to use, local development Qdrant : Fast, filtered search, Rust-based pgvector : PostgreSQL extension, SQL integration 2. Embeddings Purpose : Convert text to numerical vectors for similarity search Models (2026): Model Dimensions Best For voyage-3-large 1024 Claude apps (Anthropic recommended) voyage-code-3 1024 Code search text-embedding-3-large 3072 OpenAI apps, high accuracy text-embedding-3-small 1536 OpenAI apps, cost-effective bge-large-en-v1.5 1024 Open source, local deployment multilingual-e5-large 1024 Multi-language support 3. Retrieval Strategies Approaches: Dense Retrieval : Semantic similarity via embeddings Sparse Retrieval : Keyword matching (BM25, TF-IDF) Hybrid Search : Combine dense + sparse with weighted fusion Multi-Query : Generate multiple query variations HyDE : Generate hypothetical documents for better retrieval 4. Reranking Purpose : Improve retrieval quality by reordering results Methods: Cross-Encoders : BERT-based reranking (ms-marco-MiniLM) Cohere Rerank : API-based reranking Maximal Marginal Relevance (MMR) : Diversity + relevance LLM-based : Use LLM to score relevance Quick Start with LangGraph from langgraph.graph import StateGraph, START, END from langchain_anthropic import ChatAnthropic from langchain_voyageai import VoyageAIEmbeddings from langchain_pinecone import PineconeVectorStore from langchain_core.documents import Document from langchain_core.prompts import ChatPromptTemplate from langchain_text_splitters import RecursiveCharacterTextSplitter from typing import TypedDict, Annotated class RAGState ( TypedDict ): question: str context: list [Document] answer: str # Initialize components llm = ChatAnthropic(model= "claude-sonnet-5" ) embeddings = VoyageAIEmbeddings(model= "voyage-3-large" ) vectorstore = PineconeVectorStore(index_name= "docs" , embedding=embeddings) retriever = vectorstore.as_retriever(search_kwargs={ "k" : 4 }) # RAG prompt rag_prompt = ChatPromptTemplate.from_template( """Answer based on the context below. If you cannot answer, say so. Context: {context} Question: {question} Answer:""" ) async def retrieve ( state: RAGState ) -> RAGState: """Retrieve relevant documents.""" docs = await retriever.ainvoke(state[ "question" ]) return { "context" : docs} async def generate ( state: RAGState ) -> RAGState: """Generate answer from context.""" context_text = "\n\n" .join(doc.page_content for doc in state[ "context" ]) messages = rag_prompt.format_messages( context=context_text, question=state[ "question" ] ) response = await llm.ainvoke(messages) return { "answer" : response.content} # Build RAG graph builder = StateGraph(RAGState) builder.add_node( "retrieve" , retrieve) builder.add_node( "generate" , generate) builder.add_edge(START, "retrieve" ) builder.add_edge( "retrieve" , "generate" ) builder.add_edge( "generate" , END) rag_chain = builder. compile () # Use result = await rag_chain.ainvoke({ "question" : "What are the main features?" }) print (result[ "answer" ]) Detailed patterns and worked examples Detailed pattern documentation lives in references/details.md . Read that file when the navigation tier above is insufficient.
Agent 识别该技能的关键词,点击任意一个即可复制。

该技能未提供触发词。

下载的 .skill 包内含以下字段。
字段 说明
format格式标识(skill/v1)
skill_id技能唯一 ID
name技能名称
version版本号
description技能描述
category所属分类(数组)
trigger_words触发词列表
tags标签列表
source来源标识
source_url来源链接(本页地址)
exported_at导出时间(每次下载生成)
system_prompt系统提示词正文
model_config模型参数:provider / model / temperature / max_tokens / top_p
examples示例
install_guide各平台导入说明(Coze / Dify / Claude / 自定义框架)
同一份技能可按不同平台格式导出。
.skill 标准格式,含 system_prompt 与 model_config,导入任意 Agent 框架即可使用 下载
.skillpro 增强格式,额外含脚本 / 工具 / 依赖 / 钩子占位 下载
.json 纯 JSON 导出,只含 system_prompt 与模型参数 下载
Coze 带 frontmatter 的 Markdown,Coze 平台导入用 下载
Dify Dify DSL,创建应用后直接导入 下载

每日精选 Skill 推荐,免费送到你邮箱

输入邮箱,每天接收一个精选 AI Agent 技能推荐。完全免费,持续更新。

提交后我们会发送一封确认邮件,点击邮件里的链接才会开始收信。

完全免费,取消任意时间。我们不会发送垃圾邮件。