🔍search-strategy
- プラグイン
- Enterprise Search
- ソース
- GitHub で見る ↗
説明
クエリの分解とマルチソース検索のオーケストレーション。 自然言語の質問をソースごとのターゲット検索に分解し、 各ソース固有の構文にクエリを変換、関連度に基づいて結果をランキングし、 曖昧さの解消とフォールバック戦略を処理します。
原文を表示
Query decomposition and multi-source search orchestration. Breaks natural language questions into targeted searches per source, translates queries into source-specific syntax, ranks results by relevance, and handles ambiguity and fallback strategies.
ユースケース
- ✓自然言語の質問を複数ソースで検索したい
- ✓ソース固有の構文にクエリを変換する
- ✓検索結果を関連度でランキングしたい
- ✓曖昧さを解消する必要がある
本文(日本語訳)
検索ストラテジー
見慣れないプレースホルダーが含まれる場合や、接続中のツールを確認したい場合は、CONNECTORS.md を参照してください。
エンタープライズ検索を支えるコア・インテリジェンスです。 単一の自然言語による質問を、ソースごとに並列実行される検索クエリへと変換し、 ランキング済み・重複排除済みの結果を生成します。
目的
以下のような質問を:
"APIマイグレーションのタイムラインについて何を決定しましたか?"
接続されたすべてのソースへの、的を絞った検索へと変換します:
~~chat: "API migration timeline decision"(セマンティック) + "API migration" in:#engineering after:2025-01-01
~~knowledge base: セマンティック検索 "API migration timeline decision"
~~project tracker: 関連ワークスペース内のテキスト検索 "API migration"
その後、得られた結果を統合して一つのまとまった回答を生成します。
クエリの分解
ステップ 1: クエリタイプの特定
ユーザーの質問を分類し、検索ストラテジーを決定します:
| クエリタイプ | 例 | ストラテジー |
|---|---|---|
| Decision(意思決定) | "Xについて何を決定しましたか?" | 会話(~~chat、メール)を優先し、結論を示すシグナルを探す |
| Status(状況確認) | "プロジェクトYの状況は?" | 最新の活動・タスクトラッカー・ステータス更新を優先 |
| Document(文書検索) | "Zの仕様書はどこですか?" | Drive・Wiki・共有ドキュメントを優先 |
| Person(人物検索) | "Xを担当しているのは誰ですか?" | タスクのアサイン・メッセージの送信者・ドキュメントの共同編集者を検索 |
| Factual(事実確認) | "Xに関するポリシーは何ですか?" | Wiki・公式ドキュメントを優先し、次に裏付けとなる会話を確認 |
| Temporal(時系列確認) | "Xはいつ起きましたか?" | 広い日付範囲で検索し、タイムスタンプを探す |
| Exploratory(探索的検索) | "Xについて何が分かっていますか?" | 全ソースを横断して広く検索し、情報を統合する |
ステップ 2: 検索コンポーネントの抽出
クエリから以下を抽出します:
- キーワード: 結果に必ず含まれるべきコア用語
- エンティティ: 人物・プロジェクト・チーム・ツール(利用可能な場合はメモリシステムを活用)
- インテントシグナル: 意思決定を示す語・状況を示す語・時間的なマーカー
- 制約条件: 日付範囲・ソースの指定・作成者フィルター
- 除外条件: 結果から除くべき要素
ステップ 3: ソースごとのサブクエリ生成
利用可能な各ソースに対して、一つ以上の的を絞ったクエリを作成します。
セマンティック検索を優先する場合:
- 概念的な質問("〜についてどう思いますか…")
- 正確なキーワードが不明な場合
- 探索的なクエリ
キーワード検索を優先する場合:
- 既知の用語・プロジェクト名・略語
- ユーザーが引用した完全なフレーズ
- フィルターを多用するクエリ(
from:、in:、after:など)
複数のクエリバリエーションを生成する(トピックが異なる呼称で参照される可能性がある場合):
ユーザー: "Kubernetes setup"
クエリ候補: "Kubernetes", "k8s", "cluster", "container orchestration"
ソース別クエリ変換
~~chat
セマンティック検索(自然言語による質問):
query: "What is the status of project aurora?"
キーワード検索:
query: "project aurora status update"
query: "aurora in:#engineering after:2025-01-15"
query: "from:<@UserID> aurora"
フィルターのマッピング:
| エンタープライズフィルター | ~~chat 構文 |
|---|---|
from:sarah |
from:sarah または from:<@USERID> |
in:engineering |
in:engineering |
after:2025-01-01 |
after:2025-01-01 |
before:2025-02-01 |
before:2025-02-01 |
type:thread |
is:thread |
type:file |
has:file |
~~knowledge base(Wiki)
セマンティック検索 — 概念的なクエリに使用:
descriptive_query: "API migration timeline and decision rationale"
キーワード検索 — 正確な用語に使用:
query: "API migration"
query: "\"API migration timeline\"" (完全一致フレーズ)
~~project tracker
タスク検索:
text: "API migration"
workspace: [workspace_id]
completed: false (状況確認クエリの場合)
assignee_any: "me" ("自分のタスク" クエリの場合)
フィルターのマッピング:
| エンタープライズフィルター | ~~project tracker パラメーター |
|---|---|
from:sarah |
assignee_any または created_by_any |
after:2025-01-01 |
modified_on_after: "2025-01-01" |
type:milestone |
resource_subtype: "milestone" |
結果のランキング
関連性スコアリング
クエリタイプに応じた重み付けで、各結果を以下の要素でスコアリングします:
| 要素 | 重み(Decision) | 重み(Status) | 重み(Document) | 重み(Factual) |
|---|---|---|---|---|
| キーワード一致 | 0.3 | 0.2 | 0.4 | 0.3 |
| 新鮮度 | 0.3 | 0.4 | 0.2 | 0.1 |
| 権威性 | 0.2 | 0.1 | 0.3 | 0.4 |
| 完全性 | 0.2 | 0.3 | 0.1 | 0.2 |
権威性の階層
クエリタイプによって異なります。
事実確認・ポリシーに関する質問の場合:
Wiki・公式ドキュメント > 共有ドキュメント > メールアナウンス > チャットメッセージ
"何が起きたか" ・意思決定に関する質問の場合:
議事録 > スレッドの結論 > メールによる確認 > チャットメッセージ
状況確認に関する質問の場合:
タスクトラッカー > 最新のチャット > ステータスドキュメント > メールの更新
曖昧さへの対処
クエリが曖昧な場合は、推測するよりも、的を絞った確認質問を一つ行うことを優先します:
曖昧なクエリ: "migration を検索して"
→ "いくつかのマイグレーションへの言及が見つかりました。お探しのものはどれですか?
1. データベースマイグレーション(Project Phoenix)
2. クラウドマイグレーション(AWS → GCP)
3. メールマイグレーション(Exchange → O365)"
確認を求めるのは、以下の場合のみにします:
- まったく異なる結果をもたらすような、明確に異なる解釈が複数存在する場合
- 曖昧さによって、検索すべきソースが大きく変わる場合
確認を求めるべきでないケース:
- クエリが有用な結果を生成するのに十分な明確さを持つ場合
- 複数の解釈で結果を返すことで軽微な曖昧さを解消できる場合
フォールバックストラテジー
ソースが利用不可の場合、または結果が返らない場合:
- ソースが利用不可: そのソースをスキップし、残りのソースを検索した上で、欠落を記録する
- ソースから結果なし: クエリ語句を広げる・日付フィルターを除去する・代替キーワードを試す
- すべてのソースから結果なし: クエリの修正方法をユーザーに提案する
- レート制限: 制限を記録し、他のソースから得られた結果を返した上で、後ほど再試行することを提案する
クエリの拡張
初期クエリの結果が少なすぎる場合:
元のクエリ: "PostgreSQL migration Q2 timeline decision"
拡張: "PostgreSQL migration"
さらに拡張: "database migration"
最大拡張: "migration"
制約を除去する順序:
- 日付フィルター(全期間を検索)
- ソース・場所フィルター
- 重要度の低いキーワード
- コアとなるエンティティ・トピック用語のみを残す
並列実行
ソースへの検索は必ず並列で実行し、逐次実行は行いません。 検索の合計時間は、すべてのソースの時間の合計ではなく、 最も遅い単一ソースの時間とほぼ同等になるべきです。
[ユーザーのクエリ]
↓ 分解
[~~chat クエリ] [~~email クエリ] [~~cloud storage クエリ] [Wiki クエリ] [~~project tracker クエリ]
↓ ↓ ↓ ↓ ↓
(並列実行)
↓
[マージ + ランキング + 重複排除]
↓
[統合された回答]
原文(English)を表示
Search Strategy
If you see unfamiliar placeholders or need to check which tools are connected, see CONNECTORS.md.
The core intelligence behind enterprise search. Transforms a single natural language question into parallel, source-specific searches and produces ranked, deduplicated results.
The Goal
Turn this:
"What did we decide about the API migration timeline?"
Into targeted searches across every connected source:
~~chat: "API migration timeline decision" (semantic) + "API migration" in:#engineering after:2025-01-01
~~knowledge base: semantic search "API migration timeline decision"
~~project tracker: text search "API migration" in relevant workspace
Then synthesize the results into a single coherent answer.
Query Decomposition
Step 1: Identify Query Type
Classify the user's question to determine search strategy:
| Query Type | Example | Strategy |
|---|---|---|
| Decision | "What did we decide about X?" | Prioritize conversations (~~chat, email), look for conclusion signals |
| Status | "What's the status of Project Y?" | Prioritize recent activity, task trackers, status updates |
| Document | "Where's the spec for Z?" | Prioritize Drive, wiki, shared docs |
| Person | "Who's working on X?" | Search task assignments, message authors, doc collaborators |
| Factual | "What's our policy on X?" | Prioritize wiki, official docs, then confirmatory conversations |
| Temporal | "When did X happen?" | Search with broad date range, look for timestamps |
| Exploratory | "What do we know about X?" | Broad search across all sources, synthesize |
Step 2: Extract Search Components
From the query, extract:
- Keywords: Core terms that must appear in results
- Entities: People, projects, teams, tools (use memory system if available)
- Intent signals: Decision words, status words, temporal markers
- Constraints: Time ranges, source hints, author filters
- Negations: Things to exclude
Step 3: Generate Sub-Queries Per Source
For each available source, create one or more targeted queries:
Prefer semantic search for:
- Conceptual questions ("What do we think about...")
- Questions where exact keywords are unknown
- Exploratory queries
Prefer keyword search for:
- Known terms, project names, acronyms
- Exact phrases the user quoted
- Filter-heavy queries (from:, in:, after:)
Generate multiple query variants when the topic might be referred to differently:
User: "Kubernetes setup"
Queries: "Kubernetes", "k8s", "cluster", "container orchestration"
Source-Specific Query Translation
~~chat
Semantic search (natural language questions):
query: "What is the status of project aurora?"
Keyword search:
query: "project aurora status update"
query: "aurora in:#engineering after:2025-01-15"
query: "from:<@UserID> aurora"
Filter mapping:
| Enterprise filter | ~~chat syntax |
|---|---|
from:sarah |
from:sarah or from:<@USERID> |
in:engineering |
in:engineering |
after:2025-01-01 |
after:2025-01-01 |
before:2025-02-01 |
before:2025-02-01 |
type:thread |
is:thread |
type:file |
has:file |
~~knowledge base (Wiki)
Semantic search — Use for conceptual queries:
descriptive_query: "API migration timeline and decision rationale"
Keyword search — Use for exact terms:
query: "API migration"
query: "\"API migration timeline\"" (exact phrase)
~~project tracker
Task search:
text: "API migration"
workspace: [workspace_id]
completed: false (for status queries)
assignee_any: "me" (for "my tasks" queries)
Filter mapping:
| Enterprise filter | ~~project tracker parameter |
|---|---|
from:sarah |
assignee_any or created_by_any |
after:2025-01-01 |
modified_on_after: "2025-01-01" |
type:milestone |
resource_subtype: "milestone" |
Result Ranking
Relevance Scoring
Score each result on these factors (weighted by query type):
| Factor | Weight (Decision) | Weight (Status) | Weight (Document) | Weight (Factual) |
|---|---|---|---|---|
| Keyword match | 0.3 | 0.2 | 0.4 | 0.3 |
| Freshness | 0.3 | 0.4 | 0.2 | 0.1 |
| Authority | 0.2 | 0.1 | 0.3 | 0.4 |
| Completeness | 0.2 | 0.3 | 0.1 | 0.2 |
Authority Hierarchy
Depends on query type:
For factual/policy questions:
Wiki/Official docs > Shared documents > Email announcements > Chat messages
For "what happened" / decision questions:
Meeting notes > Thread conclusions > Email confirmations > Chat messages
For status questions:
Task tracker > Recent chat > Status docs > Email updates
Handling Ambiguity
When a query is ambiguous, prefer asking one focused clarifying question over guessing:
Ambiguous: "search for the migration"
→ "I found references to a few migrations. Are you looking for:
1. The database migration (Project Phoenix)
2. The cloud migration (AWS → GCP)
3. The email migration (Exchange → O365)"
Only ask for clarification when:
- There are genuinely distinct interpretations that would produce very different results
- The ambiguity would significantly affect which sources to search
Do NOT ask for clarification when:
- The query is clear enough to produce useful results
- Minor ambiguity can be resolved by returning results from multiple interpretations
Fallback Strategies
When a source is unavailable or returns no results:
- Source unavailable: Skip it, search remaining sources, note the gap
- No results from a source: Try broader query terms, remove date filters, try alternate keywords
- All sources return nothing: Suggest query modifications to the user
- Rate limited: Note the limitation, return results from other sources, suggest retrying later
Query Broadening
If initial queries return too few results:
Original: "PostgreSQL migration Q2 timeline decision"
Broader: "PostgreSQL migration"
Broader: "database migration"
Broadest: "migration"
Remove constraints in this order:
- Date filters (search all time)
- Source/location filters
- Less important keywords
- Keep only core entity/topic terms
Parallel Execution
Always execute searches across sources in parallel, never sequentially. The total search time should be roughly equal to the slowest single source, not the sum of all sources.
[User query]
↓ decompose
[~~chat query] [~~email query] [~~cloud storage query] [Wiki query] [~~project tracker query]
↓ ↓ ↓ ↓ ↓
(parallel execution)
↓
[Merge + Rank + Deduplicate]
↓
[Synthesized answer]
原文・著作権は Anthropic および各プラグイン作者に帰属します。日本語訳は Claude API による自動翻訳です。