An Agent Living in the Runtimes: Native and Integrated, Side by Side
A hosted agent does not carry a session, restore a conversation, keep a file, or survive a worker restart on its own. Two different memories do that for it — one the platform owns, one the agent owns — and the line between them is the whole story.
A companion article maps the KDCube runtimes and the fences between them. This one turns the map around and stands inside a single agent: how it is fed from any surface, what state exists for it and who owns each layer, and — the part that decides everything else — how a native agent and an integrated framework end up with genuinely different relationships to the same conversation record.
Two shipped apps ground every claim:
workspacethe native path. Its main agent is the native KDCube ReAct Agent adapter, constructed fresh per turn from the app descriptor.ported-langgraph-agentsthe integrated path. Two LangGraph agents behind one execute_core: a dispatcher resolves the agent, builds a fresh graph bound to the turn's identity, and routes the graph's own working store onto KDCube's Postgres.(In literal source, the deployable unit is still a bundle; in prose it is an app.)
01 Any surface, one lane
An agent never binds to a transport. Chat over SSE/Socket.IO, REST, public webhooks, MCP, Data Bus handlers, and scheduled work keep their own payload and lifecycle contracts. Each entry establishes the request or execution context available on that path. A public route does not require a platform session; the app or integration may still carry or resolve an actor and apply its own authorization. Supported entries can submit work onto the conversation event lane. Proc reserves one turn, and a foreign adapter folds every occurrence still pending when that turn starts. Batch identity remains attached to prompt/file siblings but is metadata inside the fold, not its boundary. Same-conversation turns serialize across workers while different conversations run in parallel.
What makes the lane an agent concept rather than plumbing is what happens when events arrive while a turn is running. The native KDCube ReAct Agent opens a fenced live-folding owner. A foreign loop instead keeps a turn-owned scheduled reservation fresh and watches the same Redis-backed lane read-only, so it can receive control without claiming content folding.
The two apps split exactly here. The native workspace agent opens the live lane handler and folds mid-turn events at decision boundaries. The LangGraph app folds the whole pending lane before reading inputs, then owns its graph loop without further content folding. Its watcher supports steer by cancelling the stream while the checkpointer retains the last completed node. The adapter declares accepts_steer: true and accepts_followup: false, so the composer offers stop without pretending another message can join the running graph. A bare stop expires after its target ends; textual steer remains pending without starting a turn.
02 Two memories, two owners
State for a hosted agent is two distinct layers with two distinct owners. Both must reflect the same conversation; neither substitutes for the other.
Layer 1 — the platform conversation product
The platform owns several related contracts, not one undifferentiated log. A conversation-level conv.timeline.v1 payload carries ordered blocks and identity contributed by an adapter. A sibling per-turn TurnLog is the reload envelope. Its shared base projection preserves every folded user submission, context and attachment refs, optional steps, hosted output files, and the final answer. Recorded chat events and stream aggregates preserve citations, cost, timing, progress, and completed panels that are not owned by that base log. The implementation calls this recording kind minimal only to distinguish replay ownership from the native ReAct Agent's richer projection; it is not a claim that the visible foreign turn is reduced to one prompt and one answer.
Cross-conversation search runs over separate content rows. Every shared base TurnLog derives one row per folded user submission and one for the final completion. Embeddings make those rows semantic candidates when available; their stored text remains eligible for lexical and trigram retrieval. Search matches those rows first, then fetches the corresponding TurnLog to materialize snippets and the visible turn. Neither the TurnLog blob nor the timeline payload is blindly vectorized.
Durable refs support file hosting in both directions: a user downloads uploads and agent-produced files later. An agent can read supported content into model context, pull a read-only copy, or checkout an editable copy into a new turn workspace. The native ReAct Agent additionally maintains a progressive timeline for its own model context, including compaction and age-sensitive rendering. Those are native ReAct Agent adapter semantics over shared timeline contracts, not guarantees inherited by every hosted framework.
Layer 2 — the agent's working memory
The second layer is what the model actually receives on a turn, and its owner depends on the agent kind.
Native. For the native KDCube ReAct Agent the progressive timeline is the source of truth for working memory. Each round the harness renders a session view from it:
The agent does not resend the whole history, and it does not pull everything by link. It reads a rendered, age-graded view, and it refreshes itself — retrieving exact collapsed data by its URI (⚙ react.read, react.pull) or finding it when no path is known (⚙ react.memsearch). Volatile per-round state — limits, live turn events, workspace status — rides the regenerated ANNOUNCE tail so the stable prefix stays cache-pure.
Integrated. A ported framework keeps its own working memory in its own store. The LangGraph app opens a durable checkpointer per agent (AsyncPostgresSaver routed onto KDCube's Postgres). Its thread_id is a platform-derived key containing tenant, project, active agent, user, and conversation identity — never the browser session id, which changes per session and would open an empty thread on reload. An in-memory saver is not sufficient for scaled serving: a later turn can land on another worker or follow a restart. The alternative is equally valid — reconstruct prior turns from the platform record each turn and feed them in, the record as the single source of truth at the cost of a reconstruction step. What is unsafe is treating client-submitted history or process memory as durable.
The native ReAct Agent reads its own progressive timeline as model context; an integrated agent reads its own checkpoint or session store. The platform separately records each hosted agent's visible turn boundary. Every hosted turn gets reloadable folded submissions, context and attachment refs, hosted output files, a final completion, and searchable transcript rows. Richer summaries, notes, anchors, attachment interpretation, and live folding remain adapter-owned.
03 Blocks are owned by their namespace
The timeline is not a fixed schema. Event sources register per-namespace resolvers, and each namespace owns how its events become blocks and how those blocks present everywhere: block production (a task: provider produces and may patch only the timeline blocks it owns — an integrity boundary, not a rendering convenience), authorized resolution and rehosting (when the agent reads, pulls, or checks out an owner ref, the namespace resolver supplies authorized content and pins materialized bytes into conversation artifact space), and cross-surface presentation (the same owner shapes how its event renders in the agent's context, in the chat UI on reload, in the compact external timeline served to MCP consumers, and in a scene).
For the platform this means the timeline can preserve any declared event kind under its provider's ownership. The shared record keeps the accepted event_ref occurrence separate from an optional materializable object_ref. Rich model-facing interpretation remains an adapter choice: the native ReAct Agent uses provider projections directly, while a foreign adapter must bind the presentation it wants to expose.
04 What the fusion gives an agent
Living inside the runtimes, native or integrated, an agent receives:
| Gain | Where it comes from |
|---|---|
| Multi-user serving with bound identity | each execution uses the actor and authority context established by its entry path; a public route does not require a platform session, while an app or integration may still carry or resolve identity; platform storage helpers apply tenant/project/user scope and trusted app code must preserve those owner keys |
| Horizontal scale | state keys on the conversation, the agent is rebuilt per turn, so any worker can take the next turn |
| Any-event ingestion | a common request/event context across transports; conversational work enters the lane, while namespaces own block production for domain events |
| Live follow-up and steer | the shared event source; the native ReAct Agent can fold both, while foreign loops watch without folding and translate steer at their own runtime boundary; a bare stop expires and textual steer stays pending |
| Live streaming to the initiator, across communicator-enabled runtimes | a comm spec crosses with supported work and the far side rebuilds it; selected recordable events and durable turn blocks later hydrate the conversation view |
| Durable history, restore, titles | timeline registration, the per-turn TurnLog, and independent event and stream artifacts |
| Cross-conversation search | prompt, completion, and richer content rows linked back to their TurnLog, scoped to the caller |
| File hosting both ways | durable conv:fi: links: users download later; agents read, pull read-only, checkout editable, and explicitly host selected outputs |
| Depth on demand over URIs | summaries carry refs; read/pull/checkout/search recover exact collapsed content or bytes by intent |
| Cheap subagents | timeline fork by value + fenced child runtimes with reduce |
| Isolated generated code | the split execution fence; tool calls brokered by the trusted supervisor |
| Accounting that follows the request | the accounting subject rides supported runtime crossings and attributes integrated model, embedding, search, and participating custom-call paths |
| Consent-gated capability | demand-driven claims at tool-attempt time; grants per user, per agent, revocable |
None of it is automatic exposure: the app descriptor declares what exists, the per-agent inventory narrows it, and the user narrows it further.
05 Native and integrated, side by side
The two apps make the difference concrete.
| Dimension | workspace (native ReAct Agent) | ported-langgraph-agents (integrated) |
|---|---|---|
| Reasoning core | native KDCube ReAct Agent rounds, protocol, action governance | framework/domain-owned LangGraph graphs; deliberate integration changes stay small and documented |
| Construction | agent built fresh per turn from config.react ⊕ surfaces.as_consumer | a dispatcher resolves the agent id and builds a fresh graph per turn |
| Working memory | the rendered session view over the timeline (age-graded, refresh-by-URI) | the framework checkpointer on KDCube Postgres, keyed by platform-scoped agent + user + conversation identity |
| Platform record role | rich timeline + TurnLog + transcript and semantic rows | shared base TurnLog with all folded inputs, refs, answer, hosted files, and transcript rows; the framework checkpointer stays private |
| Mid-turn events | folds followup/steer live at decision boundaries | folds the whole pending lane at start; watches read-only afterward; steer cancels the stream while content remains pending |
| Tools | SDK tools + named services + MCP, taught by composed instruction blocks | app @tools + selected SDK wrappers + MCP tools + consent placeholders, mapped by the adapter |
| Workspace | react.read, read-only react.pull, editable react.checkout, and exec over returned paths | shared read_file, read-only pull_files, editable checkout, and run_python over the same turn workspace |
| Generated code | full exec path with an exported tool catalog | run_python — isolated computation + hosted files |
| Streaming | channel protocol through the communicator | LangGraph events mapped to chat events by the stream adapters |
What the worked integrated agent gains without changing its reasoning core is the common layer its adapter actually wires: hosting, restore, search, ordered pending-lane handling, horizontal serving, accounting on integrated paths, consent-gated tools, and the same workspace grammar. The ported app now binds read_file, pull_files, checkout, and run_python to the shared harness core: direct read, read-only local materialization, editable checkout, and isolated computation with declared outputs. Framework-specific behavior, such as live event folding or an execution tool catalog, still requires adapter support.
One integrated nuance deserves its own note: Claude Code. Hosted Claude Code keeps continuity through its own session substrate (--session-id/--resume with a deterministic id from user + conversation + agent), not through the platform record; KDCube makes that substrate durable across workers with a git-backed session store, one branch per conversation boundary. The shared base record still captures all folded inputs, context and attachment refs, the final answer, and explicitly hosted files for restore and search, while the framework’s continuity lives in its own files. An app then chooses one of two profiles. Direct app-owned execution keeps the workset and outputs in app-domain storage; News is the worked pipeline. A conversational wrapper can opt into bind_claude_code_turn_workspace(...), which adds shared read-only pull, editable checkout/reset, and explicit publication of selected current-turn files/... paths through a trusted local MCP boundary; Press is the worked conversation. The runner remains policy-neutral, and neither profile constrains Claude’s direct Bash access to processor-visible paths or network.
It also shows how a foreign loop stays reachable without becoming a native ReAct Agent. The lane watcher stages live control in .kdcube-live/, outside the git-restored session checkout, and a PreToolUse hook handles every tool. Followup becomes additional context before the next tool call; steer denies that call so the model answers with what it has. A turn stamp prevents restored stop state from blocking a later run, and events no hook delivered remain pending.
06 One turn, end to end
The whole fusion in a single pass — the native agent shown; the integrated path differs only where marked.
Every supported runtime crossing follows one of the boundary contracts from the companion map. Conversation-facing durable output lands in the platform's record projections or behind durable refs; framework checkpoints and app-domain state remain in their own stores. That is the fusion: one agent, any declared surface in, several runtimes underneath, one platform-owned conversation product out.