Section 1

Input Layer

From Prompt Craft to Context Engineering

INPUT LAYER Multimodal Inputs Context Engineering Meta Prompting Auto Prompt Optimization DATA AND MODEL LAYER APPLICATION LAYER OUTPUT LAYER CHALLENGES

What Changed in the Input Layer

Prompting 2024

In 2024, prompting was a craft.

Models were sensitive. Small changes in wording produced wildly different outputs. Prompt engineering was a skill that took months to master.

Prompting 2024

Prompting in 2024: A Fragile Art

Brittle & Model-Specific

Prompts that worked on GPT-4 failed on Claude. Minor updates broke production systems. Every model needed different phrasing.

Skill-Based Techniques

Chain-of-Thought, Tree-of-Thought, ReAct patterns. Researchers published papers on prompting techniques. It was a specialized skill.

Manual Iteration

Teams spent weeks A/B testing prompts. Small word changes = big output differences. Prompt engineering was expensive and slow.

Prompting 2024

Some Research Papers That Defined 2024

Prompting Techniques: CoT, ToT, ReAct, Self-Consistency

These techniques worked, but required expertise to implement correctly. Most teams struggled to replicate paper results.

2025 Shift

Then models got smarter.

2025 models are less brittle. They understand intent better. Careful phrasing matters less. And we found ways to automate the optimization.

2025 Shift
2024 Approach

"How do I phrase this?"

Manually crafting prompts, testing variations, hoping it works across models

2025 Approach

"Let the model write it"

Meta-prompting and automated optimization. Models generate better prompts than humans.

Meta-Prompting

What is Meta-Prompting?

A meta-prompt instructs the model to create a good prompt based on your task description. Instead of writing prompts yourself, you describe what you want and the model generates an optimized prompt.

Meta-Prompting

Meta-Prompting: How It Works

The idea is simple: Use a prompt to generate prompts.

OpenAI's Playground uses meta-prompts behind the "Generate" button. You describe your task, and it creates a complete, optimized prompt.

The meta-prompt includes best practices:

  • Understand the task objectives and constraints
  • Encourage reasoning before conclusions
  • Include high-quality examples with placeholders
  • Specify output format explicitly
  • Add edge cases and important notes
Task Description → Meta-Prompt → Optimized Prompt

Models generate better prompts than most humans can write manually

Meta-Prompting

Meta-Prompting: Before & After

What You Write

"I need a prompt for sentiment analysis of customer reviews"

Just describe your task in plain language. No prompt engineering expertise required.

What the Model Generates

Analyze customer review sentiment.

# Steps
1. Read the review carefully
2. Identify emotional indicators
3. Consider context and nuance
4. Classify as positive/negative/neutral

# Output Format
JSON with sentiment and confidence score

# Examples
[Detailed examples with edge cases...]

Meta-Prompting

What OpenAI's Meta-Prompt Does

Source: OpenAI Prompt Generation Guide — the meta-prompt behind their Playground's Generate button.

Meta-Prompting

Why Meta Prompting is Super Valuable

Faster Iteration

Generate 10 prompt variations in seconds. Test all of them. Pick the winner. What took days now takes minutes.

Best Practices Built-In

Meta-prompts encode years of prompt engineering research. You get chain-of-thought, examples, and structure automatically.

Democratized Expertise

You don't need to be a prompt engineer. Describe what you want in plain English. The model handles the craft.

Auto Optimization

Beyond meta-prompting: Automatic Optimization

Meta-prompting generates prompts. But what if you could automatically iterate and improve them based on actual performance? That's automatic prompt optimization.

Auto Optimization

DSPy: Automated A/B Testing for Prompts

Instead of manually tweaking prompts and hoping they work, DSPy automatically tries different variations, measures which ones perform best, and keeps the winners. It's like having a tireless intern who tests thousands of prompt variations for you.

Auto Optimization
Manual Prompting

Guess and Check

Write a prompt. Test it. Doesn't work well? Tweak it. Test again. Repeat for hours. Still breaks on edge cases.

DSPy

Automatic Optimization

Give examples of what "good" looks like. DSPy tries hundreds of prompt variations automatically and finds what works best.

Auto Optimization

How DSPy Finds the Best Prompt

DSPy Optimization Process

You provide task + data. DSPy generates prompt variations. The loop scores, selects best, and repeats until optimized.

Auto Optimization

DSPy in Action

What You Write

# Define: question in, answer out
qa = dspy.ChainOfThought("question -> answer")

# Give 10-20 examples
examples = [...]

# Let DSPy optimize
optimized = dspy.compile(qa, examples)

What DSPy Figures Out

"Given the question, reason step-by-step. First identify the key concepts. Then consider relevant facts. Finally, synthesize into a clear answer. Format:

Reasoning: [your reasoning]
Answer: [concise answer]"

DSPy discovered this works better than simpler prompts.

Auto Optimization

Why This Matters

No More Prompt Guessing

Stop spending hours tweaking wording. Give examples of what "good" looks like, and let the machine find the best way to ask for it.

Gets Better Over Time

Collected more examples? Re-run optimization. Found edge cases? Add them and re-compile. Your prompts improve as your data grows.

Works Across Models

Switching from GPT-4 to Claude? Re-optimize with the same examples. DSPy finds what works best for each model automatically.

Context Engineering

Prompting skills matter. But context matters more.

For agentic systems, the clever phrasing is less important than what information you provide. This is context engineering.

Context Engineering

Context Engineering: What Goes Into the Prompt

Context Engineering Diagram

Source: @toaboricua on X

Context Engineering

Context Engineering: The New Discipline

"The art and science of filling the context window with just the right information at each step."

Not about clever phrasing — it's about what information the model needs and when it needs it.

Three types of context matter:

  • Instructions: Prompts, memories, examples
  • Knowledge: Facts, retrieved information
  • Tools: Feedback from tool calls and actions
Context Engineering

Source: LangChain Blog

Context Engineering

Four Strategies for Managing Context

  • Write: Save information outside the context window. Use scratchpads and memories to persist across sessions.
  • Select: Pull only relevant context in. Use embeddings, knowledge graphs, and careful filtering.
  • Compress: Reduce tokens through summarization and trimming. Prevent context overload.
  • Isolate: Split context across multiple agents or sandboxed environments.

The goal: give agents exactly what they need, nothing more.

Context Engineering Strategies

Source: LangChain Blog

Multimodal

Text-only AI systems are legacy.

In 2024, processing images alongside text was a differentiator. In 2025, it's table stakes. Systems that only handle text are increasingly inadequate for real-world use cases.

Multimodal

What Multimodal Inputs Enable

Customer Service

User sends a screenshot of an error message with their complaint. The model sees both, understands the context, and provides a relevant solution. No more "please describe what you see."

Code & Development

Share a photo of a whiteboard diagram and ask "implement this architecture." Upload a UI mockup and get working code. The model understands visual intent, not just text descriptions.

Document Processing

Feed invoices, receipts, contracts — the model reads text, understands layout, interprets signatures and stamps. No need to extract text first; it sees the whole document.

Multimodal

Why Multimodal Works Now

2024 models could see images. 2025 models understand them.

The latest models (GPT-5.2, Claude Opus 4.5, Gemini 3) have native multimodal understanding — images, audio, and video are first-class inputs, not bolted-on features.

  • Better accuracy: Models reason about visual and text context together, reducing hallucinations
  • Lower latency: No separate OCR or vision pipeline needed — one model handles everything
  • Richer context: A picture is worth a thousand tokens of description you don't have to write
Image + Text → Understanding

Not image-to-text + text-to-understanding anymore

Input Layer: Key Takeaways