RAG Workflow Planner — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited RAG Workflow Planner (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
This skill walks through your RAG use case requirements and designs a complete, production-ready Retrieval-Augmented Generation pipeline. It recommends a chunking strategy, embedding model, vector store, retrieval approach, and reranking strategy — each choice justified against your specific requirements. The output includes an ASCII architecture diagram, a component-by-component breakdown, and a starter code outline.
Use this when you're starting a new RAG project or when an existing RAG pipeline is producing poor retrieval quality and you want a systematic redesign.
Copy this file to .agents/skills/rag-workflow-planner/SKILL.md in your project root.
Then describe your use case and ask:
The more detail you provide about document types, query patterns, and latency requirements, the more precise the output.
Add the "Prompt / Instructions" section to your .cursorrules file. Describe your RAG use case in the chat.
Describe your use case and answer the requirements questions in the instructions below, then include the full instructions. Codex will produce the architecture design.
When asked to design a RAG pipeline, follow these steps:
Specify: chunk size (tokens), overlap, splitting boundaries, and any pre-processing needed (strip headers/footers, extract tables separately).
top_k for initial retrieval, top_n after reranking.## RAG Architecture for [Use Case]
### Requirements Summary
[Brief recap of gathered requirements]
### Architecture Diagram
[ASCII diagram showing: Documents → Ingestion Pipeline → Vector Store ← Query → Retrieval → Reranker → LLM → Response]
### Component Breakdown
| Component | Recommendation | Justification |
|-----------|---------------|---------------|
| Chunking | ... | ... |
| Embedding Model | ... | ... |
| Vector Store | ... | ... |
| Retrieval Strategy | ... | ... |
| Reranker | ... | ... |
| LLM | ... | ... |
### Ingestion Pipeline
[Step-by-step: load → clean → chunk → embed → store]
### Query Pipeline
[Step-by-step: receive query → embed → retrieve → rerank → prompt → generate → return]
### Starter Code Outline
[Pseudocode or skeleton showing the main pipeline in Python or TypeScript]
### Risks and Mitigations
[Key risks with mitigation strategies]Input to Agent:
"Use the RAG Workflow Planner skill. I'm building a chatbot that answers questions about our company's internal policy documents. We have about 200 PDFs, mostly 5–20 pages each. Queries will be short questions like 'What is the vacation policy?' or 'How do I expense international travel?' Response time under 3 seconds. We're on AWS, prefer managed services where possible."
Output from Agent:
## RAG Architecture for Internal Policy Q&A Chatbot
>
### Requirements Summary - 200 PDFs, 5–20 pages each (~500 total pages) - Short factual English queries - < 3 second latency - AWS, prefer managed services - Static corpus with occasional updates
>
### Architecture Diagram
>
`` [PDF Files] │ ▼ [PDF Parser + Text Cleaner] │ ▼ [Semantic Chunker] ──── ~500 token chunks, paragraph boundaries │ ▼ [OpenAI text-embedding-3-small] │ ▼ [Pinecone Index] ◄──────────────────────────────────┐ │ [User Query] ──► [Embed Query] ──► [Top-20 Retrieve] ──► [Cohere Rerank top-5] ──► [GPT-4o] ──► [Answer + Sources] ``>
### Component Breakdown
>
| Component | Recommendation | Justification | |-----------|---------------|---------------| | Chunking | Semantic (paragraph boundaries, ~500 tokens, 50 token overlap) | Policy docs have clear paragraph structure; semantic chunks preserve policy context | | Embedding | OpenAI text-embedding-3-small | Best accuracy/cost for English, managed, no infra | | Vector Store | Pinecone Serverless | AWS-native, managed, scales to this corpus size cheaply | | Retrieval | Dense (cosine similarity), top-20 | Semantic queries match well; 200 docs don't need hybrid | | Reranker | Cohere Rerank v3, top-5 | Improves precision significantly for policy Q&A; < 300ms added latency | | LLM | GPT-4o or Claude 3 Haiku | Haiku for speed, GPT-4o for complex multi-policy questions |
>
### Ingestion Pipeline 1. Load PDF → extract text withpdfplumberor AWS Textract (for scanned PDFs) 2. Clean: strip page numbers, headers, footers 3. Split on paragraph boundaries; merge short paragraphs until ~500 tokens 4. Embed each chunk withtext-embedding-3-small5. Store in Pinecone with metadata:{ doc_name, page_range, last_updated }
>
### Query Pipeline 1. Receive user query 2. Embed with text-embedding-3-small 3. Retrieve top-20 chunks from Pinecone 4. Rerank with Cohere Rerank → keep top-5 5. Build prompt: system instructions + top-5 chunks as context + user question 6. Call LLM; instruct it to cite the source document name 7. Return answer + source list>
### Risks and Mitigations - Stale documents: Re-embed changed PDFs on upload; store last_updated in metadata and filter stale chunks if needed - Hallucination: System prompt: "Answer only from the provided context. If the answer is not in the documents, say so." - Low retrieval recall: If reranker still misses answers, add query expansion: generate 3 query variants with the LLM before retrieval~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.