Skip to content

Core Concepts ​

OwlLayer AI is an Agentic UI SDK. It does not replace your interface or generate a new UI on top of your product. It lets an AI agent act within your existing interface through explicit actions, observable context, and guardrails.

The model rests on five concepts: the Neural-DOM Binding, tools, the Shadow Context, policy-controlled execution (HITL), and the AITP protocol.


Agentic UI ​

An agentic interface is one that an agent can drive through explicit entry points.

The agent does not freely manipulate the DOM. It does not guess which buttons to click. It receives a structured context and a list of tools declared by the application, then acts only through those tools.

This distinguishes OwlLayer from two related approaches:

  • A classic chatbot, which mostly responds with text.
  • A Generative UI, which fabricates a new interface rather than driving the existing one.

In OwlLayer, the application remains the owner of its business logic. The agent only calls actions the product explicitly chooses to expose.


Neural-DOM Binding ​

The Neural-DOM Binding is the central architectural concept of OwlLayer. It describes the controlled link between an existing interface, the context that interface agrees to share, and the reasoning of an AI agent.

Neural-DOM Binding: the visible DOM declares tools and context to OwlLayerClient, which synchronizes them with the OwlLayerServer session over AITP

The model does not receive free access to the DOM. It receives a contract: a structured Shadow Context, a list of active tools, and an exchange protocol. When it wants to act, it does not click directly in the interface; it requests execution of a tool declared by the application.

The principle reads in three layers:

LayerRoleOwlLayer Rule
Visible DOMWhat the user sees and manipulatesThe agent does not freely browse it
Shadow ContextUseful representation of the screen, visible data, and mounted toolsOnly this context is synchronized with the server
Agentic SessionServer runtime, LLM adapter, and tool call decisionsThe LLM only sees tools present in the current session

The word Binding matters: the link is not static. When a page, product card, modal, or form appears, its tools can enter the Shadow Context. When that UI disappears, its tools must be removed and the server must receive a new CONTEXT_UPDATE. This prevents out-of-context actions.

The word Neural designates the decision-making part: the model reasons on the authorized context, then optionally chooses a tool. But execution stays in application code, with schemas, permissions, HITL validations, and handlers defined by the product.


Tools ​

A tool is a business action the agent is allowed to trigger: a name, a description the model reads, an input schema, a risk level, and a handler in the application code. The binding is carried by tools, and three parts of the runtime manage them.

Tool lifecycle: registered when the component mounts, synchronized with CONTEXT_UPDATE, called with TOOL_CALL, unregistered when the component unmounts

PartIn the runtimeWhat it does
RegistrationregisterTool() in OwlLayerClient, called by useAgentTool, the declarative components, OwlLayer.registerTool(), and data-owllayer-tool auto-discoveryAdds the tool to the client registry (ToolRegistry, the class the server also uses for each session) and schedules a CONTEXT_UPDATE, so the server receives the new list. Above the tool limit (30 by default, set by the server), the tool is refused and the refusal is reported.
UnregistrationunregisterTool(name) and unregisterToolsByComponent(componentId)Removes one tool, or every tool of a component when it unmounts. Tools declared with global: true stay for the whole session.
ExecutionOwlLayerClient, on each TOOL_CALLFinds the tool, validates the arguments with its schema, evaluates its risk with the HITL policy, waits for the Promise returned by the handler, then sends TOOL_RESULT. An unknown tool or invalid arguments return an error result, without asking for approval.

When a handler navigates to another page, the executor waits until the new page has registered its tools before sending the result. The model then continues with the tools of the new screen instead of the tools of the page it left.

In voice mode, OpenAI Realtime, the Deepgram Voice Agent and the streaming pipeline update the tools of the running session. Gemini Live reads its tools only when the connection opens. With the default model, gemini-2.5-flash-native-audio-preview-12-2025, GoogleLiveAdapter resumes the session with the new tools at the end of the current turn: Google keeps the conversation, and a tool of the new page is available from the next spoken turn. Gemini 3.x Live models keep the tools of the opening: see Voice models and tool updates.

On the server, ToolRouter dispatches each call: server-side tools run on the server, and interface tools are sent to the client as TOOL_CALL and awaited. When a server tool and an interface tool share a name, the server tool wins, and server.blockTool(name) blocks a tool even if a client declares it.

The Tools Guide covers how to write good tools, the execution contract, and the anti-patterns.


OwlLayerClient ​

OwlLayerClient is the front-end core of OwlLayer. The framework SDKs add ergonomics suited to their environment, but they share the same runtime.

SDKPrimary IntegrationRuntime
ReactOwlLayerProvider, hooks, componentsOwlLayerClient
Vueplugin, composables, componentsOwlLayerClient
Sveltestores, actions, componentsOwlLayerClient
Angularprovider, injection, signals, directivesOwlLayerClient
BrowserDirect JavaScript API, HTML auto-discoveryOwlLayerClient

What the client shares across all frameworks:

  • WebSocket AITP connection
  • Local tool registry
  • Context synchronization
  • Tool call execution
  • Tool result emission
  • Session state and runtime events

React, Vue, Svelte, Angular, and Browser change how tools are declared. They do not change the protocol.


AITP ​

AITP stands for Agent-to-Interface Transfer Protocol.

It is the JSON-over-WebSocket protocol that connects OwlLayerClient to OwlLayerServer.

MessageDirectionRole
HANDSHAKE_INITClient → ServerAnnounces the API key, SDK version and protocol version at socket open
HANDSHAKE_ACKServer → ClientConfirms the session and the negotiated capabilities
CONTEXT_UPDATEClient → ServerSynchronizes URL, title, context, and active tools
USER_INPUTClient → ServerSends a user text message or a complete audio message
TOOL_CALLServer → ClientRequests execution of an interface tool
TOOL_RESULTClient → ServerReturns success, error, or pending_approval
APPROVAL_REQUESTClient ↔ ServerDescribes an action waiting for the user's approval
APPROVAL_RESPONSEClient → ServerReturns the user's decision and, for an interface tool, its result
AGENT_RESPONSEServer → ClientStreams the agent's text response
AUDIO_STREAMClient ↔ ServerStreams live audio chunks (microphone up, agent voice down)
VOICE_INPUT_ENDClient → ServerSignals the end of the user's speech (user_stop, vad, or timeout)
VOICE_INTERRUPTClient → ServerSignals that the user interrupted the agent (barge-in)
VOICE_STATE_EVENTServer → ClientSignals turn_complete, interrupted, or waiting_for_input
SYSTEM_EVENTServer → ClientSignals errors, waiting, approvals, and runtime control

One tool call over AITP: CONTEXT_UPDATE, USER_INPUT, TOOL_CALL, TOOL_RESULT, AGENT_RESPONSE

The protocol defines these 14 message types. At the handshake, the server compares the protocol version strictly with its own and closes the connection if they differ. The server can only call tools known in the current session context. The AITP Protocol Spec details each payload.


Shadow Context ​

The Shadow Context is the lightweight representation of the interface's useful state.

It does not copy the entire DOM. It contains only the information the application chooses to expose:

  • Current URL and title
  • Active page or view
  • Visible entity
  • Current selection
  • Active filters
  • Cart, folder, workflow step, or other useful business data
  • List of active tools

Passive context helps the model understand the situation. It does not create actions. Actions are carried by tools.

The application publishes it where the state lives. The model reads it as text, so explicit sentences are more useful than raw variables, and the context can also carry instructions the developer wants the agent to follow on this screen.

SDKAPI
ReactuseAgentContext()
VueuseAgentContext()
Svelteuse:agentContext action
AngularregisterContext() or OwlLayerAngularService.updateContext()
BrowserOwlLayer.updateContext() merges, OwlLayer.setContext() replaces, and data-owllayer-context adds context to an element marked as a tool

HITL (Human-in-the-Loop) ​

OwlLayer classifies tools by risk level:

RiskExpected BehaviorExample
noneDirect executionsearch_products
lowDirect execution with optional notificationadd_to_cart
highUser confirmation requiredclear_cart
criticalReinforced user confirmation requiredprocess_payment

Risk should reflect the real user impact, not the technical complexity of the handler.

High and critical tools cannot execute until the user physically clicks "Approve". In the React and browser SDKs, the confirmation interface is rendered inside a closed Shadow DOM, so page scripts cannot reach it or click the approval buttons programmatically.

Released under the MIT License.