bedrock-rag

bedrock-rag is a skill for Claude Code, Codex from ihatesea69/kiro-kit. It costs 52 tokens per session (1,273 once invoked), scanned A, original, MIT.

A guide to retrieval-augmented generation on Amazon Bedrock Knowledge Bases. RAG lets a chatbot search a document collection, add relevant passages to its prompt, and answer with citations to those sources.

In plain words
What is it for?
Use it to ingest documents from Amazon S3, split and embed them, store vectors, retrieve relevant passages, rerank results, add citations, and apply contextual safety checks.
Why use it?
It helps chatbots answer from internal documents instead of relying only on model memory, while making it easier to investigate whether incorrect answers came from bad retrieval or generation.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to ingest documents from Amazon S3, split and embed them, store vectors, retrieve relevant passages, rerank results, add citations, and apply contextual safety checks.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ihatesea69/kiro-kit/bedrock-rag
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.

Any agent
npx skills add ihatesea69/kiro-kit --skill bedrock-rag
Clone the repo
git clone --depth 1 https://github.com/ihatesea69/kiro-kit

Made for: Claude Code, Codex.

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 bedrock-rag

README.md
[![agentmods](https://agentmods.dev/badge/skills/ihatesea69/kiro-kit/bedrock-rag.svg)](https://agentmods.dev/skills/ihatesea69/kiro-kit/bedrock-rag)
Your own site
<a href="https://agentmods.dev/skills/ihatesea69/kiro-kit/bedrock-rag"><img src="https://agentmods.dev/badge/skills/ihatesea69/kiro-kit/bedrock-rag.svg" alt="Measured on agentmods" height="20"></a>
Per session 52 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,273 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. Third-party audits
  • NVIDIA SkillSpector fail 7 Sept 2026
SkillSpector: 1 finding, up to high
  • high Output Handling · line 135
    Model output is used without validation or sanitization. Unvalidated output injected into downstream contexts (SQL, shell, HTML) enables injection attacks and arbitrary code execution.
    Fix: Validate and sanitize all model output before using it in downstream contexts. Use parameterized queries for SQL, shell quoting for commands, and HTML encoding for web output.
How audits are shown
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.00052 $0.01273
Opus 5 $0.00026 $0.00636
Sonnet 5 $0.00010 $0.00255
Haiku 4.5 $0.00005 $0.00127

Measured 3d ago against content hash bf78761d7787, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

bedrock-rag 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 3d 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.

presets/ai-engineer/skills/bedrock-rag/SKILL.md · 149 lines

How it starts

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

RAG on Bedrock Knowledge Bases

Activate this skill when building retrieval-augmented answering on AWS. For the framework-agnostic, self-hosted-vector-DB flavour, see the data-ai preset's RAG material; this skill is the AWS-native path.

When to Use

  • A chatbot must answer from internal documents with citations
  • Choosing a chunking strategy, embedding model, or vector store
  • Wiring retrieval into a Strands agent as a tool
  • Diagnosing "the answer is wrong" in a RAG system

The Pipeline

S3 source → StartIngestionJob → chunk → embed → vector store
                                                     ↓
user query → (optional rewrite) → Retrieve → rerank → prompt + context
                                                     ↓
                          generate → citations → output guardrail → user

Most RAG failures are retrieval failures, not generation failures. Before touching the prompt, check whether the correct chunk was retrieved at all. If it was not, no amount of prompt engineering fixes it.

Chunking

The single highest-leverage config choice.

Strategy Use when
Fixed-size + overlap Homogeneous prose; the safe default (~300–500 tokens, 10–20% overlap)
Hierarchical Long structured documents; retrieve small, return the parent for context
Semantic Topic boundaries matter more than length; costs more to ingest
No chunking Documents are already short and self-contained (FAQs, tickets)

Preserve structure in the chunk text — a heading path prepended to each chunk materially improves retrieval on technical corpora. Attach metadata (source document, section, last-modified, access tier) at ingestion; metadata filtering at query time is how you enforce per-user document access without a second index.

Retrieval and Generation

Retrieve when the agent should reason over the results:

resp = bedrock_agent_runtime.retrieve(
    knowledgeBaseId=KB_ID,
    retrievalQuery={"text": query},
    retrievalConfiguration={"vectorSearchConfiguration": {
        "numberOfResults": 10,
        "overrideSearchType": "HYBRID",   # semantic + keyword
        "filter": {"equals": {"key": "access_tier", "value": user_tier}},
    }},
)

Read the full file on GitHub · 149 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. 3d ago First seen · 149 lines · 52 tokens per session scan A bf78761d7787

Subscribe to this mod's changes

bedrock-rag is a skill published in the GitHub repository ihatesea69/kiro-kit (18 stars, last pushed 18d ago), licensed MIT. It adds 52 tokens to every session and 1,273 once invoked, about $0.0003 per session on Opus 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-09-03.

Related

Other skills, from other repositories

qmd-mcp-skill

Use a local QMD knowledge base through UXC over MCP stdio, with daemon-backed session reuse and typed retrieval flows that avoid repeated model warmup and unnecessary query-expansion latency.

holon-run/uxc · 44 tokens

kb-review

Read-only review of a retrieval-augmented setup, Amazon Bedrock Knowledge Bases first and hand-built RAG pipelines second: sources, chunking, metadata and tenant filtering, embedding model, vector store, sync, retrieval quality and cost per query. Builds a golden question set, measures recall@5 and MRR against the…

timurgaleev/vibestack · 112 tokens

ai-automation

Workflow automation skills using AI. Build chatbots, automate repetitive tasks, integrate LLMs into pipelines, design intent-based assistants. Triggers on: chatbot, automation, workflow, AI agent, RAG, LLM integration, intent recognition, conversation design.

fatihkan/badi · 56 tokens

graphify

Turn any folder of files into a navigable knowledge graph with community detection, an honest audit trail, and three outputs: interactive HTML, GraphRAG-ready JSON, and a plain-language GRAPHREPORT.md.

LucasSantana-Dev/sharekit · 55 tokens

recall

One-shot semantic lookup against the local RAG index — answers "what did we decide about X", "where did we hit this bug before", "is there a memory note for Y" in a single MCP call. Backed by the ragquery MCP tool over 21k chunks (memory, plans, handoffs, skills, standards, repo docs, changelogs, specs, code, commits…

LucasSantana-Dev/sharekit · 121 tokens

adt-rag-drift

Detect and fix stale chunks (files that changed or were deleted since last indexing).

LucasSantana-Dev/sharekit · 22 tokens