Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
codebase_path: agent_sdks/python/a2ui_agent
associated_module: a2ui_inference
associated_module: a2ui_agent
module_blueprint_commit: null
implemented_features: []
local_development:
Expand All @@ -13,16 +13,20 @@ local_development:

## **Architecture & Ecosystem Map**

The reference Python implementation of the A2UI Agent/Inference SDK (`a2ui_inference`).
The reference Python implementation of the A2UI Agent SDK (`a2ui_agent`).

- **Prompt Engineering**: Dynamic system instructions engine utilizing `A2uiSchemaManager` to load and compile bundled component schemas from schemas folder.
- **Streaming & Parsing**: Uses regex-based real-time block extraction (`re.DOTALL` tag searches) inside `A2uiStreamParser` to isolate JSON segments from LLM streams on the fly.
- **Validation & Fixing**: Employs `PayloadFixer` to automatically heal invalid trailing commas and close bracket anomalies before structural validation is invoked.
- **Inference Formats & Prompt Engineering**: Decouples input prompt generation and output response parsing via format strategy facades (`InferenceFormat` / `InferenceFormatFactory`). Each strategy coordinates a format-specific `PromptGenerator` (which outputs instruction snippets and catalog schemas) and a `Parser` (which tokenizes, unwraps, and compiles responses).
- **Response Parsing**: Employs format-specific `Parser` engines to unwrap sentinel-tagged content, tokenize LLM responses into conversational text and raw payload blocks, and compile format expressions into standard A2UI payload messages.
- **Validation**: Structural layout and schema validation are delegated directly to core `a2ui.core.validating.A2uiValidator` to enforce contract compliance across all inference formats.
- **Framework Independence**: The SDK is completely agent-framework agnostic. It provides pure Python primitives and session facades without hardcoded dependencies on specific agent frameworks like ADK or LangChain.

## **Local Technical Decisions & Overrides**

- **ADK Integration**: Direct adapters exposed inside `src/a2ui/adk` to hook seamlessly into Python Agent Development Kit (ADK) event streams.
- **Resource Loading**: Bundles standard schema assets using standard `importlib.resources`, reverting to directory checking during local development modes.
- **Multi-Catalog Capability Negotiation**: Implements `A2uiSessionManager` and `A2uiSession` to negotiate client capabilities (`A2uiRendererCapabilities`) against registered catalog configurations (`CatalogConfig`), caching sessions by deterministic capability hash signature.
- **Standalone Catalog Transformers**: Uses `ComponentPruningTransformer` and `FunctionPruningTransformer` to decouple component and function allowlist filtering from raw schema parsing and representation.
- **Zero Validator Overhead**: Directly reuses `a2ui.core.validating.A2uiValidator` from `a2ui_core`, eliminating redundant validator facade wrappers in the agent layer.
- **Direct JSON Syntax Healing**: `DirectJsonFormat` includes JSON-specific repair utilities and `progressive_keys` to auto-heal fragmented JSON syntax, unquoted keys, and trailing commas.
- **Resource Loading**: Bundles standard schema assets using standard `importlib.resources` (`BundledCatalogProvider`), with `FileSystemCatalogProvider` and `InMemoryCatalogProvider` for local file development or dynamic in-memory schemas.

## **Validation & Execution Recipes**

Expand Down
Loading
Loading