search_ghost_memory
Search accumulated agent rules and feedback across projects. Rank results by activation, relevance, and recency. Empty query lists top-ranked memories.
Instructions
Search cross-project agent ghost memories (= this agent's rule/feedback accumulation).
Empty query → list top-ranked memories (= "what's in my ghost vault" overview). Non-empty query → hybrid FTS + vector semantic ranking via agent.search_ghost_ranked (SECURITY DEFINER, migration 020).
⚠️ current_project is caller-attested, NOT server-verified. shared-restricted requires current_project in per-memory allowlist (= pentest/commercial boundary).
Ranking: rank_score = base_score * recency_factor + semantic_sim * 0.5 base_score = 0.2activation + 0.5incident_prevention + 0.3endorsement - 0.4correction - 0.2pred_error + 0.1scope_bonus recency_factor = exp(-days_since_last_activated / 30) semantic_sim = 1 - cosine_distance(query_vec, memory.dense) (0 if empty query)
Each returned row triggers agent.bump_activation, so memories that surface in search naturally rise in rank over time (= self-tuning loop).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | No | ||
| current_project | No | ||
| n_results | No | ||
| include_restricted | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |