AgentSkillsCN

jarvis-recall

利用ChromaDB对存储库内容进行语义搜索。当用户说“Jarvis,回忆X”、“/jarvis-recall X”、“我们关于X的决定是什么”、“查找关于X的笔记”或要求以语义方式搜索存储库时使用。

SKILL.md
--- frontmatter
name: jarvis-recall
description: Semantic search over vault content using ChromaDB. Use when user says "Jarvis, recall X", "/jarvis-recall X", "what did we decide about X", "find notes about X", or asks to search vault semantically.
user_invocable: true

/jarvis-recall - Semantic Vault Search

Search your vault using meaning, not just keywords. Finds related content even when exact words don't match.

Execution Flow

1. Extract query from user input

The user provides a search topic. Examples:

  • /jarvis-recall OAuth decisions
  • Jarvis, what did we discuss about authentication?
  • recall notes about career goals

2. Query vault memory

Call mcp__plugin_jarvis_core__jarvis_retrieve with:

json
{
  "query": "<user's search query>",
  "n_results": 5
}

If the collection is empty, the tool returns a message suggesting the user index their vault (Jarvis can call jarvis_index_vault directly).

3. Present results

Format results clearly, handling both Tier 1 (file-backed) and Tier 2 (ephemeral) results:

code
Found N results for "[query]":

1. **[Title]** (relevance: 0.XX)
   Path: notes/projects/jarvis-plugin.md
   Type: note | Importance: high
   Preview: [150 char preview]

2. **[Title]** (relevance: 0.XX)
   Source: observation (auto-generated)
   Type: observation | Importance: 0.75
   Preview: [150 char preview]

3. **[Title]** (relevance: 0.XX)
   Path: journal/jarvis/2026/01/20260124-entry.md
   Type: journal | Importance: medium
   Preview: [150 char preview]

...

Tier 2 results: When tier == "chromadb", show Source: [type] (auto-generated) instead of Path:. These are ephemeral documents (observations, patterns, summaries).

4. Offer to read or promote

code
Want me to read any of these in full? (reply with the number)

[If any Tier 2 results are shown:]
Want me to save any Tier 2 items permanently? (reply with number to promote)

Filtering (Optional)

If the user specifies a scope, add filter:

  • "recall from journal" → {"directory": "journal"}
  • "recall work notes" → {"directory": "work"}
  • "recall high importance" → {"importance": 0.8}
  • "recall ideas" → {"type": "idea"}

Pass as filter parameter to jarvis_retrieve(query=...).

Cross-Encoder Reranking

When enabled (default), results are reranked using a cross-encoder model after initial vector search. This improves precision for nuanced queries.

  • Response metadata: When reranking is applied, the response includes reranking: {applied: true, alpha: 0.7, candidates: N, top_k: K}
  • Graceful fallback: If the model isn't available or latency exceeds budget, vector scores are used silently
  • First use: The ONNX model (~23MB) is downloaded automatically to ~/.jarvis/models/cross-encoder/
  • Not applied to per-prompt search (semantic_context) — only to explicit /jarvis-recall queries

Configure via memory.reranking in ~/.jarvis/config.json (or /jarvis-settings > Advanced > Memory system).

Graceful Degradation

If jarvis_retrieve is unavailable or returns an error:

  1. Fall back to Grep search across the vault
  2. Note: "Semantic search unavailable. Falling back to keyword search."
  3. Use mcp__plugin_jarvis_core__jarvis_read_vault_file for results

Key Rules

  • Read-only — never modify vault content
  • Respect access control — don't surface documents/ or people/ results unless user explicitly asks
  • Show relevance scores — helps user gauge result quality (higher = more relevant)
  • Keep previews short — 150 chars max, frontmatter already stripped by jarvis_retrieve