A2UI Python SDK - Core Library
Actively maintained. Last release 7 days ago, commits in 26 of the last 26 weeks. A safe choice.
pip install a2ui-coreA2UI Core Library (a2ui_core)
a2ui_core is a framework-agnostic Python library containing the core data models, reactive state management, and JSON schema validation logic for the A2UI protocol (v0.9 and onwards).
It provides the logic-neutral, visual-agnostic layer used by python-based server agents, rendering backends, and conformance testing frameworks.
Features
- Protocol Handling: Symmetrical processing and validation of A2UI specification envelope messages (
CreateSurface,UpdateComponents,UpdateDataModel, andDeleteSurface). - State Management: Reactive state tracking driven by a high-performance custom
Signalimplementation and decoupled hierarchical models (SurfaceGroupModel,SurfaceModel, andSurfaceComponentsModel). - DataContext: Advanced data binding and function execution environment with support for dynamic path resolution and automatic dependency updates.
- Catalog System: Extensible catalog registry supporting compiled object models (
ModelCatalog) and raw text-based schemas (JsonCatalog) for LLM prompt integration. - Validation & Integrity: Strict validation engine combining Pydantic (compiled envelopes) and JSON Schema Draft 2020-12 (dynamic catalogs) with advanced topological and integrity checks (cyclic layout detection, reachability analysis, orphan tracking, and recursive reference verification).
[!IMPORTANT] Specification Support: The
a2ui_corelibrary strictly targets the A2UI specification v0.9 and onwards. Unlike client-side renderers that may support legacy v0.8 layouts for backward compatibility, this Python core library does not support legacy v0.8 protocol definitions.
Architecture
The a2ui_core architecture aligns symmetrically with the client-side @a2ui/web_core engine, allowing exact parity when evaluating state representations and resolving dynamic layout values.
graph TD
MP[MessageProcessor] -->|Executes Messages| SGM[SurfaceGroupModel]
SGM -->|Manages active surfaces| SM[SurfaceModel]
SM -->|Dynamic Components| SCM[SurfaceComponentsModel]
SM -->|State Context| DM[DataModel]
SCM --> GB[GenericBinder]
DM --> GB