/rag-pipeline

RAG Pipeline & Document Ingestion System

Document chunking, hybrid vector search, re-ranking, and context synthesis.

/rag-pipeline Build PDF document chunking and retrieval pipeline with citations

Where it installs

# .claude/commands/rag-pipeline.md
---
description: ...
argument-hint: [knowledge source and retrieval need]
allowed-tools: Read, Grep, Glob, Skill, TodoWrite, Task, ...
---

What it does

/rag-pipeline is a Cursor slash command. Type it in chat to run a saved workflow: RAG Pipeline & Document Ingestion System.

Builds full Retrieval-Augmented Generation flows: PDF/text chunking, embedding generation, vector storage, hybrid search, and citation injection.

Document chunking, hybrid vector search, re-ranking, and context synthesis. Unlike a skill, a command is something you invoke on purpose. The agent does not decide to run /rag-pipeline for you.

Why it exists

Founders retype the same multi-step prompt until it rots. /rag-pipeline exists so the pipeline, all 4 steps of it, is a file in .cursor/commands, versioned with the repo.

It ships in the Engineering Kit. It is wired to the AI & Vector Engineer (ai-engineer) and Data Pipeline & ETL Engineer (data-engineer) agents. Required skills: Retrieval-Augmented Generation (RAG) Architecture; Vector Databases & Embeddings Storage; LLM Integration & Streaming AI Workflows.

When to use it

  • Use when building 'chat-with-your-docs' features or enterprise knowledge retrieval.
  • Use /rag-pipeline when you want that pipeline, not a freeform chat. If you only need one step, use a narrower command or a single agent.
  • Start a new chat. Do not run this command in a thread that just wrote marketing copy.

When not to use it

  • Do not run /rag-pipeline as a substitute for reading the diff. The command produces files; you still gate them.
  • Do not chain it into a 40-turn chat. Fresh context is part of the design.
  • Do not run it if you have not filled CURSOR.md. The pipeline will invent a stack.

Example workflow

  1. Implement document parser and overlapping text chunking algorithm
  2. Generate vector embeddings and store in partitioned database tables
  3. Build hybrid retrieval engine combining vector similarity and keyword search
  4. Synthesize answers with context injection and verifiable source citations

Example usage

Type this in Cursor chat: /rag-pipeline Build PDF document chunking and retrieval pipeline with citations

The command file tells the session which agents to adopt and which skills to read. You should see phase headers, not a single dump of code.

If a phase fails its gate, stop. Do not add 'just continue'.

Example output

  • Expected artifact: src/lib/rag/...
  • Expected artifact: src/app/api/rag/route.ts

Best practices

  • Keep the prompt specific. /rag-pipeline Build PDF document chunking and retrieval pipeline with citations is the shape: object, constraint, and outcome.
  • Let the listed agents work in order: ai-engineer → data-engineer.
  • Save outputs in the repo. Chat-only answers evaporate.
  • Engineering commands should leave tests or an audit note, not only implementation files.

Common mistakes

  • Typing /rag-pipeline with no object ('do the thing'). The pipeline will guess.
  • Re-running the command in the same chat after a failed gate instead of fixing the failing file.
  • Editing the command file to skip review so it 'goes faster'.
  • Skipping the Retrieval-Augmented Generation (RAG) Architecture skill that the command depends on.

Frequently asked questions

  • What does /rag-pipeline do in Cursor?
    Builds full Retrieval-Augmented Generation flows: PDF/text chunking, embedding generation, vector storage, hybrid search, and citation injection.
  • When should I run /rag-pipeline?
    Use when building 'chat-with-your-docs' features or enterprise knowledge retrieval.
  • What is an example /rag-pipeline prompt?
    /rag-pipeline Build PDF document chunking and retrieval pipeline with citations
  • Which skills does /rag-pipeline load?
    Retrieval-Augmented Generation (RAG) Architecture; Vector Databases & Embeddings Storage; LLM Integration & Streaming AI Workflows
  • Is /rag-pipeline a Cursor skill?
    No. /rag-pipeline is a slash command you type. Skills are playbooks the agent may load. Use both: the command runs the workflow, the skills constrain how it writes.

Run /rag-pipeline from your own repo

AgenticKit installs 47 slash commands, 46 agents, and 61 skills. One command installation.