A Context Engineer is an AI specialist who designs and orchestrates the complete information ecosystem surrounding large language models (LLMs) and AI agents. Unlike prompt engineers who focus on crafting optimal queries, context engineers take a systems-level approach to manage all the information that influences AI behavior - including system instructions, conversation history, relevant documents, API results, memory management, and structured data.
Context engineering has emerged as a critical discipline in 2025, representing the evolution from simple prompt optimization to comprehensive AI system design. As Tobi Lütke (CEO of Shopify) puts it: "It's the art of providing all the context for the task to be plausibly solvable by the LLM."
This notebook provides a hands-on exploration of context engineering principles through building a semi-practical AI application. It demonstrates how various forms of context - from memory systems to RAG (Retrieval-Augmented Generation) pipelines - come together to create intelligent, context-aware AI agents.
By the end of this notebook, you'll have constructed a sophisticated AI agent that can:
- Remember user preferences and past interactions
- Answer questions about specific topics (Kimi K2 model) using RAG
- Search academic papers for broader AI/ML topics
- Maintain conversation context across multiple interactions
- Adapt its responses based on user-specific information
As AI systems become more complex and are deployed in production environments, the ability to engineer effective context becomes crucial. This notebook provides practical, hands-on experience with the techniques that power modern AI applications - from customer service bots to research assistants to autonomous agents.
Whether you're an AI engineer, data scientist, or developer interested in building more intelligent applications, this notebook offers valuable insights into the art and science of context engineering.
Open the context-engineering-notebook.ipynb
file and follow along with the interactive examples. Each section builds upon the previous ones, culminating in a fully functional context-aware AI agent.
This notebook was extended from LangChain's Long-Term Memory Agent tutorial.