rag-context
Dynamically fetch and inject relevant context from files, codebases, docs, or external sources.
来源信息
- 仓库
- glayph/Agent
- 最近来源活动
- 2026年9月19日 22:39
- 检测到的 SKILL.md 语言
- 英语
- 星标
- 0
- 分支
- 0
安装方式
默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。
检查来源文件
决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。
正在显示 SKILL.md
SKILL.md
来源说明 · 只读预览- name
- rag-context
- description
- Dynamically fetch and inject relevant context from files, codebases, docs, or external sources.
- version
- 1.0.0
- author
- Miki
- license
- MIT
- platforms
- ["linux","macos","windows"]
- metadata
- {"Miki":{"tags":["rag","retrieval","context-injection","knowledge-base"],"related_skills":["semantic-summarization","memory-management"]}}
# Retrieval-Augmented Context (Dynamic RAG)
## Trigger conditions
- User mentions RAG, retrieval, context injection, knowledge base
- Task requires info not in active conversation (code reference, API docs, config)
- User asks "check X" or "look up Y"
## Retrieval strategy (ordered by cost)
### 1. Exact match (fastest)
- Grep/RG for known symbols, filenames, error strings
- Use glob for file patterns
### 2. Semantic (codebase)
- Read file headers, imports, exports, type signatures
- Grep for function/class definitions matching intent
### 3. Structural (docs/config)
- Read README, package.json, tsconfig, config YAML
- Scan directory tree for relevant paths
### 4. External (web)
- Fetch docs URLs, search web for API references
- Fetch GitHub raw content for library source
## Context injection rules
- **Prefer excerpts over whole files** — extract 5-20 relevant lines
- **Tag source origin**: `[src/path.ts:42]` or `[web: docs.url]`
- **Summarize what you found** before quoting
- **If nothing found**: say so immediately — don't fabricate
## Multi-turn RAG
- Track what's already retrieved in-session
- Don't re-fetch same content unless explicitly asked
- On ambiguity: retrieve top 2-3 candidates, present choices
在 GitHub 查看