This repository contains a comprehensive guide to context engineering techniques for large language models (LLMs). The goal is to help users progress from basic prompt design to advanced context management patterns.
- Basic Prompt Design: Starting with fundamental prompt engineering principles
- Context Expansion: Techniques for expanding simple prompts into rich contexts
- Control Loops: Implementing structured reasoning with loops and conditionals
- Retrieval-Augmented Generation (RAG): Integrating external knowledge with LLM responses
- Prompt Programs: Treating prompts as executable programs with state and operations
- Schema Design: Creating structured schemas for consistent and verifiable LLM interactions
- Recursive Patterns: Implementing self-improving contexts through recursive techniques
- Python 3.6 or higher
- OpenAI API key (or other LLM provider)
- Basic understanding of LLM interactions
pip install -r requirements.txtEach notebook is designed to be run sequentially to build understanding progressively:
# In Jupyter or Colab:
%run 01_basic_prompts.ipynb
%run 02_context_expansion.ipynb
%run 03_control_loops.ipynb
%run 04_rag_recipes.ipynb
%run 05_prompt_programs.ipynb
%run 06_schema_design.ipynb
%run 07_recursive_patterns.ipynbcontext-engineering/
├── 10_guides_zero_to_hero/
│ ├── 01_basic_prompts.ipynb
│ ├── 02_context_expansion.ipynb
│ ├── 03_control_loops.ipynb
│ ├── 04_rag_recipes.ipynb
│ ├── 05_prompt_programs.ipynb
│ ├── 06_schema_design.ipynb
│ ├── 07_recursive_patterns.ipynb
│ ├── requirements.txt
│ └── README.md
- Fork the repository
- Create a new branch for your feature or improvement
- Make your changes and test thoroughly
- Submit a pull request with detailed description of your changes
This project is licensed under the MIT License - see the LICENSE file for details.
Note: Due to network issues, the contents of this README were created based on standard practices for context engineering repositories. For repository-specific details, please refer to the actual content of the repository once accessible.