{"id":728,"date":"2026-03-02T10:41:54","date_gmt":"2026-03-02T10:41:54","guid":{"rendered":"https:\/\/datascientists.info\/?p=728"},"modified":"2026-03-02T10:41:55","modified_gmt":"2026-03-02T10:41:55","slug":"part-2-the-multi-step-retriever-implementing-agentic-query-expansion","status":"publish","type":"post","link":"https:\/\/datascientists.info\/index.php\/2026\/03\/02\/part-2-the-multi-step-retriever-implementing-agentic-query-expansion\/","title":{"rendered":"Part 2: The Multi-Step Retriever \u2014 Implementing Agentic Query Expansion"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">1. Introduction: The Death of the \u201cSimple Search\u201d<\/h2>\n\n\n\n<p>In <a target=\"_blank\" rel=\"noreferrer noopener\" href=\"https:\/\/datascientists.info\/index.php\/2026\/02\/18\/building-production-grade-agentic-rag-part-1\/\">Part 1<\/a>, we defined the blueprint for a production-grade Agentic RAG system. We moved away from passive retrieval toward a \u201creasoning-first\u201d architecture. But even the best reasoning engine fails if the data fed into it is garbage.<\/p>\n\n\n\n<p>When a business user asks, \u201cWhat\u2019s our policy on remote work?\u201d, they aren\u2019t just looking for a document. They are asking a cluster of nested questions:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Definition:<\/strong> What counts as remote?<\/li>\n\n\n\n<li><strong>Eligibility:<\/strong> Does this apply to my role?<\/li>\n\n\n\n<li><strong>Process:<\/strong> How do I apply?<\/li>\n\n\n\n<li><strong>History:<\/strong> When was this last updated?<\/li>\n<\/ul>\n\n\n\n<p>Traditional RAG takes that entire query, turns it into a single vector, and prays that the semantic math lands near the right paragraph. In production, \u201cpraying\u201d isn\u2019t a strategy. This article covers <strong>Agentic Query Expansion<\/strong>\u2014the process of breaking down \u201cmessy\u201d human intent into a structured execution plan.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">2. Expansion Strategies: Beyond Vector Similarity<\/h2>\n\n\n\n<p>We use three primary strategies to ensure the retriever actually finds what the user is looking for.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2.1 Sub-Question Decomposition (The ReAct Pattern)<\/h3>\n\n\n\n<p>Instead of one broad search, the agent generates multiple precise sub-queries. This requires a <strong>Structured Output<\/strong> from your LLM to ensure the orchestrator can parse the plan.<\/p>\n\n\n\n<p><strong>User Query:<\/strong> \u201cWhat\u2019s our policy on remote work?\u201d<\/p>\n\n\n\n<p><strong>Expansion Agent Logic (Python):<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nclass SubQuery(BaseModel):\n    query: str\n    intent: Literal&#x5B;&quot;definition&quot;, &quot;eligibility&quot;, &quot;process&quot;, &quot;metadata&quot;]\n\nasync def expand_query(user_input: str) -&gt; List&#x5B;SubQuery]:\n    # Prompting the LLM to return a JSON array of SubQuery objects\n    ...\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\">2.2 Hypothetical Document Embeddings (HyDE)<\/h3>\n\n\n\n<p>Sometimes vocabulary doesn&#8217;t match. A user asks about \u201cdesk money,\u201d but the manual calls it a \u201chome office stipend.\u201d HyDE has the LLM generate a <strong>fake answer<\/strong> first. We embed that hypothetical answer to search the database. Since the LLM uses professional terminology, the vector sits closer to the actual policy than the user&#8217;s original slang.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2.3 Entity-Relationship Expansion<\/h3>\n\n\n\n<p>Many business queries pivot around entities: roles (\u201cengineers\u201d), locations (\u201cNYC\u201d), or benefits (\u201c401k\u201d).<\/p>\n\n\n\n<p>By extracting these entities, we transform keyword search into <strong>relationship-based discovery<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>Engineer<\/strong> -&gt; (part_of) -&gt; <strong>Engineering Dept<\/strong> -&gt; (applies_to) -&gt; <strong>Remote Policy<\/strong>.<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">3. Intelligent Routing: Choosing the Right Tool<\/h2>\n\n\n\n<p>Once we have sub-questions, the <strong>Router Agent<\/strong> decides where to send them. In production, every routing decision should include a <strong>fallback<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><td><strong>Question Type<\/strong><\/td><td><strong>Target Data Source<\/strong><\/td><td><strong>Reasoning<\/strong><\/td><\/tr><\/thead><tbody><tr><td>\u201cWhat is\u2026?\u201d<\/td><td><strong>Vector DB<\/strong><\/td><td>Best for semantic definitions.<\/td><\/tr><tr><td>\u201cWhen did\u2026?\u201d<\/td><td><strong>SQL \/ Metadata<\/strong><\/td><td>Dates and versions are structured.<\/td><\/tr><tr><td>\u201cWho reports to\u2026?\u201d<\/td><td><strong>Knowledge Graph<\/strong><\/td><td>Relationships are explicit, not semantic.<\/td><\/tr><tr><td>\u201cHow many\u2026?\u201d<\/td><td><strong>SQL \/ Analytic<\/strong><\/td><td>Vector search cannot count or aggregate.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><strong>The Engineering Reality:<\/strong> Use <strong>Few-Shot Prompting<\/strong> for your router. Providing 3-5 examples of &#8220;SQL vs. Vector&#8221; queries significantly reduces routing errors.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">4. The Orchestration Workflow (Parallel Execution)<\/h2>\n\n\n\n<p>The following diagram illustrates how the components interact in a parallel execution environment:<\/p>\n\n\n\n<div class=\"wp-block-merpress-mermaidjs diagram-source-mermaid\"><pre class=\"mermaid\">graph TD\n    A[User Query] --> B{Expansion Agent}\n    B -->|Decompose| C1[Sub-Q 1]\n    B -->|Decompose| C2[Sub-Q 2]\n    B -->|HyDE| C3[Sub-Q 3]\n    \n    C1 --> D{Router}\n    C2 --> D\n    C3 --> D\n    \n    D -->|Parallel| E1[(Vector DB)]\n    D -->|Parallel| E2[(SQL DB)]\n    D -->|Parallel| E3[(Knowledge Graph)]\n    \n    E1 --> F[Result Merger]\n    E2 --> F\n    E3 --> F\n    \n    F --> G[Synthesis Agent]\n    G --> H[Final Answer with Citations]<\/pre><\/div>\n\n\n\n<p><strong>Performance Note:<\/strong> Sequential execution is a latency killer. By running these searches in parallel, our total retrieval time is only as long as the slowest single database query (typically ~300ms), rather than the sum of all three (~700ms+).<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># The Agentic Parallel Pattern\nresults = await asyncio.gather(\n    vector_search(sub_q1), # ~300ms\n    sql_query(sub_q2),     # ~100ms\n    kg_traversal(sub_q3),  # ~200ms\n    return_exceptions=True\n)\n# Total Latency: ~300ms (max of the three)<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">5. The Production Stack: Hybrid Similarity Search<\/h2>\n\n\n\n<p>In Part 1, we touched on the importance of hybrid search. In production, you cannot rely on dense vectors alone\u2014they often struggle with acronyms or specific product IDs. We implement a <strong>Weighted Hybrid Search<\/strong> that combines <code>pgvector<\/code> (Dense) with PostgreSQL <code>ts_rank<\/code> (Sparse\/Full-Text).<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Implementation: The Hybrid Retriever<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nasync def hybrid_similarity_search(\n        self, query_embedding: List&#x5B;float], query_text: str, \n        limit: int = 10, dense_weight: float = 0.6, sparse_weight: float = 0.4\n) -&gt; List&#x5B;Dict&#x5B;str, Any]]:\n    &quot;&quot;&quot;Combines Dense (pgvector) and Sparse (Full-Text) search results.&quot;&quot;&quot;\n    \n    # 1. Dense Search: Semantic similarity\n    dense_query = &quot;SELECT ..., 1 - (embedding_dense &amp;lt;=&gt; %s::vector) as dense_similarity FROM documents...&quot;\n    dense_results = await self.execute_query(dense_query, (query_embedding, ...))\n\n    # 2. Sparse Search: Keyword matching via ts_rank\n    sparse_query = &quot;SELECT ..., ts_rank(content_tsv, plainto_tsquery(&#039;english&#039;, %s)) as sparse_similarity FROM documents...&quot;\n    sparse_results = await self.execute_query(sparse_query, (query_text, ...))\n\n    # 3. Weighted Merge: Reciprocal Rank Fusion or Linear Combination\n    merged = {}\n    for r in dense_results:\n        merged&#x5B;r&#x5B;&#039;id&#039;]] = {**r, &#039;hybrid_score&#039;: r&#x5B;&#039;dense_similarity&#039;] * dense_weight}\n    \n    for r in sparse_results:\n        if r&#x5B;&#039;id&#039;] in merged:\n            merged&#x5B;r&#x5B;&#039;id&#039;]]&#x5B;&#039;hybrid_score&#039;] += r&#x5B;&#039;sparse_similarity&#039;] * sparse_weight\n        else:\n            merged&#x5B;r&#x5B;&#039;id&#039;]] = {**r, &#039;hybrid_score&#039;: r&#x5B;&#039;sparse_similarity&#039;] * sparse_weight}\n\n    return sorted(merged.values(), key=lambda x: x&#x5B;&#039;hybrid_score&#039;], reverse=True)&#x5B;:limit]\n<\/pre><\/div>\n\n\n<p>By weighting these results (e.g., 60% Vector, 40% Keyword), the system becomes robust against both &#8220;vocabulary mismatch&#8221; (solved by vectors) and &#8220;exact term requirements&#8221; (solved by full-text).<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">6. Enrichment: Making Data \u201cSearchable\u201d<\/h2>\n\n\n\n<p>High-quality retrieval doesn&#8217;t happen at query time; it starts at <strong>Ingestion<\/strong>. As we established in <a href=\"https:\/\/blog.data-do.de\/index.php\/2026\/02\/18\/building-production-grade-agentic-rag-part-1\/\" target=\"_blank\" rel=\"noreferrer noopener\">Part 1<\/a> when discussing <strong>Multi-Vector Indexing<\/strong>, we don\u2019t just &#8220;chunk and embed.&#8221; We enrich each document segment with high-fidelity metadata that our agents can later reason over.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Summaries (Linked to Synthesis):<\/strong> We generate 50-token summaries for every chunk. As we discussed in our architecture overview, this allows the <strong>Synthesis Agent<\/strong> to &#8220;skim&#8221; the context of 20 documents to decide which 5 to read in depth. This turns a massive context window into a targeted one, making final response generation up to 5x faster.<\/li>\n\n\n\n<li><strong>Semantic Roles (The Router&#8217;s Map):<\/strong> By tagging a chunk as a <em>&#8220;Policy Definition,&#8221;<\/em> <em>&#8220;Procedure,&#8221;<\/em> or <em>&#8220;Exception,&#8221;<\/em> we give the <strong>Router<\/strong> (introduced in Section 3) a map. If a user asks &#8220;How do I&#8230;?&#8221;, the system prioritizes chunks with a &#8220;Procedure&#8221; role.<\/li>\n\n\n\n<li><strong>Entity Extraction (Powering Hybrid Search):<\/strong> This is where the <strong>Hybrid Similarity Search<\/strong> from Section 5 gets its power. By extracting roles, locations, and dates upfront during the ingestion phase we designed in Part 1, we enable the precise SQL filtering (<code>WHERE metadata-&gt;&gt;'role' = 'Engineer'<\/code>) that makes the system deterministic where vector search is merely probabilistic.<\/li>\n<\/ul>\n\n\n\n<p><strong>The Production Impact:<\/strong> Enrichment is the bridge between the raw data storage we built in the first article and the agentic reasoning we are implementing now. It adds a few seconds to your ingestion pipeline, but it saves several seconds of &#8220;LLM thinking time&#8221; for every single user query.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">7. Conclusion: Retrieval is a Reasoning Task<\/h2>\n\n\n\n<p>In the \u201cnaive RAG\u201d era, retrieval was a math problem. In the <strong>Agentic RAG<\/strong> era, retrieval is a reasoning problem. By breaking queries down and routing them intelligently, we create a system that understands intent rather than just matching keywords.<\/p>\n\n\n\n<p><strong>In Part 3, we will dive into the \u2018Precision Filter\u2019: How to use Cross-Encoders and Reranking to eliminate retrieval noise and ensure only the most relevant context reaches the LLM.<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Implementation: Let\u2019s Bridge Your RAG Gap<\/h2>\n\n\n\n<p>Building a prototype is easy; hardening a production-grade RAG system that handles 1M+ complex PDFs without &#8220;silent failures&#8221; is a multi-month engineering lift.<\/p>\n\n\n\n<p>The <strong>Agentic RAG Blueprint<\/strong> described in this series isn&#8217;t just a conceptual framework\u2014it is a proprietary, production-ready codebase developed to solve the most stubborn data extraction and retrieval challenges in regulated industries.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Why Partner With Us?<\/h3>\n\n\n\n<p>We don&#8217;t start from scratch. We deploy our audited reference architecture directly into your infrastructure, customized for your specific document types:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Accelerated Deployment:<\/strong> Skip 6+ months of R&amp;D with our pre-built Docling, Pydantic AI, and Langfuse integrations.<\/li>\n\n\n\n<li><strong>Total Data Sovereignty:<\/strong> Our &#8220;Local-First&#8221; Docker stack ensures your sensitive data never leaves your firewall.<\/li>\n\n\n\n<li><strong>Guaranteed Precision:<\/strong> We move beyond naive similarity search to hybrid, agent-enriched retrieval that matches human-level accuracy.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Schedule a Technical Strategy Session<\/h3>\n\n\n\n<p>If your current RAG implementation is struggling with complex layouts, losing context in chunks, or failing to scale on-premise, let\u2019s talk.<\/p>\n\n\n\n<p>We will walk you through a live demonstration of the blueprint using your own document samples and discuss how to integrate this architecture into your existing stack.<\/p>\n\n\n\n<p><strong>Book a RAG Strategy Consultation<\/strong><\/p>\n\n\n\n<div class=\"wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button is-style-outline is-style-outline--1\"><a class=\"wp-block-button__link wp-element-button\" href=\"https:\/\/data-do.de\/#contact\">Book a RAG Strategy Consultation<\/a><\/div>\n<\/div>\n\n\n\n<p><em>Direct access to our lead architects. No sales fluff, just engineering.<\/em><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. Introduction: The Death of the \u201cSimple Search\u201d In Part 1, we defined the blueprint for a production-grade Agentic RAG system. We moved away from passive retrieval toward a \u201creasoning-first\u201d architecture. But even the best reasoning engine fails if the data fed into it is garbage. When a business user asks, \u201cWhat\u2019s our policy on [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[137],"tags":[136,148,138],"ppma_author":[144,145],"class_list":["post-728","post","type-post","status-publish","format-standard","hentry","category-generative-ai","tag-genai","tag-llm","tag-rag","author-marc","author-saidah"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Part 2: The Multi-Step Retriever \u2014 Implementing Agentic Query Expansion - DATA DO - \u30c7\u30fc\u30bf \u9053<\/title>\n<meta name=\"description\" content=\"Stop basic vector search. Implement Agentic Query Expansion with decomposition, HyDE &amp; parallel retrieval to handle complex enterprise RAG queries at scale\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/datascientists.info\/index.php\/2026\/03\/02\/part-2-the-multi-step-retriever-implementing-agentic-query-expansion\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Part 2: The Multi-Step Retriever \u2014 Implementing Agentic Query Expansion - DATA DO - \u30c7\u30fc\u30bf \u9053\" \/>\n<meta property=\"og:description\" content=\"Stop basic vector search. Implement Agentic Query Expansion with decomposition, HyDE &amp; parallel retrieval to handle complex enterprise RAG queries at scale\" \/>\n<meta property=\"og:url\" content=\"https:\/\/datascientists.info\/index.php\/2026\/03\/02\/part-2-the-multi-step-retriever-implementing-agentic-query-expansion\/\" \/>\n<meta property=\"og:site_name\" content=\"DATA DO - \u30c7\u30fc\u30bf \u9053\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataScientists\/\" \/>\n<meta property=\"article:published_time\" content=\"2026-03-02T10:41:54+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-03-02T10:41:55+00:00\" \/>\n<meta name=\"author\" content=\"Marc Matt, Saidah Kafka\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Marc Matt\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/datascientists.info\\\/index.php\\\/2026\\\/03\\\/02\\\/part-2-the-multi-step-retriever-implementing-agentic-query-expansion\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/datascientists.info\\\/index.php\\\/2026\\\/03\\\/02\\\/part-2-the-multi-step-retriever-implementing-agentic-query-expansion\\\/\"},\"author\":{\"name\":\"Marc Matt\",\"@id\":\"https:\\\/\\\/datascientists.info\\\/#\\\/schema\\\/person\\\/723078870bf3135121086d46ebb12f19\"},\"headline\":\"Part 2: The Multi-Step Retriever \u2014 Implementing Agentic Query Expansion\",\"datePublished\":\"2026-03-02T10:41:54+00:00\",\"dateModified\":\"2026-03-02T10:41:55+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/datascientists.info\\\/index.php\\\/2026\\\/03\\\/02\\\/part-2-the-multi-step-retriever-implementing-agentic-query-expansion\\\/\"},\"wordCount\":1059,\"publisher\":{\"@id\":\"https:\\\/\\\/datascientists.info\\\/#organization\"},\"keywords\":[\"GenAI\",\"LLM\",\"RAG\"],\"articleSection\":[\"Generative AI\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/datascientists.info\\\/index.php\\\/2026\\\/03\\\/02\\\/part-2-the-multi-step-retriever-implementing-agentic-query-expansion\\\/\",\"url\":\"https:\\\/\\\/datascientists.info\\\/index.php\\\/2026\\\/03\\\/02\\\/part-2-the-multi-step-retriever-implementing-agentic-query-expansion\\\/\",\"name\":\"Part 2: The Multi-Step Retriever \u2014 Implementing Agentic Query Expansion - DATA DO - \u30c7\u30fc\u30bf \u9053\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/datascientists.info\\\/#website\"},\"datePublished\":\"2026-03-02T10:41:54+00:00\",\"dateModified\":\"2026-03-02T10:41:55+00:00\",\"description\":\"Stop basic vector search. Implement Agentic Query Expansion with decomposition, HyDE & parallel retrieval to handle complex enterprise RAG queries at scale\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/datascientists.info\\\/index.php\\\/2026\\\/03\\\/02\\\/part-2-the-multi-step-retriever-implementing-agentic-query-expansion\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/datascientists.info\\\/index.php\\\/2026\\\/03\\\/02\\\/part-2-the-multi-step-retriever-implementing-agentic-query-expansion\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/datascientists.info\\\/index.php\\\/2026\\\/03\\\/02\\\/part-2-the-multi-step-retriever-implementing-agentic-query-expansion\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/datascientists.info\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Part 2: The Multi-Step Retriever \u2014 Implementing Agentic Query Expansion\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/datascientists.info\\\/#website\",\"url\":\"https:\\\/\\\/datascientists.info\\\/\",\"name\":\"Data Scientists\",\"description\":\"Digging data, Big Data, Analysis, Data Mining\",\"publisher\":{\"@id\":\"https:\\\/\\\/datascientists.info\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/datascientists.info\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/datascientists.info\\\/#organization\",\"name\":\"DATA DO - \u30c7\u30fc\u30bf \u9053\",\"url\":\"https:\\\/\\\/datascientists.info\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/datascientists.info\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/datascientists.info\\\/wp-content\\\/uploads\\\/2026\\\/02\\\/Bildschirmfoto-vom-2026-02-02-08-13-21.png\",\"contentUrl\":\"https:\\\/\\\/datascientists.info\\\/wp-content\\\/uploads\\\/2026\\\/02\\\/Bildschirmfoto-vom-2026-02-02-08-13-21.png\",\"width\":250,\"height\":174,\"caption\":\"DATA DO - \u30c7\u30fc\u30bf \u9053\"},\"image\":{\"@id\":\"https:\\\/\\\/datascientists.info\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/DataScientists\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/datascientists.info\\\/#\\\/schema\\\/person\\\/723078870bf3135121086d46ebb12f19\",\"name\":\"Marc Matt\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/74f48ef754cf04f628f42ed117a3f2b42931feeb41a3cca2313b9714a7d4fdd2?s=96&d=mm&r=g53b84b5f47a2156ba8b047d71d6d05fc\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/74f48ef754cf04f628f42ed117a3f2b42931feeb41a3cca2313b9714a7d4fdd2?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/74f48ef754cf04f628f42ed117a3f2b42931feeb41a3cca2313b9714a7d4fdd2?s=96&d=mm&r=g\",\"caption\":\"Marc Matt\"},\"description\":\"Senior Data Architect with 15+ years of experience helping Hamburg's leading enterprises modernize their data infrastructure. I bridge the gap between legacy systems (SAP, Hadoop) and modern AI capabilities. I help clients: Migrate &amp; Modernize: Transitioning on-premise data warehouses to Google Cloud\\\/AWS to reduce costs and increase agility. Implement GenAI: Building secure RAG (Retrieval-Augmented Generation) pipelines to unlock value from internal knowledge bases using LangChain and Vector DBs. Scale MLOps: Operationalizing machine learning models from PoC to production with Kubernetes and Airflow. Proven track record leading engineering teams.\",\"sameAs\":[\"https:\\\/\\\/data-do.de\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Part 2: The Multi-Step Retriever \u2014 Implementing Agentic Query Expansion - DATA DO - \u30c7\u30fc\u30bf \u9053","description":"Stop basic vector search. Implement Agentic Query Expansion with decomposition, HyDE & parallel retrieval to handle complex enterprise RAG queries at scale","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/datascientists.info\/index.php\/2026\/03\/02\/part-2-the-multi-step-retriever-implementing-agentic-query-expansion\/","og_locale":"en_US","og_type":"article","og_title":"Part 2: The Multi-Step Retriever \u2014 Implementing Agentic Query Expansion - DATA DO - \u30c7\u30fc\u30bf \u9053","og_description":"Stop basic vector search. Implement Agentic Query Expansion with decomposition, HyDE & parallel retrieval to handle complex enterprise RAG queries at scale","og_url":"https:\/\/datascientists.info\/index.php\/2026\/03\/02\/part-2-the-multi-step-retriever-implementing-agentic-query-expansion\/","og_site_name":"DATA DO - \u30c7\u30fc\u30bf \u9053","article_publisher":"https:\/\/www.facebook.com\/DataScientists\/","article_published_time":"2026-03-02T10:41:54+00:00","article_modified_time":"2026-03-02T10:41:55+00:00","author":"Marc Matt, Saidah Kafka","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Marc Matt","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/datascientists.info\/index.php\/2026\/03\/02\/part-2-the-multi-step-retriever-implementing-agentic-query-expansion\/#article","isPartOf":{"@id":"https:\/\/datascientists.info\/index.php\/2026\/03\/02\/part-2-the-multi-step-retriever-implementing-agentic-query-expansion\/"},"author":{"name":"Marc Matt","@id":"https:\/\/datascientists.info\/#\/schema\/person\/723078870bf3135121086d46ebb12f19"},"headline":"Part 2: The Multi-Step Retriever \u2014 Implementing Agentic Query Expansion","datePublished":"2026-03-02T10:41:54+00:00","dateModified":"2026-03-02T10:41:55+00:00","mainEntityOfPage":{"@id":"https:\/\/datascientists.info\/index.php\/2026\/03\/02\/part-2-the-multi-step-retriever-implementing-agentic-query-expansion\/"},"wordCount":1059,"publisher":{"@id":"https:\/\/datascientists.info\/#organization"},"keywords":["GenAI","LLM","RAG"],"articleSection":["Generative AI"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/datascientists.info\/index.php\/2026\/03\/02\/part-2-the-multi-step-retriever-implementing-agentic-query-expansion\/","url":"https:\/\/datascientists.info\/index.php\/2026\/03\/02\/part-2-the-multi-step-retriever-implementing-agentic-query-expansion\/","name":"Part 2: The Multi-Step Retriever \u2014 Implementing Agentic Query Expansion - DATA DO - \u30c7\u30fc\u30bf \u9053","isPartOf":{"@id":"https:\/\/datascientists.info\/#website"},"datePublished":"2026-03-02T10:41:54+00:00","dateModified":"2026-03-02T10:41:55+00:00","description":"Stop basic vector search. Implement Agentic Query Expansion with decomposition, HyDE & parallel retrieval to handle complex enterprise RAG queries at scale","breadcrumb":{"@id":"https:\/\/datascientists.info\/index.php\/2026\/03\/02\/part-2-the-multi-step-retriever-implementing-agentic-query-expansion\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/datascientists.info\/index.php\/2026\/03\/02\/part-2-the-multi-step-retriever-implementing-agentic-query-expansion\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/datascientists.info\/index.php\/2026\/03\/02\/part-2-the-multi-step-retriever-implementing-agentic-query-expansion\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/datascientists.info\/"},{"@type":"ListItem","position":2,"name":"Part 2: The Multi-Step Retriever \u2014 Implementing Agentic Query Expansion"}]},{"@type":"WebSite","@id":"https:\/\/datascientists.info\/#website","url":"https:\/\/datascientists.info\/","name":"Data Scientists","description":"Digging data, Big Data, Analysis, Data Mining","publisher":{"@id":"https:\/\/datascientists.info\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/datascientists.info\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/datascientists.info\/#organization","name":"DATA DO - \u30c7\u30fc\u30bf \u9053","url":"https:\/\/datascientists.info\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/datascientists.info\/#\/schema\/logo\/image\/","url":"https:\/\/datascientists.info\/wp-content\/uploads\/2026\/02\/Bildschirmfoto-vom-2026-02-02-08-13-21.png","contentUrl":"https:\/\/datascientists.info\/wp-content\/uploads\/2026\/02\/Bildschirmfoto-vom-2026-02-02-08-13-21.png","width":250,"height":174,"caption":"DATA DO - \u30c7\u30fc\u30bf \u9053"},"image":{"@id":"https:\/\/datascientists.info\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataScientists\/"]},{"@type":"Person","@id":"https:\/\/datascientists.info\/#\/schema\/person\/723078870bf3135121086d46ebb12f19","name":"Marc Matt","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/74f48ef754cf04f628f42ed117a3f2b42931feeb41a3cca2313b9714a7d4fdd2?s=96&d=mm&r=g53b84b5f47a2156ba8b047d71d6d05fc","url":"https:\/\/secure.gravatar.com\/avatar\/74f48ef754cf04f628f42ed117a3f2b42931feeb41a3cca2313b9714a7d4fdd2?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/74f48ef754cf04f628f42ed117a3f2b42931feeb41a3cca2313b9714a7d4fdd2?s=96&d=mm&r=g","caption":"Marc Matt"},"description":"Senior Data Architect with 15+ years of experience helping Hamburg's leading enterprises modernize their data infrastructure. I bridge the gap between legacy systems (SAP, Hadoop) and modern AI capabilities. I help clients: Migrate &amp; Modernize: Transitioning on-premise data warehouses to Google Cloud\/AWS to reduce costs and increase agility. Implement GenAI: Building secure RAG (Retrieval-Augmented Generation) pipelines to unlock value from internal knowledge bases using LangChain and Vector DBs. Scale MLOps: Operationalizing machine learning models from PoC to production with Kubernetes and Airflow. Proven track record leading engineering teams.","sameAs":["https:\/\/data-do.de"]}]}},"authors":[{"term_id":144,"user_id":1,"is_guest":0,"slug":"marc","display_name":"Marc Matt","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/74f48ef754cf04f628f42ed117a3f2b42931feeb41a3cca2313b9714a7d4fdd2?s=96&d=mm&r=g","0":null,"1":"","2":"","3":"","4":"","5":"","6":"","7":"","8":""},{"term_id":145,"user_id":2,"is_guest":0,"slug":"saidah","display_name":"Saidah Kafka","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/015737c94dd80772d772f2b24a55e96c868068f28684c8577d9492f3313e4dd3?s=96&d=mm&r=g","0":null,"1":"","2":"","3":"","4":"","5":"","6":"","7":"","8":""}],"_links":{"self":[{"href":"https:\/\/datascientists.info\/index.php\/wp-json\/wp\/v2\/posts\/728","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/datascientists.info\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/datascientists.info\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/datascientists.info\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/datascientists.info\/index.php\/wp-json\/wp\/v2\/comments?post=728"}],"version-history":[{"count":5,"href":"https:\/\/datascientists.info\/index.php\/wp-json\/wp\/v2\/posts\/728\/revisions"}],"predecessor-version":[{"id":734,"href":"https:\/\/datascientists.info\/index.php\/wp-json\/wp\/v2\/posts\/728\/revisions\/734"}],"wp:attachment":[{"href":"https:\/\/datascientists.info\/index.php\/wp-json\/wp\/v2\/media?parent=728"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/datascientists.info\/index.php\/wp-json\/wp\/v2\/categories?post=728"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/datascientists.info\/index.php\/wp-json\/wp\/v2\/tags?post=728"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/datascientists.info\/index.php\/wp-json\/wp\/v2\/ppma_author?post=728"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}