explaingit

davidkimai/context-engineering

8,931PythonAudience · developerComplexity · 1/5Setup · easy

TLDR

Context Engineering is a progressive course and handbook teaching developers how to deliberately design what an AI model sees, prompts, memory, retrieved documents, and multi-step flows, for reliably better results.

Mindmap

mindmap
  root((repo))
    Core Concept
      Beyond prompts
      Full context window
      Deliberate design
    Course Stages
      Basic prompts
      Few-shot examples
      Memory systems
      Multi-agent flows
    Use Cases
      RAG systems
      AI agent design
      Research reference
    Audience
      AI developers
      LLM builders
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Learn how to structure context windows for multi-step AI workflows, from basic prompts to multi-agent coordination.

USE CASE 2

Design a retrieval-augmented system that pulls relevant documents into an AI prompt before querying it.

USE CASE 3

Build principled context management for an AI agent that maintains memory across multiple sessions.

USE CASE 4

Study research literature on how context affects language model performance, with links to 1400+ papers.

Tech stack

Python

Getting it running

Difficulty · easy Time to first run · 5min

In plain English

Context Engineering is a learning resource, not a runnable software tool. It is a handbook and in-progress course for people who work with AI language models and want to go deeper than writing better prompts. The central idea, quoted from AI researcher Andrej Karpathy, is that "context engineering is the delicate art and science of filling the context window with just the right information for the next step." The difference between prompt engineering and context engineering, as framed here, is scope. A prompt is what you type to the model. Context is everything the model sees: your instructions, example conversations, retrieved documents, memory from earlier sessions, tool outputs, and the flow between steps in a multi-step task. Context engineering is the practice of designing and managing all of that deliberately, not just writing a better sentence. The repository is organized as a progressive course with four stages. The first stage covers the basic building blocks: single prompts, few-shot examples (showing the model a handful of examples before asking it to do something), memory, and multi-step flows. Later stages get into more technical territory, including how to set up systems that retrieve relevant documents before querying a model, how to coordinate multiple AI agents working in parallel, and what the research literature says about how context affects model performance. The course structure uses a biological metaphor, moving from atoms to cells to neural systems, to show how complexity builds incrementally. The content draws from a review of over 1,400 research papers on the topic, and the README links to several academic papers from groups at IBM, Princeton, and other institutions. A 12-week course syllabus is under construction. This resource is aimed at developers and technically curious people who already use AI tools regularly and want a more principled framework for getting better results, particularly when building multi-step or multi-agent AI workflows.

Copy-paste prompts

Prompt 1
Using the context engineering principles from this repo, help me design a context window for a customer support bot that retains the last 5 messages and injects relevant FAQ entries.
Prompt 2
Based on the few-shot examples module in this course, write a few-shot prompt template for classifying GitHub issues by type.
Prompt 3
Help me implement a multi-agent workflow where one agent retrieves documents and another answers questions, following the patterns in this context engineering course.
Prompt 4
Using the memory management patterns from this repo, design a system where an AI assistant remembers user preferences across sessions.
Prompt 5
Walk me through the difference between prompt engineering and context engineering as defined here, with a concrete before-and-after coding example.
Open on GitHub → Explain another repo

← davidkimai on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.