Skip to content

feat: UIX adapter-agentx — bridge AgentX Presentation to UIX IR #239

@deepracticexc

Description

@deepracticexc

Context

UIX (@uix-ai/core) is Deepractice's AI-to-UI Intermediate Representation (IR) protocol layer. It normalizes AI output from different backends (Vercel AI SDK, AG-UI, A2UI, AgentX, etc.) into a unified LucidConversation / LucidBlock format, so any renderer can consume it.

We've just published @uix-ai/adapter-agentx — an Anti-Corruption Layer (ACL) that converts AgentX's PresentationState (Block/Conversation) to UIX IR.

Repository: https://github.com/Deepractice/UIX
Package: packages/adapter-agentx/
Tests: 24 unit tests passing

What It Does

import { fromAgentXState } from '@uix-ai/adapter-agentx'

presentation.onUpdate((state) => {
  const conversations = fromAgentXState(state)
  // Render with assistant-ui, UIX components, or any UIX-compatible renderer
})

Type Mapping

AgentX UIX IR
TextBlock { content } LucidBlock<'text'> { content: { text } }
ToolBlock (4 states) LucidBlock<'tool'> (9 states)
ImageBlock LucidBlock<'image'>
ErrorConversation LucidConversation + LucidBlock<'error'>
isStreaming: true status: 'streaming'
streaming field appended to result as last conversation

Reverse conversion (toAgentXConversations) is also supported (lossy for thinking/file/source blocks since AgentX doesn't have these types).

Design Decision: Adapter, Not Source Integration

We considered two approaches:

  1. Adapter (chosen): UIX provides adapter-agentx as an ACL. AgentX doesn't need to change.
  2. Source integration: AgentX's Presentation types would be replaced with UIX IR types.

We chose the adapter approach because:

  • DDD Bounded Context: AgentX and UIX are separate bounded contexts. The downstream consumer (UIX/UI) should build the ACL, not the upstream producer (AgentX).
  • Zero impact on AgentX: No dependency added, no types changed, no breaking changes.
  • AgentX's Presentation types serve its reducer: They're internal value objects optimized for presentationReducer. Forcing UIX IR structure (id, timestamp, 9 tool states) onto them would add complexity without benefit to AgentX itself.
  • Consistent with UIX's architecture: UIX already has adapter-vercel, adapter-agui, adapter-a2ui. adapter-agentx follows the same pattern.

UIX Positioning (Updated README)

UIX has clarified its positioning: it is a protocol layer and conversion engine, not a Chat UI framework.

  • For production chat UI, UIX recommends assistant-ui
  • UIX's React components (@uix-ai/agent, @uix-ai/stream) are reference renderers
  • UIX's core value is @uix-ai/core (IR types) + adapters (format conversion)

See: https://github.com/Deepractice/UIX/blob/main/README.md

Deepractice Ecosystem

AgentX  — AI Agent runtime (the engine)
UIX     — AI output protocol (the translator)
PromptX — AI application (built with both)

No Action Required

This issue is informational. AgentX doesn't need to change anything. The adapter works with AgentX's existing Presentation types as-is.

If you want to try it:

pnpm add @uix-ai/adapter-agentx @uix-ai/core

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions