Chapter 10: AI frameworks for context engineering
The introduction explains why framework choice matters for context engineering: frameworks package capabilities that teams rarely build entirely from scratch, while affecting visibility and control over the context lifecycle.
After this chapter you will be able to
- Framework choice and context control. Explain why teams use frameworks and platforms for context engineering, and why choosing one matters for the visibility and control of the context lifecycle.
- Context Engineering Framework Scope. Distinguish the frameworks covered here from model-training libraries. Explain that these tools help developers assemble, maintain, and route context around existing models.
- Three Framework Categories. Explain how AI application frameworks, agent orchestration frameworks, and AI application platforms differ by context scope and operating model. Note that overlapping features do not erase each tool’s primary architectural orientation.
- Framework category trade-offs. Distinguish the three framework categories by the control and convenience they offer, and explain how application needs determine the simplest suitable category.
- Architecture and context visibility. Explain why a team should define its architecture before shortlisting frameworks and require visibility into context flow. Describe when orchestration adds unnecessary complexity.
- Framework context management role. Explain how AI application frameworks help build LLM applications by assembling and transforming context, constraining outputs, and connecting models to application logic. Distinguish this role from complex agent coordination.
- Inspectable context construction. Explain why combining several framework abstractions can make wrong answers hard to diagnose and why context construction should remain explicit.
- LangChain primitives and boundaries. Describe the context patterns LangChain supports and distinguish its core primitives from the stateful multi-step execution assigned to LangGraph. Explain how the section’s example uses a chat model, templated instruction, and output schema to obtain a validated object.
- LlamaIndex retrieval abstractions. Explain that LlamaIndex connects LLMs to private or domain-specific data and provides abstractions for the stages that shape what context reaches the model.
- Retrieval quality responsibilities. Explain why teams must still check retrieval quality when using LlamaIndex, even if creating a queryable index takes only a few lines.
- Explicit pipeline data flow. Explain how Haystack connects reusable components into an explicit data flow and why that helps with context engineering.
- Spring AI application integration. Explain how Spring AI brings generative AI into a larger Spring application rather than treating it as a standalone interaction. Describe the roles the section gives to advisors, retrieval, structured output, and tool calling.
- AI service context assembly. Explain how a LangChain4j AI service defines an answer and assembles the context sent to the model.
- Type-safe agent abstraction. Explain how Pydantic AI combines system instructions, typed dependencies, tools, model calls, and result validation in one agent abstraction, and why this helps at the boundary between natural language and software objects.
- Type safety and correctness. Distinguish Pydantic AI’s integration reliability from semantic correctness, and describe the kinds of applications it suits.
- DSPy prompt optimization. Explain how DSPy uses structured signatures and modules instead of hand-written prompts, then optimizes model-facing instructions with examples, metrics, and optimizers.
- AI SDK application integration. Explain how the AI SDK helps connect AI capabilities to web applications through unified abstractions for model providers, streaming responses, tool calls, structured outputs, embeddings, and user interfaces.
- AI SDK fit and limits. Describe when the AI SDK is a good fit for a TypeScript team and distinguish its application-integration scope from retrieval or complex-system orchestration.
- Multi-step agent orchestration. Explain why orchestration matters when an application needs more than one model call or a simple retrieval pipeline, and describe the kinds of behavior and information flow it coordinates.
- Harness ownership tradeoff. Distinguish frameworks that provide machinery for a team-defined agent loop from those that provide a loop the team adapts, and explain the resulting framework-choice question.
- Stateful graph execution model. Explain how LangGraph represents an agent workflow using nodes, edges, and shared state, and distinguish its runtime role from LangChain’s application components.
- Control and architectural trade-off. Justify when LangGraph fits a team and describe the design decisions that come with its control over multi-step execution.
- CrewAI roles and coordination. Explain how CrewAI divides a workflow among agents, tasks, and a crew: agents have goals and supporting context, tasks specify outputs and dependencies, and the crew coordinates their work.
- Role-based fit and safeguards. Describe where CrewAI fits and why reliable applications need controls beyond role descriptions, including clear task boundaries, output validation, evaluation datasets, and monitoring of intermediate agent interactions.
- ADK capabilities and portability. Explain that ADK provides structure for building, debugging, and deploying multi-agent systems, including sessions, evaluation, coordination, and state. Distinguish its Gemini-aligned defaults from its ability to use other model providers and deployments.
- ADK fit and ecosystem trade-off. Describe why ADK fits teams seeking code-level control over agents, sessions, and evaluation, and explain why they should keep agent definitions portable when adopting managed services.
- Structured multi-agent orchestration. Explain how Microsoft Agent Framework contributes to context engineering by coordinating information flow and shared state across agents.
- Agno production platform role. Explain that Agno combines an SDK and runtime for building and operating agent platforms, with features that help teams run agent behavior as a service. Describe persisted session history as the section’s example of supplying context to an agent.
- Agno fit and scope trade-off. Justify when Agno fits a team and describe the scope decision it creates: whether the team needs an agent SDK, an orchestration layer, a control plane, or all three.
- Type-driven action planning. Explain how Embabel derives and revises a plan from annotated actions rather than asking a model to generate the plan.
- Typed blackboard context. Describe how Embabel gives an action the domain objects it declared, and why that changes the context a model call sees.
- State-dependent behavioral guidance. Explain how Parlant uses dynamic context selection instead of a monolithic system prompt to guide a conversational agent.
- DeepAgents harness and defaults. Explain what DeepAgents provides for long-running tasks and which context engineering decisions remain visible in code.
- Suitable uses and trade-off. Describe when DeepAgents fits and why its preselected decisions warrant inspection before sensitive use.
- Packaged agent loop capabilities. Describe how the Claude Agent SDK makes the agent loop behind Claude Code available as a library, including its built-in tools, permission model, subagents, skills, and memory.
- Preassembled harness defaults. Explain which four decisions the SDK’s defaults settle and why a team should check those defaults in an already assembled harness.
- Integrated AI application platforms. Explain what AI application platforms bring together and how that helps teams build and operate AI applications.
- Platform control and production discipline. Explain the control trade-off of using platforms and why visually built workflows require production software practices.
- Visual context flow. Explain how Dify’s visual workflows make the flow of context through an LLM application visible without reading its codebase.
- Visual flow composition. Describe how LangFlow connects components on a canvas and makes their contribution to context and the movement of data visible.
- Flowise beyond prototyping. Explain why Flowise is more than a visual prototyping tool for agents and LLM workflows.
- Trigger-action AI integrations. Explain how Zapier lets teams connect AI capabilities to SaaS applications and act beyond a chat interface.
- AI workflow integration. Explain how n8n connects AI components with enterprise processes through visual workflows that combine different kinds of steps.
- Assistant Gateway Pattern. Explain how OpenClaw connects communication channels and local environments to agents, letting users interact through familiar messaging interfaces.
- Gateway Trust Boundary. Justify why an assistant gateway suited to personal automation and self-hosted assistants needs safeguards.
- Durable agentic workflow execution. Explain how Temporal supports long-running agentic tasks that may wait, retry, or recover from an outage without losing partial progress.
- Managed context responsibilities. Explain how AgentCore's managed runtime affects context engineering: it handles session isolation, memory persistence, and tool routing, so the platform determines what persists across conversations and how tool schemas reach the model.
- Managed context ownership boundaries. Explain which context-lifecycle decisions a provider may own and why a team should identify those boundaries before deploying a production agent.
- Context lifecycle inspection checklist. Apply the five checks when exploring a framework example: identify model instructions, external information, available tools and their boundaries, intermediate state, and final-output validation. Explain why the whole context lifecycle matters more than the final answer alone.
- Framework decision boundaries. Explain that frameworks do not eliminate context-engineering decisions: they make some choices for you and leave others to you. Describe how to evaluate a candidate against the choices critical to your application.
What it builds on
- Defining context engineering (chapter 1) · Assumes the idea of building context for LLM-based systems.
- Context orchestration (chapter 7) · Assumes familiarity with context orchestration across a workflow.
- Context management (chapter 7) · The idea of context management in an AI system.
- A taxonomy of context failures (chapter 8) · The possibility of failures arising from the context supplied to an AI system.
- Retrieval-augmented generation (chapter 3) · The idea of retrieval-augmented generation.
- RAG in production environments (chapter 3) · Considerations for RAG in production environments.
- The generation pipeline (chapter 3) · The distinction between retrieving context and using it during generation.
- Taxonomy for context sources (chapter 1) · The distinction between instructions, external knowledge, tools, and memory as context sources.
Section by section
Introduction
The introduction explains why framework choice matters for context engineering: frameworks package capabilities that teams rarely build entirely from scratch, while affecting visibility and control over the context lifecycle.
- Framework choice and context control: Explain why teams use frameworks and platforms for context engineering, and why choosing one matters for the visibility and control of the context lifecycle.
Why it matters: A framework is not just a shortcut for implementation; it also shapes what a team can see and control about context.
Key terms: frameworks and platforms, reusable abstractions, context lifecycle
10.1 Understanding the framework landscape
Defines the scope of context-engineering frameworks and classifies them by the context they govern and how developers use them.
- Context Engineering Framework Scope: Distinguish the frameworks covered here from model-training libraries. Explain that these tools help developers assemble, maintain, and route context around existing models.
Why it matters: This boundary clarifies which kinds of tools the chapter compares. - Three Framework Categories: Explain how AI application frameworks, agent orchestration frameworks, and AI application platforms differ by context scope and operating model. Note that overlapping features do not erase each tool’s primary architectural orientation.
Why it matters: These distinctions provide a practical way to compare tools even when their feature lists overlap. - Changing Ecosystem Caveat: Explain why the taxonomy remains more useful than fixed project listings as the ecosystem changes, and identify where executable examples are maintained.
Why it matters: It helps readers use the comparison without treating time-sensitive listings as permanent.
Key terms: AI framework, context-aware applications, model training, AI application frameworks, agent orchestration frameworks, AI application platforms, scope of context governed, operating model, primary architectural orientation, taxonomy
10.2 Choosing a framework for your AI application
This section gives criteria for choosing the simplest AI framework category that meets an application's context, control, and operational needs.
- Framework category trade-offs: Distinguish the three framework categories by the control and convenience they offer, and explain how application needs determine the simplest suitable category.
Why it matters: Choosing by required control avoids unnecessary complexity without sacrificing capabilities the application needs. - Architecture and context visibility: Explain why a team should define its architecture before shortlisting frameworks and require visibility into context flow. Describe when orchestration adds unnecessary complexity.
Why it matters: An architecture-first choice makes context behavior inspectable while avoiding failure modes the task does not justify. - Production readiness and portability: Explain how operational safeguards, production discipline for visual platforms, and portable context assets affect framework selection.
Why it matters: These checks help a prototype remain governable in production and maintainable if its framework changes.
Key terms: AI application frameworks, agent orchestration frameworks, AI application platforms, context flow, context sources, tool boundaries, state model, orchestration, deterministic pipeline, operational surface
10.3 AI application frameworks
Introduces the shared context-management role of AI application frameworks and the need to keep their context construction inspectable.
- Framework context management role: Explain how AI application frameworks help build LLM applications by assembling and transforming context, constraining outputs, and connecting models to application logic. Distinguish this role from complex agent coordination.
Why it matters: This distinction helps you understand what an application framework contributes without expecting it to handle complex agent coordination. - Inspectable context construction: Explain why combining several framework abstractions can make wrong answers hard to diagnose and why context construction should remain explicit.
Why it matters: Visible context construction makes framework-based applications easier to troubleshoot.
Key terms: AI application frameworks, context management, prompt composition, retrieval augmentation, tool integration, session memory, accidental complexity, context construction, prompt templates, retrieval
10.3.1 LangChain
This section describes LangChain’s context-building primitives, its boundary with LangGraph, and the trade-off of its abstractions.
- LangChain primitives and boundaries: Describe the context patterns LangChain supports and distinguish its core primitives from the stateful multi-step execution assigned to LangGraph. Explain how the section’s example uses a chat model, templated instruction, and output schema to obtain a validated object.
Why it matters: This distinction helps you identify what LangChain supplies when building an LLM application and where multi-step execution belongs. - Abstraction density trade-off: Explain why LangChain’s flexibility can make application code harder to follow, especially when boundaries between context-building activities are blurred.
Why it matters: Keeping those activities distinct makes a flexible LangChain application easier to follow.
Key terms: LangChain, LangGraph, templated prompts, retrievers, structured output, output schema, abstraction density, retrieval, prompting, tool invocation
10.3.2 LlamaIndex
This section explains how LlamaIndex supports retrieval-based context engineering and why a short pipeline does not guarantee good retrieved context.
- LlamaIndex retrieval abstractions: Explain that LlamaIndex connects LLMs to private or domain-specific data and provides abstractions for the stages that shape what context reaches the model.
Why it matters: The context an LLM receives depends on the whole retrieval pipeline, not just where documents are stored. - Retrieval quality responsibilities: Explain why teams must still check retrieval quality when using LlamaIndex, even if creating a queryable index takes only a few lines.
Why it matters: A working index is not, by itself, evidence that the model is receiving useful context.
Key terms: LlamaIndex, retrieval, query engines, retrievers, retrieval quality, document preparation, index design, metadata quality, evaluation data
10.3.3 Haystack
Haystack makes the flow of context through search, RAG, and agent pipelines explicit, while requiring careful pipeline design to avoid poor context.
- Explicit pipeline data flow: Explain how Haystack connects reusable components into an explicit data flow and why that helps with context engineering.
Why it matters: A visible path makes it easier to see how context reached the model. - Production RAG fit and trade-off: Describe when Haystack is a good fit and why its pipelines still need careful design.
Why it matters: The framework exposes control over retrieval, but context quality still depends on pipeline design.
Key terms: Haystack, pipeline, reusable components, explicit data flow, production RAG, retrieval behavior, generation, pipeline design
10.3.4 Spring AI
Introduces Spring AI’s application-integrated abstractions and explains when it is a good framework choice.
- Spring AI application integration: Explain how Spring AI brings generative AI into a larger Spring application rather than treating it as a standalone interaction. Describe the roles the section gives to advisors, retrieval, structured output, and tool calling.
Why it matters: This explains what Spring AI contributes beyond a simple call to a chat model. - Spring AI organizational fit: Justify why Spring AI is a natural choice for an organization already using Java and Spring in production, and state the contrasting case where it suits a team less well.
Why it matters: Framework choice depends partly on the systems and workflows a team already uses.
Key terms: Spring AI, advisors, Spring-managed components, structured output, tool calling, Java, Spring, security model, observability stack, deployment workflow
10.3.5 LangChain4j
This section explains how LangChain4j’s AI services assemble context in Java, along with the visibility and framework-choice implications of that design.
- AI service context assembly: Explain how a LangChain4j AI service defines an answer and assembles the context sent to the model.
Why it matters: The AI service is the section’s concrete example of bringing several context sources together. - Declarative context visibility: Explain the visibility tradeoff of LangChain4j’s declarative style and how teams can inspect the resulting messages.
Why it matters: Readable configuration does not by itself show the exact messages the model receives. - JVM framework fit: Describe LangChain4j’s JVM positioning and the basis given for choosing it over Spring AI.
Why it matters: This positions LangChain4j among Java application frameworks without treating platform support as the main differentiator.
Key terms: AI service, annotations, return type, chat memory, content retriever, tool objects, declarative style, assembled prompt, request and response logging, model builders
10.3.6 Pydantic AI
This section positions Pydantic AI as a type-safe agent framework and explains both its integration benefits and its limits.
- Type-safe agent abstraction: Explain how Pydantic AI combines system instructions, typed dependencies, tools, model calls, and result validation in one agent abstraction, and why this helps at the boundary between natural language and software objects.
Why it matters: It helps connect model-driven behavior to software that expects typed objects. - Type safety and correctness: Distinguish Pydantic AI’s integration reliability from semantic correctness, and describe the kinds of applications it suits.
Why it matters: A valid software object can still contain the wrong answer.
Key terms: Pydantic AI, type-safe agent applications, typed dependencies, result validation, agent abstraction, integration reliability, semantic correctness, validated data structures, evals, test cases
10.3.7 DSPy
This section explains how DSPy shifts context design from hand-written prompts to measurable optimization, and when that approach is useful.
- DSPy prompt optimization: Explain how DSPy uses structured signatures and modules instead of hand-written prompts, then optimizes model-facing instructions with examples, metrics, and optimizers.
Why it matters: This distinction helps you recognize what DSPy changes about context engineering. - DSPy fit and trade-off: Describe why DSPy suits repeatedly evaluated classification, extraction, and RAG pipelines, and explain how its results depend on the metric and training examples.
Why it matters: DSPy's value depends on whether you can provide useful examples and measure the behavior you want.
Key terms: DSPy, structured signatures, modules, optimizers, classification, extraction, RAG pipelines, metric, training examples, feedback loop
10.3.8 AI SDK
This section positions the AI SDK as a TypeScript integration toolkit for user-facing AI applications and clarifies where its scope ends.
- AI SDK application integration: Explain how the AI SDK helps connect AI capabilities to web applications through unified abstractions for model providers, streaming responses, tool calls, structured outputs, embeddings, and user interfaces.
Why it matters: It explains why a web product may need more than an isolated model call. - AI SDK fit and limits: Describe when the AI SDK is a good fit for a TypeScript team and distinguish its application-integration scope from retrieval or complex-system orchestration.
Why it matters: The distinction helps a team choose it for application integration without expecting it to provide a complex system's runtime.
Key terms: AI SDK, unified abstractions, user interface integration, TypeScript, application integration layer, retrieval, orchestration runtime
10.4 Agent orchestration frameworks
This section explains why agent orchestration frameworks are useful for multi-step applications and how they differ in the amount of agent behavior they provide.
- Multi-step agent orchestration: Explain why orchestration matters when an application needs more than one model call or a simple retrieval pipeline, and describe the kinds of behavior and information flow it coordinates.
Why it matters: It clarifies what a framework must coordinate when an agent works across multiple steps. - Harness ownership tradeoff: Distinguish frameworks that provide machinery for a team-defined agent loop from those that provide a loop the team adapts, and explain the resulting framework-choice question.
Why it matters: The amount of harness a framework supplies determines which design decisions remain with the team.
Key terms: agent orchestration frameworks, state, tool outputs, harness, loop, boundaries
10.4.1 LangGraph
This section explains LangGraph’s stateful graph model and the control it offers for multi-step agents, along with its architectural trade-off.
- Stateful graph execution model: Explain how LangGraph represents an agent workflow using nodes, edges, and shared state, and distinguish its runtime role from LangChain’s application components.
Why it matters: The graph and its state make it easier to see what happens at each step and what information moves through the workflow. - Control and architectural trade-off: Justify when LangGraph fits a team and describe the design decisions that come with its control over multi-step execution.
Why it matters: Choosing LangGraph means accepting more workflow design work in exchange for explicit control over execution.
Key terms: LangGraph, LangChain, nodes, edges, state object, deterministic steps, agentic decisions, architectural overhead, conditional edge, human review
10.4.2 CrewAI
Explains how CrewAI organizes role-based agent workflows and why explicit roles alone do not ensure reliability.
- CrewAI roles and coordination: Explain how CrewAI divides a workflow among agents, tasks, and a crew: agents have goals and supporting context, tasks specify outputs and dependencies, and the crew coordinates their work.
Why it matters: This distinction helps you describe what each part of a CrewAI workflow is responsible for. - Role-based fit and safeguards: Describe where CrewAI fits and why reliable applications need controls beyond role descriptions, including clear task boundaries, output validation, evaluation datasets, and monitoring of intermediate agent interactions.
Why it matters: A clear agent role does not, by itself, make a workflow reliable.
Key terms: agent, task, crew, goal, expected outputs, dependencies, role-based workflows, task boundaries, output validation, evaluation datasets
10.4.3 Agent Development Kit
Introduces Google’s Agent Development Kit as a framework for structured multi-agent development and explains when its control and portability trade-off may suit a team.
- ADK capabilities and portability: Explain that ADK provides structure for building, debugging, and deploying multi-agent systems, including sessions, evaluation, coordination, and state. Distinguish its Gemini-aligned defaults from its ability to use other model providers and deployments.
Why it matters: This helps you distinguish ADK’s default ecosystem from the range of systems it can support. - ADK fit and ecosystem trade-off: Describe why ADK fits teams seeking code-level control over agents, sessions, and evaluation, and explain why they should keep agent definitions portable when adopting managed services.
Why it matters: This frames ADK as a choice between useful development support and the risk of ecosystem lock-in.
Key terms: Agent Development Kit, ADK, model- and deployment-agnostic, sessions, evaluation, shared or isolated state, code-level control, local development loop, evaluation harness, ecosystem alignment
10.4.4 Microsoft Agent Framework
This section positions Microsoft Agent Framework as a .NET and Python framework for structured multi-agent orchestration and explains its lineage and best fit.
- Structured multi-agent orchestration: Explain how Microsoft Agent Framework contributes to context engineering by coordinating information flow and shared state across agents.
Why it matters: The framework’s value for context engineering lies in coordinating context across agents. - Framework lineage and migration: Describe how Microsoft Agent Framework relates to Semantic Kernel and AutoGen, and state their maintenance status at the time of writing.
Why it matters: Its lineage helps teams understand where Microsoft’s new agent development is directed. - Enterprise fit and tradeoff: Explain where Microsoft Agent Framework is a good fit and why it may be less suitable for a small application.
Why it matters: The framework’s capabilities need to be weighed against their complexity for the application at hand.
Key terms: structured orchestration, handoff, shared state, Semantic Kernel, AutoGen, maintenance mode, migration path, enterprise-grade abstractions, .NET, Python
10.4.5 Agno
This section positions Agno as a production-oriented agent SDK and runtime and explains when its broad scope is useful or excessive.
- Agno production platform role: Explain that Agno combines an SDK and runtime for building and operating agent platforms, with features that help teams run agent behavior as a service. Describe persisted session history as the section’s example of supplying context to an agent.
Why it matters: This distinguishes Agno’s operational scope from a tool used only to define an individual agent. - Agno fit and scope trade-off: Justify when Agno fits a team and describe the scope decision it creates: whether the team needs an agent SDK, an orchestration layer, a control plane, or all three.
Why it matters: Matching Agno’s breadth to the team’s needs helps avoid adopting more platform machinery than the application requires.
Key terms: SDK, runtime, sessions, memory, traces, control-plane APIs, reusable platform, agentic services, agent SDK, orchestration layer
10.4.6 Embabel
Explains how Embabel uses typed actions to plan agent work and limit context, along with its cost-based choices and design trade-offs.
- Type-driven action planning: Explain how Embabel derives and revises a plan from annotated actions rather than asking a model to generate the plan.
Why it matters: Embabel puts the agent’s control flow in typed code rather than in a planning prompt. - Typed blackboard context: Describe how Embabel gives an action the domain objects it declared, and why that changes the context a model call sees.
Why it matters: Typed context delivery limits each model call to the objects its action requested. - Cost-guided action choice: Explain how action costs can favor a deterministic lookup before a model call.
Why it matters: Cost annotations can keep an agent from using a model call when a cheaper lookup suffices. - Framework fit and trade-off: Describe the design commitment Embabel requires and the setting in which the section says it fits.
Why it matters: The typed approach may suit a Spring codebase, but adopting it means committing to domain-model coordination.
Key terms: annotated methods, parameter and return types, goal-oriented action planning engine, declared goal, shared blackboard, domain objects, typed slice, accumulated transcript, cost, deterministic lookup
10.4.7 Parlant
This section explains how Parlant selects conversational guidance dynamically and where that approach is useful and limited.
- State-dependent behavioral guidance: Explain how Parlant uses dynamic context selection instead of a monolithic system prompt to guide a conversational agent.
Why it matters: Selecting guidance for the current state helps keep conversational behavior consistent without relying on one large prompt. - Conversational fit and design trade-off: Describe the settings Parlant fits and the human work on which its quality depends.
Why it matters: Dynamic guidance does not remove the need to create and maintain sound behavioral rules.
Key terms: Parlant, dynamic context selection, behavioral guidance, conversation state, monolithic system prompt, customer-facing agents, support flows, regulated conversations, behavioral consistency, guidelines
10.4.8 DeepAgents
This section describes DeepAgents as a pre-assembled harness for long-running agents and explains the trade-off between its ready-made defaults and the need to inspect them.
- DeepAgents harness and defaults: Explain what DeepAgents provides for long-running tasks and which context engineering decisions remain visible in code.
Why it matters: The defaults accelerate development without making context engineering choices invisible. - Suitable uses and trade-off: Describe when DeepAgents fits and why its preselected decisions warrant inspection before sensitive use.
Why it matters: A faster starting point still requires scrutiny when an agent operates in a sensitive environment.
Key terms: DeepAgents, agent harness, context management, file-like state, human review, research agents, coding agents, state, tools, skills
10.4.9 Claude Agent SDK
The section describes what the Claude Agent SDK packages into an agent harness and what teams should check before relying on its defaults.
- Packaged agent loop capabilities: Describe how the Claude Agent SDK makes the agent loop behind Claude Code available as a library, including its built-in tools, permission model, subagents, skills, and memory.
Why it matters: A packaged loop saves a team from assembling these agent capabilities separately. - Preassembled harness defaults: Explain which four decisions the SDK’s defaults settle and why a team should check those defaults in an already assembled harness.
Why it matters: Convenient defaults still determine what context the agent receives and what actions it may take. - Provider coupling and production permissions: Explain the trade-off of using the SDK and the caution given for agents that touch production systems.
Why it matters: A ready-made agent harness does not remove provider-dependence or the need to review sensitive-action controls.
Key terms: Claude Agent SDK, agent loop, built-in tools, permission model, subagents, file-based skills, defaults, harness, instructions, compacted
10.5 AI application platforms
This section defines AI application platforms, distinguishes their main architectural roles, and explains the control and production-management trade-offs they introduce.
- Integrated AI application platforms: Explain what AI application platforms bring together and how that helps teams build and operate AI applications.
Why it matters: This explains why quite different products belong in the same platform category. - Design surfaces and execution runtimes: Distinguish platforms centered on assembling applications from those centered on managed execution.
Why it matters: The distinction helps you compare platforms by their primary architectural role rather than treating them as interchangeable. - Platform control and production discipline: Explain the control trade-off of using platforms and why visually built workflows require production software practices.
Why it matters: Convenient platform tooling does not remove the need to understand, control, and maintain what goes into production.
Key terms: AI application platforms, product surface around the harness, context flows, design surfaces, execution runtimes, managed hosting environment, control, debugging, governance, versioning
10.5.1 Dify
This section describes Dify’s visual approach to building LLM applications, its value for seeing context flow, and where teams may need to go beyond it.
- Visual context flow: Explain how Dify’s visual workflows make the flow of context through an LLM application visible without reading its codebase.
Why it matters: Seeing these steps together makes it easier to follow how an application uses context. - Prototype fit and limits: Describe which teams Dify fits and what complex systems may still require.
Why it matters: The visual environment can speed delivery without replacing every engineering practice a complex system needs.
Key terms: Dify, visual environment, workflow, visibility, prototype, deployable application, code-level customization, automated tests
10.5.2 LangFlow
This section describes LangFlow’s visual approach to building AI flows, who it suits, and what helps growing flows remain predictable.
- Visual flow composition: Describe how LangFlow connects components on a canvas and makes their contribution to context and the movement of data visible.
Why it matters: The canvas helps a team see how an application’s components shape its context. - Low-code fit and upkeep: Explain which teams LangFlow fits and what growing flows need to remain predictable.
Why it matters: A visual interface does not remove the need to maintain flows as they grow.
Key terms: LangFlow, components, canvas, final context, low-code interface, Python and LLM application ecosystem, naming conventions, documentation, version control, tests
10.5.3 Flowise
Flowise combines visual workflow building with deployment and operational features, while requiring safeguards when workflows use tools and data sources.
- Flowise beyond prototyping: Explain why Flowise is more than a visual prototyping tool for agents and LLM workflows.
Why it matters: The combination connects workflow design to deploying and assessing an application. - Connected platform safeguards: State the safeguards needed when a platform calls tools and connects data sources.
Why it matters: Connecting workflows to tools and data brings operational and security responsibilities.
Key terms: Flowise, visual builders, APIs, tracing, evaluations, access control, network isolation, secret management, monitoring
10.5.4 Zapier
This section describes how Zapier connects AI applications to business software through no-code workflows and why those integrations need review.
- Trigger-action AI integrations: Explain how Zapier lets teams connect AI capabilities to SaaS applications and act beyond a chat interface.
Why it matters: It shows how an AI application can participate in business workflows rather than remain inside a chat interface. - Integration review concerns: Justify why Zapier-based AI integrations require review despite being quick to set up.
Why it matters: Ease of integration does not remove the need to check how an AI workflow accesses systems and handles data.
Key terms: no-code automation platform, trigger-action workflows, SaaS applications, runtime internals, credential management, action authorization, error handling, sensitive data
10.5.5 n8n
This section presents n8n as a visual workflow platform that connects AI components to enterprise processes and explains its deployment trade-off.
- AI workflow integration: Explain how n8n connects AI components with enterprise processes through visual workflows that combine different kinds of steps.
Why it matters: This helps you recognize where n8n fits when AI steps need to participate in a broader business workflow. - Deployment flexibility and responsibility: Describe n8n’s deployment options and the operational responsibility that comes with self-hosting.
Why it matters: Deployment flexibility is useful only if the team accounts for the work it takes to run the platform.
Key terms: n8n, workflow, visual, node-based editor, approval nodes, self-hosted, managed deployment, transparent automation, deployment flexibility
10.5.6 OpenClaw
OpenClaw illustrates how an assistant gateway connects messaging channels and local resources to agents, while creating a broad trust boundary.
- Assistant Gateway Pattern: Explain how OpenClaw connects communication channels and local environments to agents, letting users interact through familiar messaging interfaces.
Why it matters: This pattern explains what the platform contributes beyond the agent itself. - Gateway Trust Boundary: Justify why an assistant gateway suited to personal automation and self-hosted assistants needs safeguards.
Why it matters: Convenient access to personal resources also concentrates risk in the gateway.
Key terms: personal AI assistant gateway, assistant gateway pattern, control plane, personal automation, self-hosted assistants, trust boundary, transparent approvals, auditable action logs
10.5.7 Temporal
This section explains why Temporal’s durable workflows can support long-running agentic tasks and what complexity that reliability entails.
- Durable agentic workflow execution: Explain how Temporal supports long-running agentic tasks that may wait, retry, or recover from an outage without losing partial progress.
Why it matters: Agentic tasks can take time and encounter interruptions, so preserving progress matters. - Reliability and complexity tradeoff: Describe when Temporal fits a production system and what adopting it costs in complexity.
Why it matters: The reliability benefit should be weighed against the work of modeling and integrating workflows.
Key terms: Temporal, durable execution, long-running workflows, reliability, visual simplicity, workflows
10.5.8 Amazon Bedrock AgentCore
This section presents Amazon Bedrock AgentCore as a managed production runtime and explains how using it shifts context-related responsibilities to the cloud platform.
- Managed context responsibilities: Explain how AgentCore's managed runtime affects context engineering: it handles session isolation, memory persistence, and tool routing, so the platform determines what persists across conversations and how tool schemas reach the model.
Why it matters: It identifies which context decisions move from the application runtime to the platform. - Framework hosting and deployment fit: Describe AgentCore as a largely framework-agnostic managed service that typically hosts an agent built with another framework, and explain why it suits AWS teams favoring operational simplicity over low-level runtime control.
Why it matters: It helps distinguish the platform's hosting role from the framework used to build an agent.
Key terms: managed layer, session isolation, memory persistence, tool routing, tool schemas, managed service, framework-agnostic, operational simplicity, execution environment
10.5.9 Gemini Enterprise Agent Platform
This section describes Google Cloud’s managed agent runtime and explains why teams must identify which context-engineering responsibilities a managed platform takes over.
- Managed agent runtime capabilities: Describe what Gemini Enterprise Agent Platform’s Agent Runtime provides and which agents can run on it.
Why it matters: These managed capabilities show what the platform provides beyond simply running an agent. - Managed context ownership boundaries: Explain which context-lifecycle decisions a provider may own and why a team should identify those boundaries before deploying a production agent.
Why it matters: A hosted agent changes who controls consequential parts of its context and operating environment.
Key terms: Gemini Enterprise Agent Platform, Agent Runtime, managed sessions, memory bank, Agent Development Kit, context lifecycle, managed memory, managed gateway, managed sandbox
10.6 Hands-on
This section gives readers a framework-independent way to inspect executable examples and evaluate how a framework handles context-engineering decisions.
- Context lifecycle inspection checklist: Apply the five checks when exploring a framework example: identify model instructions, external information, available tools and their boundaries, intermediate state, and final-output validation. Explain why the whole context lifecycle matters more than the final answer alone.
Why it matters: The checklist makes it possible to see how a framework handles context, even when its final answer looks good. - Framework decision boundaries: Explain that frameworks do not eliminate context-engineering decisions: they make some choices for you and leave others to you. Describe how to evaluate a candidate against the choices critical to your application.
Why it matters: A framework is a better fit when you understand both the decisions it handles and those your team must still make.
Key terms: instructions, external information, tools, intermediate state, validation, context lifecycle, underlying decisions, critical choices, evaluating a candidate
10.7 Summary
Where this is used later
- Interoperable context (chapter 12) · The earlier comparison of the AI framework landscape.
Concepts explained in this chapter
- ai application platformAn environment that integrates tools and services for building, deploying, monitoring, and operating AI applications.
- agent orchestration frameworkAn agent orchestration framework is a software framework for controlling multi-step behavior, state, tool use, and collaboration among agents.
- AI frameworkA software framework that provides reusable components and abstractions for building AI-powered applications.
- working contextModel context is the information available to a model during inference that influences its output.
- agent orchestrationAgentic orchestration coordinates an agent's actions, tools, and execution steps toward a task.
- DSPyDSPy is an open-source framework for programming language-model systems with declarative modules and signatures that can be optimized against metrics and examples.
- pipelineA pipeline is a sequence of connected computational components that passes data through processing steps.
- taskAn A2A task is a stateful unit of work with an explicit lifecycle that can support long-running operations and multi-turn collaboration.
- memoryInformation retained across interactions or steps so an AI system can use it later.
- sandboxingExecution of generated code or commands within a restricted environment that limits their access and effects.
- sessionAn ongoing interaction between a user and an assistant.
- compactionA process that summarizes an agent conversation and discards lengthy details while preserving high-level task information.
- human-in-the-loopHuman oversight is the involvement of people in monitoring, reviewing, or controlling consequential AI decisions and actions.
- augmentationThe augmentation stage adds retrieved information to a model’s input to provide context for generation.
- context managementContext management is the shaping of context through selecting, writing, compressing, and isolating information before model consumption.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.
