supabase-rag-implementer

supabase-rag-implementer is an agent for Claude Code from luanpdd/kit-mcp. It costs 52 tokens per session (4,728 once invoked), scanned A, original, MIT.

A Supabase assistant for building retrieval-augmented generation, or RAG: an AI search setup that finds relevant stored text before generating an answer. It uses vector representations to compare meaning rather than only matching words.

In plain words
What is it for?
It creates the vector database migration and HNSW search index, a tenant-protected document-matching function, and a server-side embedding function with text chunking.
Why use it?
It helps avoid mismatched vector sizes, unsafe search functions, and cross-tenant data leaks when different organizations share one system.

Agent for Claude Code

Written for Claude Code: a Claude Code subagent (agents/*.md). Also seen: mentions Claude Code; mentions Codex; mentions Gemini CLI.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is A skill [`supabase-pgvector-rag`](../skills/supabase-pgvector-rag/SKILL.md) é a fonte canônica de dim por modelo, operadores `<=>`/`<#>`/`<->` e regras de chunk.

Good fit It creates the vector database migration and HNSW search index, a tenant-protected document-matching function, and a server-side embedding function with text chunking.

Compare 6 agents from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/luanpdd/kit-mcp
agentmods
npx agentmods add agents/luanpdd/kit-mcp/supabase-rag-implementer

Made for: Claude Code.

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 supabase-rag-implementer

README.md
[![agentmods](https://agentmods.dev/badge/agents/luanpdd/kit-mcp/supabase-rag-implementer/github.svg)](https://agentmods.dev/agents/luanpdd/kit-mcp/supabase-rag-implementer)
Your own site
<a href="https://agentmods.dev/agents/luanpdd/kit-mcp/supabase-rag-implementer"><img src="https://agentmods.dev/badge/agents/luanpdd/kit-mcp/supabase-rag-implementer/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 supabase-rag-implementer

Your own site · 80×15
<a href="https://agentmods.dev/agents/luanpdd/kit-mcp/supabase-rag-implementer"><img src="https://agentmods.dev/badge/agents/luanpdd/kit-mcp/supabase-rag-implementer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 52 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 4,728 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.00052 $0.04728
Opus 5.5 $0.00021 $0.01891
Sonnet 5.5 $0.00010 $0.00946
Haiku 4.5 $0.00005 $0.00473

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

Security

Grade A, and why

supabase-rag-implementer 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.

kit/agents/supabase-rag-implementer.md · 350 lines

How it starts

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

Você é o rag-implementer Supabase. Recebe descrição de feature de busca semântica / RAG e materializa 3 layers em conjunto: (1) migration com coluna vector(N) + index HNSW, (2) RPC match_documents em security invoker com RLS por tenant (anti-vazamento cross-tenant), (3) Edge Function de embedding server-side (Supabase.ai.Session, zero deps) com chunking de 200-500 tokens. É o par implementer da skill knowledge-only supabase-pgvector-rag — a skill ensina, este agent escreve e aplica.

Compat: Full em Claude Code + Cursor (com Supabase MCP); Partial em Codex + Gemini CLI; Offline-only em Windsurf/Antigravity/Copilot/Trae. Veja COMPATIBILITY.md.

Por que existe

RAG parece "criar tabela com embedding e pronto", mas as armadilhas matam em produção e quase todas são silenciosas:

  • Vazamento cross-tenant — match_documents em security definer (ou tabela sem RLS) retorna documents de QUALQUER tenant por similaridade. O tenant A vê os docs do tenant B sem erro nenhum — só vetores parecidos voltando. É o anti-pattern crítico de RAG multi-tenant.
  • Dim mismatch — coluna vector(1536) com modelo que emite 384 → insert falha (expected 1536 dimensions, got 384) ou, pior, aceita lixo e o ranking vira aleatório.
  • Sem index — sem HNSW, similarity search vira sequential scan; > 10k linhas → queries de segundos a minutos.
  • Embedding no client — gerar embedding no browser expõe a API key do modelo e diverge entre query e ingest (modelos diferentes → espaço vetorial incompatível).
  • Chunk gigante — chunk > 1k tokens dilui o vetor (média de muitos conceitos) e o recall despenca.

Este agent escreve as 3 layers alinhadas pela mesma dimensão e mesmo modelo, com RLS + security invoker como default não-negociável.

Inputs esperados (do caller)

  • feature_name: descrição (ex: "busca semântica em base de conhecimento", "RAG sobre tickets de suporte").
  • table_name: tabela de documents (snake_case plural, ex: documents, kb_chunks). Default: documents.
  • embedding_provider: edge-builtin (default — Supabase.ai.Session('gte-small'), dim 384, zero deps, sem API key) | openai (text-embedding-3-small, dim 1536, requer OPENAI_API_KEY).
  • tenant_pattern: per_user (default — coluna user_id = auth.uid()) | per_org (coluna org_id do JWT) | none (single-tenant; ainda assim RLS por user_id).
  • (Opcional) chunk_size: tokens por chunk. Default 400 (faixa válida 200-500).
  • (Opcional) chunk_overlap: tokens de sobreposição. Default 80 (≈ 20%).
  • (Opcional) match_threshold: corte de similaridade. Default 0.78.

Read the full file on GitHub · 350 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 · 350 lines · 52 tokens per session scan A 5b1f8d278909

Subscribe to this mod's changes

supabase-rag-implementer is an agent published in the GitHub repository luanpdd/kit-mcp (4 stars, last pushed yesterday), licensed MIT. It adds 52 tokens to every session and 4,728 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-09-03.

Related

Other agents, from other repositories

vector-search-expert

Expert in semantic search, vector embeddings, and pgvector v0.8.0 optimization for memory retrieval. Specializes in OpenAI embeddings, HNSW/IVFFlat indexes with iterative scans, hybrid search strategies, and similarity algorithms.

Matt-Dionis/claude-code-configs · 54 tokens

rag-system-designer

RAG architecture specialist for vector databases, embeddings, chunking strategies, and retrieval optimization. Use for designing production RAG systems, selecting vector stores, or optimizing retrieval quality.

SteveGJones/ai-first-sdlc-practices · 40 tokens

db-vector-expert

Expert in vector databases (pgvector, Pinecone, Weaviate, Qdrant, FAISS) with production-ready similarity search examples, embedding strategies, and performance optimization for AI/ML applications.

andisab/swe-marketplace · 46 tokens

FAI GraphRAG Expert

GraphRAG specialist — entity extraction, relationship mapping, knowledge graph construction, community detection, graph-based retrieval with Cosmos DB Gremlin/Neo4j, and hybrid graph+vector search.

frootai/frootai · 45 tokens

vector-database-engineer

Expert in vector databases, embedding strategies, and semantic search implementation. Masters Pinecone, Weaviate, Qdrant, Milvus, and pgvector for RAG applications, recommendation systems, and similarity search. Use PROACTIVELY for vector search implementation, embedding optimization, or semantic retrieval systems.

NOMARJ/sigil · 67 tokens

data-manager

Data manager. Handles storage, deduplication, quality validation, and export of parsed data. Establishes schema design, indexing, and incremental update strategies.

revfactory/harness-100 · 34 tokens