Implement RAG Systems
8-phase RAG implementation workflow - embedding selection, vector DB setup, chunking, hybrid retrieval, and LLM integration.
Why it matters
Build robust Retrieval-Augmented Generation (RAG) systems for knowledge-grounded AI applications, semantic search, and document Q&A.
Outcomes
What it gets done
Select optimal embedding models and vector databases.
Implement effective chunking strategies and retrieval optimization.
Integrate LLMs with context injection and citation handling.
Evaluate RAG system performance and iterate for improvements.
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/ag-rag-implementation | bash Overview
RAG Implementation Workflow
An 8-phase RAG implementation workflow covering embedding selection, vector database setup, chunking, hybrid retrieval, LLM integration, caching, and evaluation with named sub-skills for each phase. Use when building a RAG-powered application or semantic search system from scratch, not for general AI/ML or agent work without a retrieval component.
What it does
An 8-phase RAG (Retrieval-Augmented Generation) implementation workflow, each phase paired with named sub-skills. Phase 1 (Requirements Analysis) invokes ai-product and rag-engineer to define the use case, data sources, accuracy requirements, latency targets, and evaluation metrics. Phase 2 (Embedding Selection) invokes embedding-strategies to evaluate embedding models for domain relevance, quality, and cost or latency before selecting one. Phase 3 (Vector Database Setup) invokes vector-database-engineer and similarity-search-patterns to choose a vector database, design its schema, configure indexes, and test queries. Phase 4 (Chunking Strategy) invokes rag-engineer to choose a chunk size, implement chunking with overlap handling, attach metadata, and test retrieval quality. Phase 5 (Retrieval Implementation) invokes similarity-search-patterns and hybrid-search-implementation to implement vector search, add keyword search, configure hybrid search, set up reranking, and optimize latency. Phase 6 (LLM Integration) invokes llm-application-dev-ai-assistant and llm-application-dev-prompt-optimize to select an LLM provider, design a prompt template, inject retrieved context, add citation handling, and test generation quality. Phase 7 (Caching) invokes prompt-caching and rag-engineer to cache responses and embeddings, configure TTL, add cache invalidation, and monitor hit rates. Phase 8 (Evaluation) invokes llm-evaluation and evaluation to define metrics, build a test dataset, measure retrieval accuracy and generation quality, and iterate. The overall architecture is summarized as a single pipeline: a user query flows through an embedding model to vector search against a vector DB, retrieving chunks from a chunk store, which are combined with the prompt and context into the LLM to produce a response. A six-item quality gate checks that the embedding model is selected, the vector DB is configured, chunking is implemented, retrieval works, the LLM is integrated, and evaluation is passing.
When to use - and when NOT to
Use when building a RAG-powered application, implementing semantic search, creating knowledge-grounded AI, setting up a document Q&A system, or optimizing retrieval quality end to end. Not for general AI/ML development without a retrieval component, which routes to the sibling ai-ml bundle, broader agent-building work beyond RAG, which is ai-agent-development, or standalone vector-database work with no LLM generation step, which is database.
Inputs and outputs
Input is the target use case, data sources, and accuracy and latency requirements. Output across the eight phases is a selected embedding model, a configured vector database with schema and indexes, a chunking implementation with overlap and metadata, a hybrid retrieval pipeline with reranking, an LLM integration with prompt templates and citation handling, a caching layer, and an evaluation report on retrieval accuracy and generation quality.
User Query -> Embedding -> Vector Search -> Retrieved Docs -> LLM -> Response
| | | |
Model Vector DB Chunk Store Prompt + Context
Integrations
Orchestrates named sub-skills ai-product, rag-engineer, embedding-strategies, vector-database-engineer, similarity-search-patterns, hybrid-search-implementation, llm-application-dev-ai-assistant, llm-application-dev-prompt-optimize, prompt-caching, and llm-evaluation.
Who it's for
AI and ML engineers building a RAG system from scratch who want a phased sequence - requirements, embeddings, vector DB, chunking, retrieval, LLM integration, caching, evaluation - rather than assembling a RAG pipeline ad hoc.
FAQ
Common questions
Discussion
Questions & comments ยท 0
Sign In Sign in to leave a comment.