Loading patterns…
Knowledge Retrieval (RAG)
Information retrieval and augmented generation patterns
In 30 seconds
- What
- Retrieves relevant information from external sources, then feeds it into a language model to generate grounded responses with current or specialized knowledge.
- When to use
- Applications needing current information, domain-specific knowledge bases, or factual accuracy with source attribution across large document collections.
- Watch out
- Poor retrieval quality returns irrelevant information, degrading response quality regardless of how well the model generates text.
Ask the AI expert about these patterns
Opens the assistant with your question prefilled. You review it before sending.
Overview
Knowledge retrieval patterns, particularly Retrieval-Augmented Generation (RAG), enhance AI systems by combining pre-trained knowledge with dynamically retrieved information from external sources. This comprehensive collection includes cutting-edge RAG variants from the latest research: Graph RAG for relationship-aware retrieval, Self-RAG for quality control, Corrective RAG for error correction, Adaptive RAG for dynamic optimization, and Multimodal RAG for cross-modal integration. These patterns enable AI systems to access current information, domain-specific knowledge bases, and contextually relevant data with unprecedented sophistication and reliability.
Practical Applications & Use Cases
Advanced Document Analysis
Multi-level hierarchical retrieval from complex documents, legal texts, and technical manuals with granular precision.
Fact-Checking & Verification
Chain-of-verification processes for news validation, research verification, and misinformation detection with confidence scoring.
Knowledge Graph Exploration
Graph-based retrieval for discovering relationships, multi-hop reasoning, and entity-centric analysis in scientific and business domains.
Conversational Knowledge Assistance
Context-aware dialogue systems that maintain conversation history and build progressive understanding.
Quality-Controlled Research
Self-reflective and corrective RAG systems that automatically assess and improve retrieval quality for critical applications.
Multimodal Information Integration
Cross-modal retrieval combining text, images, audio, and structured data for comprehensive analysis.
Adaptive Domain Expertise
Dynamic systems that adjust retrieval strategies based on query complexity, domain requirements, and performance constraints.
Enterprise Knowledge Management
Modular, customizable RAG architectures for different departments with role-based access and specialized generation.
Why This Matters
Knowledge retrieval patterns represent the cutting edge of AI-human knowledge integration, enabling systems that not only access information beyond training data but do so with unprecedented intelligence and quality control. Advanced RAG variants like Graph RAG unlock relationship-aware reasoning, Self-RAG provides automatic quality assurance, and Multimodal RAG enables comprehensive understanding across data types. These patterns transform AI from simple knowledge lookup systems into sophisticated research assistants capable of fact-checking, cross-referencing, and adaptive learning.
Implementation Guide
When to Use
- Applications requiring access to current, dynamic, or frequently changing information
- Domain-specific applications with specialized knowledge bases
- Systems where factual accuracy and source attribution are critical
- Applications dealing with large document collections or databases
- Scenarios where training data alone is insufficient for comprehensive responses
- Applications requiring transparency about information sources and evidence
Best Practices
- Design effective indexing and search strategies for fast and relevant retrieval
- Implement proper chunking and preprocessing of knowledge sources
- Use hybrid search approaches combining semantic similarity and keyword matching
- Design retrieval systems with appropriate filtering and ranking mechanisms
- Implement source attribution and citation capabilities for transparency
- Use retrieval quality metrics to optimize search and ranking performance
- Design systems that can handle both structured and unstructured knowledge sources
Common Pitfalls
- Poor retrieval quality leading to irrelevant or low-quality information being used in responses
- Insufficient processing of retrieved information causing context misunderstanding
- Over-reliance on retrieval without proper integration with generative capabilities
- Not implementing proper source verification and quality control for retrieved information
- Ignoring retrieval latency impact on overall system performance
- Inadequate handling of cases where relevant information cannot be retrieved
Available Techniques
Naive RAG(NRAG)
Foundational "Retrieve-Read" framework following traditional indexing, retrieval, and generation process
Advanced RAG(ARAG)
Enhanced RAG with pre-retrieval and post-retrieval optimizations including query expansion, reranking, and context curation
Modular RAG(MRAG)
Flexible RAG architecture with interchangeable modules supporting iterative, adaptive, and non-sequential retrieval patterns
Self-RAG(SRAG)
Self-reflective RAG that adaptively determines retrieval necessity and evaluates retrieval quality through reflection tokens
Corrective RAG (CRAG)(CRAG)
RAG system that automatically detects and corrects poor retrieval results through quality assessment and re-retrieval
Graph RAG(GRAG)
Knowledge graph-enhanced RAG using entity relationships and community detection for global sensemaking queries
Multimodal RAG(MMRAG)
Retrieval-augmented generation that handles and integrates text, images, audio, video, and structured data sources
Agentic RAG(AgRAG)
Autonomous retrieval-augmented generation systems with self-directed planning, retrieval, and reasoning capabilities
Latent Knowledge Retrieval(LKR)
Retrieve information based on abstract reasoning patterns rather than explicit queries in multi-agent agentic AI systems
Query Transformation Retrieval(QTR)
Rewrite or expand the user query before retrieval so embeddings land near relevant documents. HyDE generates a hypothetical answer document and embeds that to find real neighbors, multi-query expansion issues several reformulations and fuses the results, and step-back prompting abstracts the question to retrieve underlying principles first. These transformations give large zero-shot retrieval gains without training the retriever.
Hierarchical Index Retrieval (RAPTOR)(HIR)
Build the retrieval index as a multi-level tree instead of a flat list of chunks. RAPTOR recursively embeds, clusters, and summarizes chunks so a query can retrieve from any abstraction level, returning big-picture synthesis or leaf detail as needed. Anthropic contextual retrieval prepends an LLM-written context blurb to each chunk before embedding so isolated chunks stay grounded in the whole document.
Deep Research Agent(DRA)
A composite long-horizon research architecture that clarifies the user's intent, drafts an explicit research plan, then runs an iterative search, read, and evaluate-gaps loop across many sources (often via parallel subagents) before synthesizing a single long-form report with inline citation attribution. This is the assembled archetype behind OpenAI Deep Research, Gemini Deep Research, and Anthropic Research, with its own survey literature. Distinct from `agentic-rag-systems`, which applies retrieval decisioning inside a single pipeline rather than running a multi-round, plan-driven report synthesis. Distinct from `supervisor-worker-pattern`, which is generic orchestration with no research-specific plan, gap-check, or citation pass.
Structure-Aware Codebase Retrieval (Repo Map)
Retrieval specialized for code that exploits program structure instead of (or alongside) embeddings. The repo is parsed into ASTs and a symbol and dependency graph with tree-sitter; files and symbols are ranked by graph centrality (Aider's PageRank-weighted tag map), graph-traversal tools walk call, definition, and import edges (AutoCodeRover and code-graph agents), and spectrum-based fault localization can narrow the search from failing tests. This lets a coding agent assemble a minimal, relevant context from a repository far larger than its context window. Distinct from `graph-rag`, whose graph is built from document entities rather than from code semantics.
Patterns Pack
Take the whole catalog with you: MCP server, editor rules and skills, and data.
The Agent Architect
One pattern, one tradeoff, one production failure story. A short weekly briefing for people building agentic systems.
Weekly email, one-click unsubscribe. We only use your address to send the briefing.
From the engineer behind this catalog
Get your agent architecture reviewed
This page documents one pattern. Your system runs dozens, and most failures live in how they fit together. Have the whole design reviewed against the 288 patterns in this catalog: architecture, reliability, evaluation and cost, every finding mapped to the pattern that fixes it.
€750 instead of €1,500, one week, written report and walkthrough call, until 30 September