KDCube
← Industry
KDCube Industry · Perspective

Keep the Agent. Add the Runtime.

Your agent already works. Production should keep it — the framework, the behavior, the edge you built — and add the runtime around it.

16 July 2026Industry10 min
existing agentframework-neutral hostingproduct IPgradual adoptionsettleasync host layer

In a hurry? The executive brief of this article — “Your Agent Is Not a Prototype” — is a four-minute read.

An AI agent runtime becomes necessary at a predictable moment in an AI product's life. The agent works. It has real prompts, tools, retrieval, memory, and domain behavior. People have tested it. The team knows where it is strong and where it is not.

It may be a LangGraph graph, a CrewAI team, a framework-specific assistant, or a custom Python loop. Then the production questions arrive.

Who is the user? What happens when two requests arrive together? Can the next turn run on another worker? Where do uploaded and generated files live? How does the browser reload a conversation? Which model and tools may this conversation use? Who pays for a search or model call? What can generated code reach?

Those questions are not evidence that the agent should be rebuilt. They are evidence that the agent now needs a runtime.

bad choice onerewrite the agent for a hosting platform
bad choice twobuild every production service around it yourself
the third pathkeep the agent, add a bounded host layer, and settle it into a runtime

That third path is the choice KDCube is designed to make practical. For the implementation sequence, begin with Settle Your Solution In A KDCube App. The engineering evidence is in Your LangGraph Agent in KDCube. This article is about the decision those two pieces make possible.

SETTLING · KEEP THE CENTER, ADD THE OPERATING LAYER ORIGINAL OPERATING BOUNDARY the boundary the solution was designed for your working agent framework · graph · prompts · tools domain behavior · working memory VALID · SUSTAINABLE · YOURS SETTLE do not convert KDCUBE RUNTIME THIN ASYNC HOST LAYER your working agent framework · graph · prompts · tools domain behavior · working memory identity · scope stream · reload ordered turns economics · guard SAME PRODUCT IP · BROADER OPERATING REACH · EXPLICIT ADDED BOUNDARY THE ORIGINAL SOLUTION REMAINS RECOGNIZABLE AND INDEPENDENTLY MAINTAINABLE
Fig. 1 — the center remains yours; the added operating area is explicit.

01 The differentiated part should remain yours

An agent's framework is not its value. Its value is the behavior a team built with that framework: the graph, prompts, domain rules, retrieval choices, specialist agents, tools, and working memory. That is the part informed by the product and improved through use.

Replacing that center during the move to production creates three avoidable costs.

  1. Behavioral risk. A graph translated into another control loop is not the same system merely because the boxes have similar labels.
  2. Delivery delay. The team repeats solved work while identity, files, accounting, and operations remain unfinished.
  3. Strategic coupling. Future agent improvements become constrained by the hosting platform's preferred framework instead of the product's needs.

Framework neutrality has to mean more than accepting a Python callback. The original solution must remain recognizable and independently maintainable. Its framework and domain package should still be visible in the source tree, with runtime-specific code beside it rather than threaded through every node.

solution/
framework, graph, domain behavior, and agent-owned memory
platform/
explicit asynchronous host adapters
entrypoint.py
the small composition root for one KDCube app

This is not a claim of byte-for-byte immutability. A safe async seam, explicit configuration injection, accounted model adapter, or small shared workspace instruction may require a deliberate source change. The useful rule is that changes remain small, centralized, documented, and upstreamable. The host layer must not become a second hidden agent implementation.

02 Settling is a bounded engineering task

“Just wrap it” is not a useful plan unless the boundary is concrete. In a complete first settlement, the team adds four seams and the standard KDCube app package.

SeamWhat it connectsWhat remains unchanged
Turnone accepted user event to one async agent run and final answerthe graph's control loop
Streamexisting token, node, and tool events to the communicatorthe graph's native event source
State scopebound tenant, project, agent, user, and conversation to the agent's own keysthe agent's memory and checkpointer model
Paid servicesmodel, embedding, search, and other metered calls to accountable providersthe agent's decision about when to call them

The app package then declares what the app actually exposes, where its configuration and secrets come from, what durable state it owns, and how it is tested and released.

That is integration, not conversion. It is also not magic. The stream adapter must understand the graph's shape. The state mapper must prevent one user's memory from becoming another user's context. Paid calls count only when they cross the accounted service boundary. These are explicit decisions, which is why they can be reviewed and tested.

THE FIRST SETTLEMENT · FOUR REVIEWABLE SEAMS KDCUBE RUNTIME · OPERATING CONTRACTS THIN ASYNC HOST LAYER preserved agent core framework · control loop · domain behavior prompts · tools · working memory TURN accepted event → async run STREAM native events → communicator STATE SCOPE bound identity → store keys PAID SERVICES calls → accountable providers OPTIONAL LATER attachments hosted files web isolated exec model choices additional agents THE BASELINE IS SMALL BECAUSE EVERY SEAM HAS ONE OWNER
Fig. 2 — four seams establish the first complete operating boundary; optional capabilities stay optional.

03 The runtime takes over the second project

Once those seams are connected, the surrounding responsibilities stop being a separate product roadmap.

Ordered work

Accepted conversation events enter an ordered lane. One conversation runs one turn at a time even when the deployment has many workers. A message that arrives mid-turn remains ordered for the next turn instead of racing the current graph. The agent does not implement the scheduler.

Bound identity and continuity

Authentication and any delegation edge are resolved before the agent runs. The host layer receives bound context and maps it into the agent's own storage keys. Shared durable state, not a graph cached in one process, carries continuity to the next worker.

A conversation people can use

The agent's checkpointer remains its working memory. KDCube keeps a separate conversation record for listing, reload, and search. The communicator carries live progress to the reusable chat component and supplies the dynamic objects that are materialized on reload. A product can use that component or consume the same stream in its own interface.

Economics and evidence

Calls routed through KDCube's accountable services retain the deployment, app, agent, user, conversation, and turn scope around the work. Budgets and settlement can therefore follow a call across runtime boundaries without making the model or generated code the source of authority.

These are baseline operating contracts. Other capabilities remain opt-in:

  • accept attachments and fold the complete prompt batch into one turn
  • give the agent conversation-scoped model and tool choices
  • connect governed web search and fetch
  • bind isolated code execution and a fresh per-turn workspace
  • host generated files and make them readable, pullable, and downloadable
  • dispatch several independently scoped agents through one app

The reference implementation demonstrates those connections. A first settlement does not need to enable all of them.

04 The proof is in a real before and after

KDCube includes a worked app rather than only an adapter sketch: ported-langgraph-agents@2026-07-13.

It hosts two different LangGraph shapes behind one turn seam:

  • a custom research graph with retrieval, long-lived memory, a nested specialist, a dedicated answer node, and Postgres checkpointing;
  • a looping langchain.agents.create_agent ReAct agent whose stream adapter distinguishes tool-deciding model turns from the final answer.

The source boundary is inspectable:

The example matters for a simple reason: a platform can claim framework neutrality while hiding the actual conversion inside an adapter. Here the preserved center and the added operating layer can be compared directly.

The implementation also exposes the non-obvious findings a toy example would miss: streamed answers depend on graph shape; a prompt with attachments is a batch; one process cannot own conversation continuity; the agent's memory is not the user's conversation record; generated files need one governed byte resolver across read, pull, and download.

Those findings belong in the engineering article and tests. They should not be mistaken for the minimum onboarding story. Their value is that the next team starts from known working seams instead of discovering production failures one at a time.

05 A staged move changes the risk profile

The first milestone can be deliberately narrow:

one existing agent
  + one authenticated conversation
  + one async turn seam
  + one correctly mapped stream
  + shared state that survives another worker
  + one reloadable conversation

At that point the team has not rewritten its agent, and it has not committed to every KDCube capability. It has proved the central operating boundary.

The next connections should be driven by product value:

  1. Add attachments when users need to bring files into the turn.
  2. Add hosted outputs when the agent produces something people must open.
  3. Add web or other paid services through accountable adapters when the agent needs them.
  4. Add isolated execution when generated code creates useful leverage.
  5. Add additional agents when their product roles are clear.

Each step expands the app without changing ownership of the agent core. That is gradual adoption in a form an engineering team can verify.

GRADUAL ADOPTION · CONNECT ONLY WHAT EARNS ITS PLACE ONE COMPLETE OPERATING BOUNDARY FIRST · CAPABILITIES FOLLOW PRODUCT VALUE settled agent turn · stream · scope accounted calls reloadable conversation attachments when users bringfiles into a turn hosted outputs when people mustopen the result paid tools when search or APIscreate product value isolated exec when generated codecreates useful leverage more agents when distinct productroles are already clear STABLE LOWER RAIL · SAME FRAMEWORK AND DOMAIN CORE the app expands without transferring ownership of the reasoning system STOP AFTER ANY USEFUL STAGE · ADD THE NEXT ONLY WHEN IT PAYS GRADUAL ADOPTION IS AN ARCHITECTURE, NOT A PROMISE
Fig. 3 — stop after any useful stage; the next connection must earn its place.

06 What leadership should ask

The right questions are more precise than “does the platform support our framework?”

  1. Can we point to the original agent package and the added host layer as separate source boundaries?
  2. Can the agent framework and domain behavior continue to evolve without a platform rewrite?
  3. Can another worker run the next turn without relying on process-local graph state?
  4. Are user, conversation, authority, and cost scopes bound before agent code runs?
  5. Can we stop after one useful integration and add the rest only when it earns its place?

If the answers are concrete, the platform is preserving the team's investment. If the answers depend on a proprietary rewrite, the runtime is becoming the new owner of the product's reasoning layer.

07 Keep what differentiates the product

A capable agent is not a prototype merely because it now needs identity, ordered delivery, streaming, files, governance, and economics. Those are runtime responsibilities.

Settle the agent behind a small explicit boundary. Keep its framework and domain behavior visible. Let the runtime take over the second project around it. Then add capabilities in the order the product needs them.

THE STATEMENT IS THE ARCHITECTURE INHERIT the runtime ORDERED TURNS IDENTITY CHAT + RELOAD FILES ECONOMICS ADD the host layer — thin, async, explicit TURN STREAM STATE SCOPE PAID SERVICES KEEP the agent framework · graph · prompts · tools · domain behavior · memory YOURS · UNCHANGED KEEP · ADD · INHERIT — EACH LAYER HAS ONE OWNER
Keep · add · inherit — the statement is the architecture.

· Read more

KDCube Industry
№ 2026-07-16 · kdcube.tech