Architecture Overview
The SDK consists of two main components:- A2A Extensions Handling - Processes agent capabilities and manages the extension system through
handleAgentCardand related functions - Platform API Client - Provides HTTP client wrapper for interacting with the AgentStack platform API via
buildApiClient
Core Concepts
Agent Cards and Capabilities
Agents declare their capabilities through agent cards. These cards specify what extensions the agent supports, such as:- Service extensions (LLM, embeddings, MCP, OAuth, secrets): Agent asks for a demand and it is client’s responsibility to fulfill the demand. Think of a Dependency Injection where the client is injecting the dependency.
- UI extensions (forms, citations, trajectory visualization): Extends basic A2A messaging with a structure that simplifies working with GUIs.
handleAgentCard to extract the demands and get a resolveMetadata function.
Task Status Updates
During task execution, agents send task status updates through the A2A protocol. These updates can indicate:- Message updates - New content from the agent
- Input required - Agent needs user input (forms, canvas edits)
- Auth required - Agent needs authentication (OAuth, secrets)
handleTaskStatusUpdate to parse A2A TaskStatusUpdate and extract structured information:
Agent Stack API Client
ThebuildApiClient function creates an HTTP client that exposes all AgentStack server capabilities. This client enables you to:
- Manipulate files - Upload, download, and manage files in agent contexts
- Manage vector stores - Create and manage vector stores for RAG and semantic search
- Provide fulfillments for extensions - Access platform services like LLM providers, embeddings, and connectors that you can use to fulfill service extension demands
- Manage contexts and permissions - Create contexts and generate context tokens with appropriate permissions for agent access
Next Steps
Now that you understand the basic concepts:- Extensions - Deep dive into service and UI extensions
- API Client - Complete reference for the AgentStack platform API client
- Examples - Complete working examples and integration patterns