context-retrieval

context-retrieval is a skill for Claude Code, Codex from seb1n/awesome-ai-agent-skills. It costs 53 tokens per session (1,786 once invoked), scanned A, original, MIT.

A method for finding relevant information in a knowledge base using meaning-based search, keyword search, or both. It assembles selected passages so an AI agent can base its answer on stored documents.

In plain words
What is it for?
Use it when an agent must search a document collection, database, or vector store to answer questions with current, relevant context.
Why use it?
It reduces unsupported answers by retrieving source material before generation and ranking the most useful passages for the question.

Skill for Claude CodeCodex

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

Good fit Use it when an agent must search a document collection, database, or vector store to answer questions with current, relevant context.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/seb1n/awesome-ai-agent-skills/context-retrieval
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 seb1n/awesome-ai-agent-skills --skill context-retrieval
Clone the repo
git clone --depth 1 https://github.com/seb1n/awesome-ai-agent-skills

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 context-retrieval

README.md
[![agentmods](https://agentmods.dev/badge/skills/seb1n/awesome-ai-agent-skills/context-retrieval/github.svg)](https://agentmods.dev/skills/seb1n/awesome-ai-agent-skills/context-retrieval)
Your own site
<a href="https://agentmods.dev/skills/seb1n/awesome-ai-agent-skills/context-retrieval"><img src="https://agentmods.dev/badge/skills/seb1n/awesome-ai-agent-skills/context-retrieval/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 context-retrieval

Your own site · 80×15
<a href="https://agentmods.dev/skills/seb1n/awesome-ai-agent-skills/context-retrieval"><img src="https://agentmods.dev/badge/skills/seb1n/awesome-ai-agent-skills/context-retrieval.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 53 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,786 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 pass 7 Sept 2026
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.00053 $0.01786
Opus 5 $0.00026 $0.00893
Sonnet 5 $0.00011 $0.00357
Haiku 4.5 $0.00005 $0.00179

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

Security

Grade A, and why

context-retrieval 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 11d 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.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

context-engineering/context-retrieval/SKILL.md · 92 lines

How it starts

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

Context Retrieval

Context retrieval is the process of finding and assembling the most relevant pieces of information from a knowledge base to ground an AI agent's responses in factual, up-to-date data. It is the backbone of Retrieval Augmented Generation (RAG) and ensures that generated outputs are accurate and verifiable rather than hallucinated.

Workflow

  1. Embed the Query: Convert the user's natural-language query into a dense vector representation using an embedding model (e.g., OpenAI text-embedding-3-small, Cohere embed-v3, or an open-source model like bge-large). The embedding captures the semantic meaning of the query so it can be compared against stored documents.

  2. Search the Vector Store: Send the query embedding to a vector database (Pinecone, Weaviate, Qdrant, Chroma, etc.) and perform an approximate nearest-neighbor (ANN) search. Request the top-k candidate chunks, typically k = 10–20 to give the reranker enough material to work with.

  3. Rerank the Results: Pass the candidate chunks through a cross-encoder reranker (e.g., Cohere Rerank, bge-reranker-large, or a ColBERT model). The reranker scores each chunk against the original query with full attention, producing much more accurate relevance scores than cosine similarity alone. Keep the top-n results (typically n = 3–5).

  4. Assemble the Context Window: Concatenate the selected chunks into a single context block, ordered by relevance score descending. Prepend source metadata (file path, URL, page number) to each chunk so the agent can cite its sources. Ensure the total token count fits the model's budget for the context section of the prompt.

  5. Generate the Response: Feed the assembled context into the LLM prompt alongside the original query and a system instruction that tells the model to answer only from the provided context. This grounds the response in retrieved facts and reduces hallucination.

  6. Validate and Cite: After generation, verify that the answer references information actually present in the retrieved chunks. Attach inline citations or a references section so the user can trace each claim back to a source document.

Read the full file on GitHub · 92 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. 11d ago First seen · 92 lines · 53 tokens per session scan A 23a690dd12ee

Subscribe to this mod's changes

context-retrieval is a skill published in the GitHub repository seb1n/awesome-ai-agent-skills (179 stars, last pushed 1mo ago), licensed MIT. It adds 53 tokens to every session and 1,786 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-08-30.

Related

Other skills, from other repositories

iterative-retrieval

Pattern for progressively refining context retrieval to solve the subagent context problem.

hashgraph-online/awesome-codex-plugins · 19 tokens

apify-product-data-setup

Wire an AI agent to live e-commerce product data using Apify's E-commerce Scraping Tool over MCP, either as runtime tool calls or as a scheduled refresh into a vector store. Trigger on "give my agent live product data", "my agent quotes stale prices", "connect Apify MCP to Claude or Cursor or n8n", "add product data…

apify/awesome-skills · 132 tokens

801-regulations-eu-ai-act

Use when reviewing, designing, or modifying Java enterprise systems that use AI, LLMs, AI agents, RAG, tool calling, workflow automation, or model-based decision support and need EU AI Act regulatory awareness. This should trigger for requests such as Review a Java AI system for EU AI Act controls; Design governance…

jabrena/plinth · 108 tokens

ai-security

Use when attacking an AI/ML system or model — prompt injection & jailbreaks (Crescendo, Skeleton Key, Best-of-N), RAG/vector poisoning, agentic/MCP exploitation (CVE-2025-54136), ML supply-chain RCE (pickle CVE-2025-32434), model extraction / membership inference / adversarial suffixes (GCG).

hypnguyen1209/offensive-claude · 81 tokens

library-rag

Semantic search over a personal library using Nemotron-3-Embed-1B embeddings + sqlite-vec. Index books, documents, any text corpus; query by meaning. Includes EPUB→Markdown conversion and MCP server for auto-available search tools.

moonlight-lupin/agent-skills · 54 tokens

portable-rag-per-skill

Pattern for standalone RAG indexes that live inside a skill directory — portable, no external DB or MCP dependency.

moonlight-lupin/agent-skills · 29 tokens