agentleFS
patonkikhpatonkikh/APES/skills/rag/rag-architecture-designer/skill.md

rag-architecture-designer

Skill3 starsChanged 4 months agoMITView on GitHub

Design a Retrieval-Augmented Generation (RAG) pipeline architecture: ingestion, indexing, retrieval, generation, and evaluation components. Use when working on RAG architecture, retrieval pipelines, vector stores.

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 4 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Input: Use case, document types, query patterns, quality/latency requirements

    line 16
  2. Distinctive:

    Document per stage: format handlers, metadata extraction, update frequency.

    line 41
  3. Distinctive:

    Consider: pgvector, Pinecone, Weaviate, OpenSearch, managed vs self-hosted.

    line 56
  4. Distinctive:

    Start with smallest pipeline that passes eval bar.

    line 107

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
skill.md

RAG Architecture Designer

Purpose

Design a Retrieval-Augmented Generation (RAG) pipeline architecture: ingestion, indexing, retrieval, generation, and evaluation components.

Input: Use case, document types, query patterns, quality/latency requirements
Output: RAG Architecture document with pipeline diagram, component specs, and technology recommendations
References: See references.md for domain cheat sheets. Examples: See examples.md for worked input/output.


Workflow

Step 1: Define RAG requirements

RequirementTarget
Query typesfactual, analytical, multi-hop
Corpus sizedocuments, pages, tokens
Freshnessstatic / daily / real-time
Latency budgetp95 target
Accuracy targetcitation required, acceptable hallucination rate

Step 2: Design ingestion pipeline

Source → Extract → Clean → Chunk → Embed → Index

Document per stage: format handlers, metadata extraction, update frequency.

Step 3: Design retrieval pipeline

Query → Preprocess → Retrieve → Rerank → Context assembly → Generate

Specify retriever type: dense, sparse, hybrid.

Step 4: Select vector store and index

OptionFitTrade-off

Consider: pgvector, Pinecone, Weaviate, OpenSearch, managed vs self-hosted.

Step 5: Plan evaluation loop

  • Offline: golden Q&A set, RAGAS metrics
  • Online: user feedback, citation click-through
  • Regression on corpus updates

Step 6: Validate

Run Validation checklist.


Decision Rules

ConditionAction
Corpus < 100 pages, staticConsider simple keyword search first; RAG may be overkill
Real-time freshness requiredPlan incremental indexing pipeline
Multi-hop reasoning neededAdd query decomposition or agentic retrieval
No eval datasetBlock production; require golden set creation
Customer-facing without citationsRequire citation in generation step

Validation

  • Query types and corpus characteristics documented
  • Ingestion pipeline end-to-end defined
  • Retrieval pipeline with retriever type specified
  • Vector store recommendation with trade-offs
  • Context assembly linked to context-engineering budget
  • Eval plan with offline and online metrics
  • Latency budget allocated per pipeline stage
  • Citation strategy defined for customer-facing use

Anti-patterns

  • RAG by default — applying RAG without retrieval need.
  • Chunk and pray — no chunking strategy or eval.
  • Single retriever — no hybrid when queries vary widely.
  • No freshness plan — stale index without update pipeline.
  • Missing citations — generated answers without source attribution.

Best Practices

  • Start with smallest pipeline that passes eval bar.
  • Separate ingestion from query serving for independent scaling.
  • Version indexes for rollback on bad ingests.
  • Align with ai/context-engineering for assembly.
  • Document RAG-specific ADRs.

Output Structure

# RAG Architecture: [System Name]

## Requirements
| Dimension | Target |
|-----------|--------|

## Ingestion Pipeline
[Stage descriptions]

## Retrieval Pipeline
[Stage descriptions]

## Technology Stack
| Component | Choice | Rationale |
|-----------|--------|-----------|

## Evaluation
| Metric | Target | Method |
|--------|--------|--------|

## Diagram
```mermaid
[pipeline diagram]

---

# Next Skills

| Outcome | Recommended Skill |
|---------|-------------------|
| Chunking strategy | `rag/chunking-strategy-advisor` |
| Embedding selection | `rag/embedding-strategy-advisor` |
| Optimize retrieval | `rag/retriever-optimizer` |
| Hybrid search | `rag/hybrid-search-advisor` |
| Context budget | `ai/context-engineering` |

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.