search

A command for semantic search across indexed Markdown files. Semantic search finds documents by meaning, so the wording does not have to exactly match the query.

In plain words
What is it for?
It is for searching one or more connected Markdown indexes for topics such as Kubernetes deployments or Go testing patterns, with an optional result limit and server scope.
Why use it?
It helps locate relevant notes or documentation when ordinary keyword searching misses differently worded content.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/bborbe/semantic-search/search
Clone the repo
git clone --depth 1 https://github.com/bborbe/semantic-search
Per session 20 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,092 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
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 $0.00020 $0.01092
Opus 5 $0.00010 $0.00546
Sonnet 5 $0.00004 $0.00218
Haiku 4.5 $0.00002 $0.00109

Measured 2d ago against content hash 9b66548d367f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

search scanned grade A with 1 finding 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 2d 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -fsS --max-time 10 "http://127.0.0.1:<PORT>/search?q=$(printf %s "<query>" | jq -sRr @uri)&top_k=<top_k>"
commands/search.md · 110 lines

How it starts

The opening of the file, as written. The whole thing — 110 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Usage

/semantic-search:search kubernetes deployment
/semantic-search:search "go testing patterns" 10
/semantic-search:search --server=work sentry runbook

Process

1. Parse arguments

  • First non-flag argument (or full string if unquoted) → query
  • Trailing integer → top_k (default 5)
  • --server=<label> (optional) → scope to a single MCP server (e.g. personal, work); omit to query every available server
  • If no query: show usage and STOP.

2. Discover available MCP servers

Known servers (must match this command's allowed-tools):

Tool name Conventional label
mcp__semantic-search__search_related (default)
mcp__semantic-search-personal__search_related personal
mcp__semantic-search-work__search_related work

If --server=<label> was passed: keep only the matching tool. Else: attempt all three in parallel and treat any tool that errors with "not available" / "unknown tool" as absent.

If none of the listed MCP tools is wired up, jump to step 4 (REST fallback).

3. Query all available MCP servers

For each available tool, call:

<tool-name>(query=<query>, top_k=<top_k>)

Run them in parallel. Each result list is tagged with its server label.

Merge strategy: combine all results, sort by score descending, keep top top_k overall. Preserve the source label per result.

Jump to step 5 (render).

4. Fall back to REST

Enumerate running semantic-search-http services and their ports, then query each.

# macOS — list running services
launchctl list 2>/dev/null | awk '/com\.github\.bborbe\.semantic-search-http/ {print $3}'

# Linux — list running units
systemctl --user list-units 'semantic-search-http*' --no-legend 2>/dev/null | awk '{print $1}'

For each running service, infer its port from the plist/unit file (--port <N> argument) and query:

curl -fsS --max-time 10 "http://127.0.0.1:<PORT>/search?q=$(printf %s "<query>" | jq -sRr @uri)&top_k=<top_k>"

Read the full file on GitHub · 110 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. 2d ago First seen · 110 lines · 20 tokens per session scan A 9b66548d367f

Subscribe to this mod's changes

search is a command published in the GitHub repository bborbe/semantic-search (2 stars, last pushed 6d ago), licensed BSD-2-Clause. It adds 20 tokens to every session and 1,092 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.