# Knowledge Search

> 基于 RAG 的知识库检索技能。从本地文档中检索相关信息，支持语义搜索和精确匹配。适用于问答、信息查询、文档理解等场景。

- **Type:** Skill
- **Install:** `agentstack add skill-shihan-1147-skillmcp-agent-knowledge`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [shihan-1147](https://agentstack.voostack.com/s/shihan-1147)
- **Installs:** 0
- **Category:** [AI & ML](https://agentstack.voostack.com/c/ai-and-ml)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [shihan-1147](https://github.com/shihan-1147)
- **Source:** https://github.com/shihan-1147/SkillMCP-Agent/tree/main/src/skills/knowledge

## Install

```sh
agentstack add skill-shihan-1147-skillmcp-agent-knowledge
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# 知识检索技能

此技能使用 RAG（Retrieval-Augmented Generation）技术从本地知识库中检索相关信息。

## 能力范围

- **语义检索**: 基于向量相似度的语义搜索
- **关键词匹配**: 精确关键词检索
- **多文档整合**: 从多个文档中提取相关片段
- **上下文增强**: 将检索结果注入 Prompt 增强回答

## 使用场景

当用户提出以下类型的问题时，应激活此技能：
- "根据文档，XXX 是什么意思？"
- "在知识库中查找关于 XXX 的信息"
- "帮我找找有关 XXX 的资料"
- 任何需要基于文档回答的问题

## 依赖工具

| 工具名称 | 用途 | 必需 |
|---------|------|-----|
| `rag_retriever` | 向量检索 | ✅ |
| `rag_indexer` | 文档索引 | ❌ |

## 输入参数

| 参数 | 类型 | 必填 | 说明 |
|-----|------|-----|------|
| query | string | ✅ | 检索查询 |
| top_k | int | ❌ | 返回结果数量，默认 3 |
| filter | object | ❌ | 过滤条件（文档类型、日期等） |
| threshold | float | ❌ | 相似度阈值，默认 0.7 |

## 输出格式

```json
{
  "success": true,
  "data": {
    "query": "什么是机器学习",
    "results": [
      {
        "content": "机器学习是人工智能的一个分支...",
        "source": "ai_basics.md",
        "score": 0.92,
        "metadata": {
          "page": 1,
          "chunk_id": "chunk_001"
        }
      }
    ],
    "total": 3,
    "context_for_llm": "相关上下文拼接文本..."
  }
}
```

## 处理流程

1. 接收用户查询
2. 将查询文本向量化
3. 在 FAISS 索引中执行相似度搜索
4. 获取 Top-K 相关文档片段
5. 整合为可用于 LLM 的上下文

## 检索策略

- **混合检索**: 结合向量检索和关键词匹配
- **重排序**: 对检索结果进行二次排序
- **去重**: 移除重复或高度相似的片段
- **截断**: 控制上下文长度不超过 LLM 限制

## 注意事项

- 需要先完成文档索引
- 检索结果质量依赖 Embedding 模型
- 建议定期更新索引

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [shihan-1147](https://github.com/shihan-1147)
- **Source:** [shihan-1147/SkillMCP-Agent](https://github.com/shihan-1147/SkillMCP-Agent)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-shihan-1147-skillmcp-agent-knowledge
- Seller: https://agentstack.voostack.com/s/shihan-1147
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
