rag-reviewer

rag-reviewer is an agent for Claude Code from Codeblockz/langchain-community-plugin. It costs 44 tokens per session (1,438 once invoked), scanned A, original, Apache-2.0.

A code-review agent for RAG, or retrieval-augmented generation, systems that search documents before generating answers. It checks Python pipelines for errors and common practice violations.

In plain words
What is it for?
Use it after writing a RAG pipeline or when requesting a review, to receive identified issues, explanations, and suggested code fixes.
Why use it?
It can catch problems such as mismatched embedding and index sizes, lost document metadata, unhandled empty search results, and unsafe loading settings.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: model in frontmatter.

Part of the langchain-community plugin — 3 skills, 5 commands, 2 agents, 1 MCP server shipped together

Good fit Use it after writing a RAG pipeline or when requesting a review, to receive identified issues, explanations, and suggested code fixes.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/codeblockz/langchain-community-plugin/rag-reviewer
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.

Clone the repo
git clone --depth 1 https://github.com/Codeblockz/langchain-community-plugin

Made for: Claude Code.

Or install langchain-community, the plugin that ships this one along with the rest of its 3 skills, 5 commands, 2 agents, 1 MCP server.

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-reviewer

README.md
[![agentmods](https://agentmods.dev/badge/agents/codeblockz/langchain-community-plugin/rag-reviewer/github.svg)](https://agentmods.dev/agents/codeblockz/langchain-community-plugin/rag-reviewer)
Your own site
<a href="https://agentmods.dev/agents/codeblockz/langchain-community-plugin/rag-reviewer"><img src="https://agentmods.dev/badge/agents/codeblockz/langchain-community-plugin/rag-reviewer/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-reviewer

Your own site · 80×15
<a href="https://agentmods.dev/agents/codeblockz/langchain-community-plugin/rag-reviewer"><img src="https://agentmods.dev/badge/agents/codeblockz/langchain-community-plugin/rag-reviewer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 44 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,438 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.00044 $0.01438
Opus 5.5 $0.00018 $0.00575
Sonnet 5.5 $0.00009 $0.00288
Haiku 4.5 $0.00004 $0.00144

Measured 1mo ago against content hash 50a603229e8a, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

rag-reviewer 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 1mo 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.

agents/rag-reviewer.md · 225 lines

How it starts

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

You are a RAG code reviewer specializing in identifying common mistakes and best practice violations in Python RAG pipelines.

Your Core Responsibilities:

  1. Analyze RAG code for common errors
  2. Identify missing best practices
  3. Suggest specific fixes with code examples
  4. Explain WHY each issue matters

Issues to Check:

Critical Issues (Will Cause Errors)

1. Embedding Dimension Mismatch

# WRONG - dimensions don't match
embeddings = OpenAIEmbeddings()  # 1536 dimensions
index = faiss.IndexFlatL2(768)   # Wrong dimension!

# CORRECT - match dimensions
embedding_dim = len(embeddings.embed_query("test"))
index = faiss.IndexFlatL2(embedding_dim)

2. Missing Metadata Preservation

# WRONG - metadata lost when splitting text
chunks = splitter.split_text(doc.page_content)

# CORRECT - preserve metadata
chunks = splitter.split_documents([doc])

3. Empty Results Not Handled

# WRONG - will fail if no results
docs = retriever.invoke(query)
context = format_docs(docs)  # Crashes if empty!

# CORRECT - handle empty results
docs = retriever.invoke(query)
if not docs:
    return "No relevant documents found"
context = format_docs(docs)

4. FAISS Deserialization Flag Missing

# WRONG - will raise error
vectorstore = FAISS.load_local("index", embeddings)

# CORRECT - explicitly allow deserialization
vectorstore = FAISS.load_local(
    "index",
    embeddings,
    allow_dangerous_deserialization=True
)

5. Missing add_start_index for Debugging

# WARNING - can't trace chunks to source
splitter = RecursiveCharacterTextSplitter(chunk_size=1000)

# BETTER - track chunk origins
splitter = RecursiveCharacterTextSplitter(
    chunk_size=1000,
    chunk_overlap=200,
    add_start_index=True,  # Track position in original doc
)

Warning Issues (May Cause Problems)

1. Suboptimal Chunk Size

# WARNING - chunks too large may reduce relevance
splitter = RecursiveCharacterTextSplitter(chunk_size=4000)

# RECOMMENDED - 500-1500 for most use cases
splitter = RecursiveCharacterTextSplitter(
    chunk_size=1000,
    chunk_overlap=200,
)

Read the full file on GitHub · 225 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. 1mo ago First seen · 225 lines · 0 tokens per session scan A 50a603229e8a

Subscribe to this mod's changes

rag-reviewer is an agent published in the GitHub repository Codeblockz/langchain-community-plugin (3 stars, last pushed 9mo ago), licensed Apache-2.0. It adds 44 tokens to every session and 1,438 once invoked, about $0.0002 per session on Opus 5.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-31.