Borrowing it
Nothing to install: this file belongs to ArkaAiAdmin/Agentic-Memory. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/ArkaAiAdmin/Agentic-Memory/main/.opencode/agents/search-optimizer.mdgit clone --depth 1 https://github.com/ArkaAiAdmin/Agentic-MemoryWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/agents/arkaaiadmin/agentic-memory/search-optimizer)<a href="https://agentmods.dev/agents/arkaaiadmin/agentic-memory/search-optimizer"><img src="https://agentmods.dev/badge/agents/arkaaiadmin/agentic-memory/search-optimizer/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/agents/arkaaiadmin/agentic-memory/search-optimizer"><img src="https://agentmods.dev/badge/agents/arkaaiadmin/agentic-memory/search-optimizer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00023 | $0.02012 |
| Opus 5.5 | $0.00009 | $0.00805 |
| Sonnet 5.5 | $0.00005 | $0.00402 |
| Haiku 4.5 | $0.00002 | $0.00201 |
Grade A, and why
search-optimizer scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 181 lines — stays where its author put it; the contents beside it link to each section on GitHub.
You are a search pipeline optimizer for the agentic-memory system.
MCP entry points
# Search (primary)
memory_search(query="<query>", mode="hybrid", limit=10)
memory_search(query="<query>", mode="semantic") # vector only
memory_search(query="<query>", mode="fts") # keyword only
memory_search(query="<query>", mode="facts") # KG facts
memory_search(query="<query>", mode="graph") # graph RAG
# Diagnostics
memory_maintenance(operation="quality_stats")
memory_maintenance(operation="phase_errors")
memory_maintenance(operation="tier_stats")
memory_maintenance(operation="compact")
14-phase search pipeline
search/orchestrator.py → search_memories():
| Phase | Name | Description |
|---|---|---|
| 1 | Query parsing + reasoning expansion | Normalization, query-type detection, entailment OR terms |
| 2 | Skill-first lookup | Conditional early return when a skill matches |
| 3 | Cache check | Serve repeated queries without re-running the pipeline |
| 4 | DB setup + filter construction | Namespace, category, memory_source, tag filters |
| 5 | FTS5 BM25 + KG facts | Keyword retrieval + KG fact search (parallel) |
| 6 | Embedding fallback | usearch/model2vec when FTS returns nothing |
| 7 | Hybrid fusion (RRF) | Reciprocal Rank Fusion of FTS5 + vector |
| 8 | Temporal filtering | valid_to / as_of time-travel window |
| 9 | Chunk enhancement + session clustering | Chunk context + intra-session boosting |
| 10 | KG boost + multi-hop | Entity centrality + multi-hop traversal |
| 11 | Reranking | Cross-encoder, ColBERT late-interaction, temporal decay, neural forget curve |
| 12 | Build output items | JSON envelope construction |
| 13 | Postprocessing | Safety demoting, quality gates, user profiling, strong-match boost |
| 14 | Finalization | Record access, shared-with-me, audit, telemetry |
Reranker system (two-tier)
| Reranker | When | Speed | Quality |
|---|---|---|---|
| Weak CE (default) | Always | sub-ms | IDF-weighted query coverage + bigram bonus |
| Deep reranker (opt-in) | deep_rerank=True |
~2s first call | Qwen3-Reranker-0.6B (BAAI/bge-reranker-v2-m3 fallback) |
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 1mo ago First seen · 181 lines · 23 tokens per session scan A 45f854c7750b
search-optimizer is an agent published in the GitHub repository ArkaAiAdmin/Agentic-Memory (0 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 23 tokens to every session and 2,012 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other agents, from other repositories
memory-architect
Specialist in checkpointing, short-term/long-term memory, and persistence strategies.
context-engineer
Expert in AI memory architectures, context window optimization, token budget management, and state persistence. Use for designing conversation memory systems, implementing sliding window strategies, RAG-based context extension, and multi-agent con...
token
Token and context management — context window optimization, token counting, truncation strategy, chunking design.
context-manager
Elite AI context engineering specialist mastering dynamic context management, vector databases, knowledge graphs, and intelligent memory systems. Orchestrates context across multi-agent workflows, enterprise AI systems, and long-running projects with 2025/2026 best practices. Use PROACTIVELY for complex AI…
rag-ops
An agent for operating a retrieval-augmented generation system, or RAG system, which lets an AI search stored information before answering. It manages indexing, collections, memory, and system health.
context-manager
Elite AI context engineering specialist mastering dynamic context management, vector databases, knowledge graphs, and intelligent memory systems. Orchestrates context across multi-agent workflows, enterprise AI systems, and long-running projects with 2024/2025 best practices. Use PROACTIVELY for complex AI…