rag-engineer

rag-engineer is a skill for Claude Code, Codex from hoangatg/ai-agent-toolkit. It costs 42 tokens per session (1,066 once invoked), scanned A, original, MIT.

A guide to building retrieval-augmented generation (RAG) systems, which search a knowledge source before asking an AI model to produce an answer.

In plain words
What is it for?
Use it to choose embeddings and vector databases, split documents into searchable sections, retrieve and rerank results, and evaluate answer quality.
Why use it?
It helps AI features find relevant external information instead of relying only on what the model learned during training.

Skill for Claude CodeCodex

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

Good fit Use it to choose embeddings and vector databases, split documents into searchable sections, retrieve and rerank results, and evaluate answer quality.

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

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

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/hoangatg/ai-agent-toolkit/rag-engineer"><img src="https://agentmods.dev/badge/skills/hoangatg/ai-agent-toolkit/rag-engineer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 42 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,066 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.
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.00042 $0.01066
Opus 5 $0.00021 $0.00533
Sonnet 5 $0.00008 $0.00213
Haiku 4.5 $0.00004 $0.00107

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

Security

Grade A, and why

rag-engineer 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 8d 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.

.agent/skills/rag-engineer/SKILL.md · 165 lines

How it starts

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

RAG Engineer

Build AI systems that know what they don't know — and find the right answers.


1. RAG Architecture

Core Pipeline

Query → Embed → Search → Retrieve → Rerank → Augment → Generate → Evaluate

Component Decisions

Component Options Decision Factor
Embedding OpenAI, Cohere, local Cost, latency, quality
Vector DB Pinecone, Weaviate, Chroma, pgvector Scale, features, cost
Chunking Fixed, semantic, document-aware Content type, quality needs
Retrieval Dense, sparse, hybrid Accuracy vs speed
Reranking Cross-encoder, Cohere, ColBERT Quality vs latency budget

2. Chunking Strategies

Strategy Selection

Strategy Best For Chunk Size
Fixed-size Uniform content 256-512 tokens
Sentence-based Articles, docs Natural boundaries
Semantic Mixed content Meaning boundaries
Document-aware Structured docs Headers, sections
Recursive Code, markdown Language-specific splits

Chunking Principles

Principle Application
Overlap 10-20% overlap between chunks
Context preservation Don't split mid-sentence/thought
Metadata enrichment Attach source, section, position
Size balance Not too small (no context), not too large (noise)

3. Embedding Best Practices

Model Selection

Factor Consideration
Dimension Higher = more nuance, more cost
Task Symmetric (search) vs asymmetric (Q&A)
Language Multilingual vs single language
Updates Fine-tunable vs frozen

Optimization

  • Normalize vectors for cosine similarity
  • Batch embedding requests for throughput
  • Cache frequently accessed embeddings
  • Consider dimensionality reduction for scale

4. Retrieval Patterns

Hybrid Search

Read the full file on GitHub · 165 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. 8d ago First seen · 165 lines · 42 tokens per session scan A 33a0778f4b03

Subscribe to this mod's changes

rag-engineer is a skill published in the GitHub repository hoangatg/ai-agent-toolkit (1 stars, last pushed 5mo ago), licensed MIT. It adds 42 tokens to every session and 1,066 once invoked, about $0.0002 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

pgvector-semantic-search

Use this skill for setting up vector similarity search with pgvector for AI/ML embeddings, RAG applications, or semantic search. Trigger when user asks to: Store or search vector embeddings in PostgreSQL Set up semantic search, similarity search, or nearest neighbor search Create HNSW or IVFFlat indexes for vectors…

timescale/pg-aiguide · 190 tokens

postgres-hybrid-text-search

Use this skill to implement hybrid search combining BM25 keyword search with semantic vector search using Reciprocal Rank Fusion (RRF). Trigger when user asks to: Combine keyword and semantic search Implement hybrid search or multi-modal retrieval Use BM25/pgtextsearch with pgvector together Implement RRF (Reciprocal…

timescale/pg-aiguide · 162 tokens

iterative-retrieval

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

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

session-rag-eval

Run and debug Chatbox session attachment RAG model evaluation with synthetic and real long-file fixtures.

chatboxai/chatbox · 25 tokens

microsoft-extensions-ai

Build provider-agnostic .NET AI integrations with Microsoft.Extensions.AI, IChatClient, embeddings, middleware, structured output, vector search, and evaluation. USE FOR: building or reviewing .NET code that uses Microsoft.Extensions.AI, Microsoft.Extensions.AI.Abstractions, IChatClient, IEmbeddingGenerator…

managedcode/dotnet-skills · 128 tokens

building-agents

Use when building or restructuring an LLM agent — provider adapter, tool calling, structured output, RAG, agent loop, eval gate, cost routing, tracing, MCP server — model-agnostic across OpenAI/Anthropic/Gemini/OSS so a model swap is a config change. NOT vector-store SQL alone (that is postgresdb) or service…

ericrisco/rsc-harness · 85 tokens