AI news story

Context Engineering for RAG : The Four Typed Inputs Behind Every RAG Answer

Enterprise Document Intelligence [Vol.1 #7bis] - Tobi Lütke and Andrej Karpathy named the practice in 2025. For a s…

  • LLMs
  • Source: Towards Data Science
  • Published: 2026-06-30

Editor's take

The emergence of "context engineering" for Retrieval Augmented Generation (RAG) systems, as articulated by Tobi Lütke and Andrej Karpathy, signifies a move towards more structured and predictable LLM outputs. Instead of a monolithic prompt, RAG systems are now being dissected into distinct, typed input components that are strategically assembled before a single LLM invocation.

This approach matters because it addresses a critical bottleneck in enterprise AI adoption: the reliability and interpretability of LLM-generated answers. By formalizing the data sources (corpus), conversational history, and tool integrations into typed inputs, developers can gain finer control over the LLM's reasoning process, reducing hallucinations and improving the accuracy of information retrieval from vast document sets. This structured method is essential for scaling RAG beyond simple Q&A to complex knowledge work.

Future developments will likely focus on the automated generation and management of these typed inputs. The ability to dynamically infer and assign types to disparate data sources, and to optimize their combination for specific LLM tasks, will be key. Furthermore, observing how different LLM architectures, such as those from OpenAI (GPT-4) or Anthropic (Claude 3), adapt to or are optimized for this context engineering paradigm will reveal its true impact on RAG performance.