research

A command for researching indexed Markdown files using semantic search, which finds related meaning rather than only exact words, across available MCP servers.

In plain words
What is it for?
Use it to investigate a topic, optionally restrict the search to one server, and summarize the most relevant results.
Why use it?
It gathers relevant files and combines their findings, reducing the need to search and read them one at a time.

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/research
Clone the repo
git clone --depth 1 https://github.com/bborbe/semantic-search
Per session 28 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,161 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.00028 $0.01161
Opus 5 $0.00014 $0.00580
Sonnet 5 $0.00006 $0.00232
Haiku 4.5 $0.00003 $0.00116

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

Security

Grade A, and why

research 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 "<topic>" | jq -sRr @uri)&top_k=10"
commands/research.md · 120 lines

How it starts

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

Usage

/semantic-search:research kafka backup strategy
/semantic-search:research "obsidian git workflow"
/semantic-search:research --server=work sentry alerting flow

Process

Step 1: Validate input

  • First non-flag argument → topic
  • --server=<label> (optional) → scope to a single MCP server; omit to query every available server
  • If no topic: show usage and STOP.

Step 2: Initial semantic search

Discover available MCP 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.

Query all available MCP servers with top_k=10 each:

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

Run in parallel. Each result list is tagged with its server label. Merge by score descending; keep top 10 overall.

Fall back to REST if no MCP server is wired up:

# macOS
launchctl list 2>/dev/null | awk '/com\.github\.bborbe\.semantic-search-http/ {print $3}'
# Linux
systemctl --user list-units 'semantic-search-http*' --no-legend 2>/dev/null | awk '{print $1}'

For each running service, infer port from plist/unit and query:

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

Override default with SEMANTIC_SEARCH_URL if needed.

Last resort if both MCP and REST fail:

Grep pattern="<topic keywords>" path=<content roots> -i --files-with-matches

Note in the final report which transport(s) were used and which servers were queried.

Step 3: Categorize results

Sort merged results into buckets based on path:

  • Guides / Reference — paths containing guide, hub, framework, or located in known knowledge folders
  • Operational / Runbooks — paths containing runbook, alert, or in *Runbooks* folders
  • Notes / Tasks — daily notes, task files, miscellaneous

Read the full file on GitHub · 120 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 · 120 lines · 28 tokens per session scan A 198052339c4a

Subscribe to this mod's changes

research is a command published in the GitHub repository bborbe/semantic-search (2 stars, last pushed 6d ago), licensed BSD-2-Clause. It adds 28 tokens to every session and 1,161 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.