rag-architecture

Design retrieval-augmented generation systems with vector databases, chunking, and hybrid search.

1|Updated Mar 21, 2026
One-click install
npx skills add https://github.com/kalilurrahman/kr-claudiator-skills-original-prompts --skill rag-architecture-kalilurrahman
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rag-architecture
Source: https://github.com/kalilurrahman/kr-claudiator-skills-original-prompts/tree/main/04-ai-ml/rag-architecture
Command: npx skills add https://github.com/kalilurrahman/kr-claudiator-skills-original-prompts --skill rag-architecture-kalilurrahman

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires openai, pinecone, langchain, sentence-transformers, rank-bm25.

What problem does it solve? Building question-answering systems over private documents requires combining vector search, embeddings, and LLM generation correctly, and mistakes in chunking or retrieval lead to hallucinated or irrelevant answers. ## Core Features & Use Cases - End-to-End RAG Pipeline: Covers document chunking, embedding generation, vector storage in Pinecone, retrieval, reranking, and prompt construction. - Hybrid Search & Reranking: Combines dense semantic search with BM25 keyword search and cross-encoder reranking for higher precision. - Evaluation & Optimization: Includes retrieval metrics (precision@k, recall@k), answer similarity scoring, caching, and metadata filtering. - Use Case: Build a customer support chatbot that answers questions grounded in your refund policy and shipping guide PDFs, with source attribution for every answer. ## Quick Start Ask the AI to design a RAG architecture for your document corpus, specifying your vector database, embedding model, and latency requirements.

Frequently Asked Questions about rag-architecture

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build a RAG pipeline with Pinecone and OpenAI embeddings?

Chunk documents into 512-token segments with overlap, embed them with text-embedding-3-small, and upsert vectors into a Pinecone index. At query time, embed the query, retrieve top-k chunks, inject them into the prompt, and generate the answer with GPT-4.

What chunk size should I use for RAG document splitting?

Use 200-1000 tokens per chunk with 10-20% overlap between chunks. Chunks that are too small lose context, while chunks that are too large dilute retrieval relevance. Recursive character splitting on natural boundaries works well.

Hybrid search vs semantic search for RAG retrieval?

Hybrid search combines dense vector similarity with BM25 keyword matching, which helps for keyword-heavy queries like form numbers or exact terms. Pure semantic search works better for conceptual questions; weight the two with an alpha parameter.

Does reranking improve RAG retrieval accuracy?

Yes. Retrieve 2-3x your target top_k with semantic search, then rerank with a cross-encoder model like ms-marco-MiniLM to reorder by true relevance. This improves precision without significant latency cost.

Why does my RAG system hallucinate answers?

Hallucination usually comes from poor retrieval or missing instructions. Instruct the LLM to answer only from provided context and say it lacks information when context is insufficient, and monitor precision@k to catch retrieval failures.