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

AI-generated summary of reporting by Towards Data Science Blog. Read the original for the full story. The source provided limited text, so this summary is brief.

Why it matters

RAG engineers get a concrete pattern for structuring everything an LLM call consumes as typed inputs, though the article covers only single-document cases with corpora and tools deferred.

Read this as

This is a tutorial article about 'context engineering' for RAG, a way of building chatbots that answer questions from documents. Tobi Lütke and Andrej Karpathy popularised the term in 2025. The author proposes feeding every AI answer from four categories of typed input, all merged into one call to the language model. It covers only single documents; handling whole document collections, chat history and tool connections is left as future work. No benchmarks or code results are given.

A Towards Data Science tutorial argues that retrieval-augmented generation answers should be assembled from four types of structured, typed inputs feeding a single LLM call. The term 'context engineering' was named by Tobi Lütke and Andrej Karpathy in 2025. Relevance is instructional: teams designing document-QA systems may adopt the pattern, but the article addresses only single documents and defers corpus, conversation and tool extensions, with no cost or performance figures.

The post proposes a context-engineering pattern for RAG in which, for a single document, each retrieval 'brick' emits typed pieces that converge on one LLM call, four typed input categories behind every answer. Corpus-level retrieval, conversation state and tool extensions are explicitly follow-up work. The article provides no architecture diagram, benchmark numbers, model names or evaluation results; it is a design-approach piece attributed to the Enterprise Document Intelligence series (Vol.1 #7bis).

Read the original

This summary exists to save you time, not to replace the source.

Key terms

Towards Data Science Tobi Lütke Andrej Karpathy Enterprise Document Intelligence

Was this summary useful?

One click, anonymous. It tells us which summaries to re-run.

Related reading

An Indic Voice Agent with CUGA

It shows that a cross-lingual voice assistant can be built with open-source tooling, but the real lesson, swap in a multilingual embedding model, matters to anyone doing non-English retrieval.