retrieve

A document-search tool for an Amazon Bedrock knowledge base, which stores uploaded or web-crawled content. It uses retrieval-augmented generation (RAG) to find relevant passages and returns their source links and titles.

In plain words
What is it for?
Use it to search uploaded documents or web-crawled content, answer questions from that knowledge base, and retrieve relevant passages with their sources.
Why use it?
It helps you find supporting information in a stored document collection without manually opening and searching each file.

Skill for Claude CodeCodex

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 skills/kyopark2014/agent-plugins/retrieve
Any agent
npx skills add kyopark2014/agent-plugins --skill retrieve
Clone the repo
git clone --depth 1 https://github.com/kyopark2014/agent-plugins

Made for: Claude Code, Codex.

Per session 54 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 771 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.00054 $0.00771
Opus 5 $0.00027 $0.00385
Sonnet 5 $0.00011 $0.00154
Haiku 4.5 $0.00005 $0.00077

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

Security

Grade A, and why

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

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/retrieve_search.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

result = subprocess.run(['python', 'scripts/retrieve_search.py', 'keyword'],
application/skills/retrieve/SKILL.md · 113 lines

How it starts

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

Knowledge Base Retrieve

Search and retrieve relevant documents from an Amazon Bedrock Knowledge Base using RAG.

Quick Start

Use the retrieve script to query the knowledge base by keyword:

import subprocess
result = subprocess.run(['python', 'scripts/retrieve_search.py', 'keyword'], 
                       capture_output=True, text=True, cwd='retrieve')
print(result.stdout)

Script Location

The retrieve script is located at skills/retrieve/scripts/retrieve_search.py relative to the application working directory. IMPORTANT: Always use the FULL path skills/retrieve/scripts/retrieve_search.py — do NOT shorten to scripts/retrieve_search.py.

Features

  • Knowledge Base Search: Query documents indexed in Amazon Bedrock Knowledge Base
  • RAG-based Retrieval: Uses vector search to find the most relevant content
  • Source References: Returns source URLs and document titles for each result
  • Auto Recovery: Automatically updates knowledge base ID if the resource is not found
  • S3 & Web Sources: Supports both S3 document and web-crawled content locations
  • Top Results: Returns up to 5 most relevant document chunks

Usage Examples

Basic Query

# Search for information about a topic
result = subprocess.run(['python', 'scripts/retrieve_search.py', '클라우드 아키텍처'], 
                       capture_output=True, text=True, cwd='retrieve')

Technical Query

# Search for technical documentation
result = subprocess.run(['python', 'scripts/retrieve_search.py', 'API authentication'], 
                       capture_output=True, text=True, cwd='retrieve')

Concept Query

# Search for explanations
result = subprocess.run(['python', 'scripts/retrieve_search.py', '보안 정책'], 
                       capture_output=True, text=True, cwd='retrieve')

Output Format

The script returns a JSON array. Each element contains:

[
  {
    "contents": "matched text from the knowledge base",
    "reference": {
      "url": "https://...",
      "title": "document_name.pdf",
      "from": "RAG"
    }
  }
]

Read the full file on GitHub · 113 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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 · 113 lines · 54 tokens per session scan A 933362dc44a4

Subscribe to this mod's changes

retrieve is a skill published in the GitHub repository kyopark2014/agent-plugins (4 stars, last pushed 25d ago), licensed MIT. It adds 54 tokens to every session and 771 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories