MCP HubMCP Hub
スキル一覧に戻る

context-retrieval

majiayu000
更新日 Today
20 閲覧
58
9
58
GitHubで表示
その他general

について

コンテキスト検索スキルは、現在の意思決定に役立てるため、意味的検索またはキーワード検索を用いて記憶から関連する過去のエピソードを取得します。このスキルは、類似タスクにおける過去のパターンや解決策を必要とする開発者向けに設計されており、意図を捉えるには意味的検索が推奨されます。クエリの自動解析、埋め込みデータの有無の確認、関連性に基づく結果のランキングを自動的に行います。

クイックインストール

Claude Code

推奨
プラグインコマンド推奨
/plugin add https://github.com/majiayu000/claude-skill-registry
Git クローン代替
git clone https://github.com/majiayu000/claude-skill-registry.git ~/.claude/skills/context-retrieval

このコマンドをClaude Codeにコピー&ペーストしてスキルをインストールします

ドキュメント

Context Retrieval

Retrieve relevant episodic context from memory for informed decision-making.

Retrieval Methods

Semantic Search (Preferred)

When embeddings available:

let context = memory
    .retrieve_relevant_context(
        "implement async batch updates",
        task_context,
        limit: 5
    )
    .await?;

Advantages: Finds semantically similar tasks, captures intent

Keyword Search (Fallback)

// SQL index-based search
SELECT * FROM episodes
WHERE task_type = ? AND tags LIKE ?
ORDER BY timestamp DESC
LIMIT ?;

Advantages: Fast, no embedding computation, deterministic

Retrieval Strategy

  1. Parse query (key terms, domain, task type)
  2. Check embedding availability
  3. Query cache (redb) first, fall back to Turso
  4. Rank by relevance or recency
  5. Filter and limit results
  6. Format context structure

Context Filtering

// By domain
TaskContext { domain: "storage".to_string(), .. }

// By task type
task_type_filter: Some("implementation")

// By recency (last 30 days)
since: Some(now - Duration::days(30))

// By success only
verdict: Some(Verdict::Success)

Response Format

pub struct RetrievedContext {
    pub episodes: Vec<EpisodeSummary>,
    pub patterns: Vec<Pattern>,
    pub heuristics: Vec<Heuristic>,
    pub relevance_scores: Vec<f32>,
}

pub struct EpisodeSummary {
    pub id: String,
    pub task_description: String,
    pub verdict: Verdict,
    pub key_steps: Vec<String>,
    pub reflection: String,
    pub relevance: f32,
}

Usage Examples

// Find similar implementation tasks
let retrieved = memory
    .retrieve_relevant_context(query, context, 10)
    .await?;

// Find common tool sequences
let patterns = memory
    .get_patterns_by_type("ToolSequence")
    .filter(|p| p.success_rate > 0.8)
    .await?;

// Find error resolutions
let solutions = memory
    .retrieve_error_resolutions("borrow checker error", 5)
    .await?;

Troubleshooting

IssueSolution
Low recallCheck embeddings, expand tags, increase limit
Slow retrievalCheck cache, verify indexes, reduce result set
Poor relevanceUse semantic search, improve query, filter by domain

GitHub リポジトリ

majiayu000/claude-skill-registry
パス: skills/context-retrieval

関連スキル

algorithmic-art

メタ

This Claude Skill creates original algorithmic art using p5.js with seeded randomness and interactive parameters. It generates .md files for algorithmic philosophies, plus .html and .js files for interactive generative art implementations. Use it when developers need to create flow fields, particle systems, or other computational art while avoiding copyright issues.

スキルを見る

subagent-driven-development

開発

This skill executes implementation plans by dispatching a fresh subagent for each independent task, with code review between tasks. It enables fast iteration while maintaining quality gates through this review process. Use it when working on mostly independent tasks within the same session to ensure continuous progress with built-in quality checks.

スキルを見る

executing-plans

デザイン

Use the executing-plans skill when you have a complete implementation plan to execute in controlled batches with review checkpoints. It loads and critically reviews the plan, then executes tasks in small batches (default 3 tasks) while reporting progress between each batch for architect review. This ensures systematic implementation with built-in quality control checkpoints.

スキルを見る

cost-optimization

その他

This Claude Skill helps developers optimize cloud costs through resource rightsizing, tagging strategies, and spending analysis. It provides a framework for reducing cloud expenses and implementing cost governance across AWS, Azure, and GCP. Use it when you need to analyze infrastructure costs, right-size resources, or meet budget constraints.

スキルを見る