Agentic-Memory: Agent for Claude Code

.opencode/agents/search-optimizer.md

search-optimizer is an agent for Claude Code, OpenCode from ArkaAiAdmin/Agentic-Memory. It costs 23 tokens per session (2,012 once invoked), scanned A, original, Apache-2.0.

A coding-agent role for improving a memory search pipeline that combines keyword search, meaning-based search, fact lookup, ranking, and quality checks.

In plain words
What is it for?
It is for running hybrid, semantic, keyword, fact, and graph searches, adjusting retrieval and ranking behavior, and examining search quality, errors, tiers, and compaction.
Why use it?
It helps diagnose poor or incomplete results and tune how stored memories are retrieved and ordered.

Agent for Claude CodeOpenCode

Written for OpenCode and Claude Code: installed under .opencode/, but also a Claude Code subagent (agents/*.md). Also seen: mentions subagents.

This is ArkaAiAdmin/Agentic-Memory's own configuration. It tells Claude Code and OpenCode how to work on Agentic-Memory itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything Agentic-Memory configures →

Reuse

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.

Copy the file
curl -O https://raw.githubusercontent.com/ArkaAiAdmin/Agentic-Memory/main/.opencode/agents/search-optimizer.md
Clone the repo
git clone --depth 1 https://github.com/ArkaAiAdmin/Agentic-Memory

Made for: Claude Code, OpenCode.

Wrote 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.

agentmods badge for search-optimizer

README.md
[![agentmods](https://agentmods.dev/badge/agents/arkaaiadmin/agentic-memory/search-optimizer/github.svg)](https://agentmods.dev/agents/arkaaiadmin/agentic-memory/search-optimizer)
Your own site
<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.

agentmods 80×15 button for search-optimizer

Your own site · 80×15
<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>
Per session 23 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,012 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce 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

Measured 1mo ago against content hash 45f854c7750b, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

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.

.opencode/agents/search-optimizer.md · 181 lines

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)

Read the full file on GitHub · 181 lines

Changes

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.

  1. 1mo ago First seen · 181 lines · 23 tokens per session scan A 45f854c7750b

Subscribe to this mod's changes

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.

Related

Other agents, from other repositories

memory-architect

Specialist in checkpointing, short-term/long-term memory, and persistence strategies.

TheLobbi/claude · 20 tokens

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...

SteveGJones/ai-first-sdlc-practices · 45 tokens

token

Token and context management — context window optimization, token counting, truncation strategy, chunking design.

tonone-ai/tonone · 21 tokens

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…

HermeticOrmus/LibreUIUX-Claude-Code · 62 tokens

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.

getreka/reka · 42 tokens

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…

aRustyDev/dotfiles · 62 tokens