The service representative has read the customer summary. Now they want help resolving the problem: “They’ll be away next week. Can we move the delivery until they’re back?”

In the first essay, we chose where the model runs and what the business must carry to use it. We can send this request to that model, but an answer alone will not change the delivery. Something has to identify the order, find out whether it can be changed, clarify when the customer returns, and request the change through the system that owns it. That coordinating actor is what we are building when we build an agent.

I have described this before as an actor with inference where the decision used to be. The useful part of that framing is how much architecture it gives us to work with. We already know how to build components that receive messages, keep state, and ask other components to do work. Inference changes how we interpret the request and choose a next step. We can follow that change through the design without starting the entire discipline again.

Start with who owns the work

An actor receives messages and handles them using its own state and behavior. It can update that state and send messages to other actors. Callers ask it to do something through those messages; they do not reach inside and change its state themselves.

For our delivery request, imagine a coordinator that accepts an order identifier and a requested date. It keeps track of the request, asks the order system whether a change is possible, and requests the change if the conditions are met. The order system owns the order. The coordinator owns the progress of this particular request. That separation lets each enforce the rules for the work it owns, even while other requests are arriving.

An ordinary actor receives a delivery request, handles it using its own request state, and exchanges messages with the order system, which owns the order.

The coordinator might be implemented with explicit branches or a rule engine. A message arrives, its behavior selects the next step, and a reply supplies information it can use to continue. State connects those exchanges into one piece of work. The same structure applies to a component handling a reservation, processing a claim, or coordinating a deployment.

We can use that design in an ordinary service without adopting a particular actor runtime. So far, though, the coordinator expects a request that already names the order and the date. Our representative gave us something less structured.

Inference handles the request we were actually given

“Until they’re back” has meaning in the conversation, but it is not a value the scheduling API can accept. There may be several orders, and the customer may not have said when they are returning. Before we can use the coordinator’s existing operations, we have to work out what the representative means and what information is missing.

Traditional software handles this by making the person translate their intent into fields and selections. A language model gives us another way through. Given the request, relevant customer context, and descriptions of the available operations, it can infer that it needs to look up an order and ask for a return date. After receiving those results, it can propose the next operation. This is where inference earns its place: interpreting varied language and deciding what information is needed to turn it into useful work.

That flexibility also means the proposal needs checking. The model might select the wrong order, infer a date the customer never supplied, or request a change that the order’s current state no longer allows. Asking it again can produce a different interpretation of the same request. A well-formed tool call can still be the wrong action. The actor needs to distinguish missing information it should ask a person for from facts it can establish through another system.

We do not need inference for every step. Once the order and date are known, checking that the date is valid and submitting the permitted change can be ordinary code. If the whole task arrives as a complete, structured instruction with a fixed execution path, a conventional workflow may be sufficient. Put inference where interpretation is useful and let the rest of the system retain its explicit behavior.

The loop belongs to the actor

An initial lookup cannot finish our delivery request. Its result changes what we know, which changes what we can do next. The actor therefore sends context to the model, receives a proposed action, handles it, and gives the result back for another inference. That repeated exchange is the agent loop.

The model sees descriptions of tools: what an operation does and which arguments it accepts. It returns a request to use one. The actor’s code handles that request, perhaps calling a local function or another service. Describing the order lookup to the model does not connect the model directly to the order database.

That leaves execution under the actor’s coded control. The model can propose a delivery change; code decides whether to call the operation, and the order system applies its own rules. The actor’s code also determines when to ask again, when to return a response, and when to stop at an execution limit. These controls remain explicit even when the route through the conversation varies.

The agent retains the actor boundary. The actor builds context, requests an interpretation from a separate model service, checks the proposal, handles a call, and adds its result to the conversation before continuing or replying.

Suppose the lookup returns two outstanding orders. The actor adds that result to the working context, and the model can formulate a question that lets the representative identify the right one. The request can wait for that reply. Once the order is selected, the next lookup may show that it has already shipped, so changing its delivery requires a different operation or a handoff to a person. The route through the work emerges from what we learn, within the operations the actor permits.

The actor owns the continuity between those exchanges. It keeps the conversation and results, then selects what to send on the next model call. The inference service from the first essay works from that supplied context. Continuing a conversation means returning to the actor’s state and using it for another inference. The model can run elsewhere while the actor retains responsibility for the conversation.

The same exchanges recur as the request progresses, which gives us a practical implementation question: how much of the machinery carrying them should the team write itself?

Implementing the same actor in different ways

A handwritten loop makes those transitions directly, so our code handles both the actor’s decisions and the mechanics of calling the model and carrying results forward. A framework supplies recurring parts of that machinery and gives the actor’s code places to participate. A hook before a tool call, for example, lets our code decide whether the proposed call should proceed; a hook afterwards lets it use the result before the next inference.

In my AI on AWS playground, I built the intake agent both ways. It interprets an incoming message and can request that the case system record it. The handwritten loop and the Strands implementation call the same rules governing the actor before and after tool execution. One calls them directly; the other connects them to framework hooks. The actor’s responsibility stays the same while the mechanism carrying the conversation changes.

That is what I want from a framework: useful machinery for implementing the actor’s behavior. The team spends less time maintaining model integrations and conversation plumbing, while retaining a clear place for its own decisions. A small, specialized loop may be easier to maintain by hand. A broader application may benefit considerably from the integrations and execution support a framework already supplies.

Choose a framework for the team doing the work

Choosing among those implementations is largely a decision about team skills, existing infrastructure, and how quickly the business needs a maintainable service. I would start with the ecosystem the team already operates and test it against the required behavior before considering a new one.

For a business embedded in AWS and looking for a quick start, Strands is a sensible starting point. Its loop and execution hooks provide the arrangement illustrated by the playground. The team can develop within its existing AWS operating environment while keeping the business rules in its own code. Strands can also use models outside AWS; choosing it does not decide where inference must run.

For an Azure business seeking a quick start, I would begin with the Microsoft tooling its engineers already use and the path into Foundry’s managed hosting. Existing experience with the language, deployment process, and operating platform can remove more work than selecting a different framework for a marginal feature advantage. Within that environment, the team’s current code matters.

For teams already using Semantic Kernel, existing plugins, model integrations, and experience with its filters are useful investments. Those plugins expose application functions as operations the model can request, while the actor invokes the code that carries them out. For new development in that ecosystem, I would also assess Microsoft Agent Framework, Microsoft’s successor to Semantic Kernel and AutoGen. The relevant question is which supported path lets this team implement and maintain the required behavior with the least unnecessary change.

LangGraph is an equally reasonable starting point for a team comfortable expressing work as a graph of state and execution steps. It supports explicit control flow, persistence, and pauses for human input. Our delivery request might have a lookup step, a pause for clarification, and a controlled submission step, with inference used within that flow. A team that understands those mechanisms has a concrete reason to keep using them, including on AWS or Azure. Foundry can host LangGraph applications, and AgentCore Runtime supports multiple frameworks.

The comparison should follow the work the team expects to build. Can its engineers express the delivery conversation clearly, connect the required services, and put the actor’s decision logic at the right points in the loop? Do they understand how to inspect and change that behavior? Existing familiarity can make one option much less expensive to adopt without making it a better framework for every other team.

The separation needs to exist in the code. Put the delivery actor in delivery-actor.ts, with its state and business rules. Put the Strands hooks in delivery-agent.ts. The request handler creates the actor and passes that instance into the framework setup. Both callbacks then use that same instance: one records what the lookup returned, and the other asks what the actor will permit based on that information.

For this example, the representative has selected order 482, but the actor has not yet looked it up. Its status starts unknown. The actor’s file defines both the state update and the decision that uses it:

// delivery-actor.ts — business state and behavior; no framework imports
type OrderStatus = "scheduled" | "shipped";

export class DeliveryActor {
  private status: OrderStatus | undefined;

  constructor(readonly orderId: number) {}

  recordOrder(status: OrderStatus): void {
    this.status = status;
  }

  assessChange(): string | undefined {
    if (this.status === undefined) return "Look up the order first.";
    if (this.status === "shipped") return "Already shipped.";
    return undefined; // This rule permits the change.
  }
}

The Strands file imports the actor and accepts it as an argument. Our lookup_order tool returns a JSON result such as { "orderId": 482, "status": "shipped" }. The after-tool callback reads that result, checks that it describes the selected order, and passes the status to actor.recordOrder(). The before-tool callback consults that recorded state before allowing a dispatch change:

// delivery-agent.ts — framework wiring
import {
  Agent, AfterToolCallEvent, BeforeToolCallEvent,
} from "@strands-agents/sdk";
import { DeliveryActor } from "./delivery-actor.ts";

export function connectDeliveryActor(agent: Agent, actor: DeliveryActor) {
  agent.addHook(AfterToolCallEvent, (event) => {
    if (event.toolUse.name !== "lookup_order") return;
    if (event.result.status !== "success") return;

    const block = event.result.content.find((item) => item.type === "jsonBlock");
    const order = block?.json;
    if (!order || typeof order !== "object" || Array.isArray(order)) return;
    if (order.orderId !== actor.orderId) return;
    if (order.status !== "scheduled" && order.status !== "shipped") return;

    actor.recordOrder(order.status);
  });

  agent.addHook(BeforeToolCallEvent, (event) => {
    if (event.toolUse.name !== "reschedule_dispatch") return;

    const refusal = actor.assessChange();
    if (refusal !== undefined) event.cancel = refusal;
  });
}

The request handler creates the actor with the selected order’s identifier, without fetching its status. With the model and tools configured, it connects both hooks before starting the loop. The tools in this example operate on that selected order, and execute sequentially so a completed lookup updates the actor before the next tool begins:

// start-delivery.ts — create and connect them for this request
import { Agent } from "@strands-agents/sdk";
import { DeliveryActor } from "./delivery-actor.ts";
import { connectDeliveryActor } from "./delivery-agent.ts";

const actor = new DeliveryActor(482); // No status yet.
const agent = new Agent({ model, tools, toolExecutor: "sequential" });

connectDeliveryActor(agent, actor);
await agent.invoke(request);

Passing actor into connectDeliveryActor is the dependency injection. Both callbacks retain that reference. When the model requests a lookup and the tool returns shipped, the after-tool callback updates the actor. When the model subsequently proposes a dispatch change, the before-tool callback calls assessChange() on the same actor and receives “Already shipped.” If the model skips the lookup, the actor instead returns “Look up the order first.” The state comes from the tool result, and the rule lives in the actor’s file.

Three files show injection and the two callbacks. start-delivery.ts creates the actor for order 482 with unknown status and passes it into connectDeliveryActor. In delivery-agent.ts, the after-tool callback passes the successful lookup status to recordOrder in delivery-actor.ts. Later, the before-tool callback calls assessChange on that same actor. Its recorded shipped status produces a refusal, which the callback applies to the proposed tool call.

The order service still checks its current record when applying a change. The actor’s state is what it learned from the lookup, which may precede another change to the order. Here we are separating the actor’s state and decisions from the framework events that reach them.

If we move to LangGraph, we replace the hooks in delivery-agent.ts with graph steps. One passes the lookup result to actor.recordOrder(); another calls actor.assessChange() before dispatching the proposed change. delivery-actor.ts and its rule tests stay in place. A stable interface for invoking the actor gives us a similar boundary around hosting.

Hosting the actor

Whichever implementation we choose, the actor needs somewhere to run. The representative may answer our clarification immediately or return to the conversation later. The actor needs a way to associate that reply with its ongoing work, and the host must provide an execution environment for continuing it. Grouping related interactions into a session gives us a unit to manage. As more representatives use the application, we need to keep those sessions separate and supply capacity for their work. This is a different workload from serving model weights on accelerators.

AgentCore Runtime supplies that execution environment on AWS. Its session isolation gives each session a separate environment in which the actor can run. Related calls can return to an active session, while AWS manages the underlying compute. The actor’s implementation determines which interactions belong together and how its loop handles them. Strands is one way to implement that loop; Runtime can also host other frameworks or handwritten code.

On Azure, Foundry’s hosted agents provide managed hosting for agent applications, with support for sessions, identity, and scaling. The architectural choice is the same: use the platform to operate the execution environment while the actor defines the work. A team can also use its existing application hosting when it already supplies the capabilities this workload needs. The benefit of a dedicated agent runtime is the operating work it takes off that team.

The distinction follows the architecture we have built. The inference service runs the model, the framework or our own code implements the actor’s loop, and the runtime hosts that implementation. A framework change affects how we express the actor’s behavior. A hosting change affects how its execution environment is operated. Keeping those decisions separate lets the team use managed infrastructure without making every part of the application a platform decision.

Build from the capabilities the team already has

The actor model gives the business a familiar starting point: a component responsible for a defined piece of work, communicating with the systems around it. Inference lets that component accept the representative’s description of the customer’s problem and work out which information it needs next. We can introduce that capability without replacing the systems that already own orders, schedules, or customer records.

For a business getting started, I would build one useful interaction through that architecture using the team’s existing platform and skills. Let the framework carry the recurring exchanges and use managed hosting where it removes operating work. Invest the team’s effort in how the actor interprets the request and connects it to the business process. Adopting a new framework is justified when it solves a concrete problem in that work, rather than being a prerequisite for calling the result an agent.

That gives us an agent we can implement and host. The next essay follows one of its tool calls across the boundary into another system, where the familiar problems of distributed transactions become unavoidable.