---
description: Search indexed library sources
argument-hint: "[query] [--stores names] [--limit N] [--mode vector|fts|hybrid] [--detail minimal|contextual|full] [--threshold 0-1] [--min-relevance 0-1]"
allowed-tools: ["mcp__bluera-knowledge__search"]
---

# Search Knowledge Stores

Search indexed library sources for: **$ARGUMENTS**

## Steps

1. Parse the query from $ARGUMENTS:
   - Extract the search query (required)
   - Extract --stores parameter (optional, comma-separated store names)
   - Extract --limit parameter (optional, default 10)
   - Extract --mode parameter (optional: vector, fts, hybrid; default hybrid)
   - Extract --detail parameter (optional: minimal, contextual, full; default minimal)
   - Extract --threshold parameter (optional, 0-1 range for normalized score filtering)
   - Extract --min-relevance parameter (optional, 0-1 range for raw cosine similarity filtering)

2. Call mcp__bluera-knowledge__search with:
   - query: The search query string
   - stores: Array of store names (if --stores specified)
   - limit: Number of results (if --limit specified, default 10)
   - mode: Search mode (if --mode specified, default "hybrid")
   - detail: Detail level (if --detail specified, default "minimal")
   - threshold: Minimum normalized score (if --threshold specified)
   - minRelevance: Minimum raw cosine similarity (if --min-relevance specified)
   - intent: "find-implementation"

3. Format and display results with rich context:

   ```
   ## Search Results: "query" (hybrid search)

   **1. [Score: 0.95] [Vector+FTS]**
   Store: claude-code
   File: 📄 path/to/file.ts
   Purpose: → Purpose description here
   Top Terms: 🔑 (in this chunk): concept1, concept2, concept3
   Imports: 📦 (in this chunk): package1, package2

   **2. [Score: 0.87] [Vector]**
   Store: another-store
   File: 📄 path/to/file.js
   Purpose: → Another purpose here
   Top Terms: 🔑 (in this chunk): other-concept

   ---
   **Found 10 results in 45ms**

   💡 **Next Steps:**
   - Read file: `Read /path/to/file.ts`
   - Get full code: `mcp__bluera-knowledge__get_full_context("result-id")`
   - Refine search: Use keywords above
   ```

   **Formatting rules:**
   - Header: `## Search Results: "query" (mode search)` - Extract mode from response (vector/fts/hybrid)
   - Each result on its own block with blank line between
   - Result header: `**N. [Score: X.XX]**`
   - Store: `Store: storeName`
   - File: `File: 📄 filename` (from summary.location, strip repoRoot prefix)
   - Purpose: `Purpose: → purpose text` (from summary.purpose)
   - Footer: `**Found {{totalResults}} results in {{timeMs}}ms**` with separator line above

4. For the footer next steps, include:
   - First result's ID in the get_full_context example
   - First result's actual file path in the Read example
   - Use the actual keywords from top results

5. If no results:
   ```
   No results found for "query"

   Try:
   - Broadening your search terms
   - Checking indexed stores: /bluera-knowledge:stores
   ```
