Adapters overview
Adapters are the bridge between your agent code and the Astro runtime. They handle the gRPC streaming loop with the messaging sidecar, translate framework-specific events into the messaging protocol (status updates, content chunks, audio, feedback), and let you keep using whatever framework you already chose. You write serve(myAgent); the adapter handles the rest.
Available adapters
The *-core packages contain the framework-agnostic AgentAdapter interface, the MessagingBridge that drives the gRPC streaming loop, and a serve() entry point. The framework adapters (-mastra, -langchain) are thin wrappers that translate framework-specific stream events (Mastra fullStream chunks, LangChain astream updates) into the shared StreamHooks lifecycle.
When to use what
How they fit together
The boundary between adapter-core and the messaging sidecar is the Messaging SDK gRPC stream. You only touch the SDK directly when you write a custom adapter or skip the adapter layer entirely.
What an adapter handles for you
- Connecting to the messaging sidecar with automatic reconnect.
- Announcing your agent’s name, system prompt, and tools so they appear in the playground.
- Streaming each user message into your code and streaming each chunk of the reply back.
- Receiving feedback (thumbs up/down, free-form text, button clicks) and routing it to your handler.
- Handling audio messages — STT before your agent runs, optional TTS on the reply.
- Tracing — when an OTEL endpoint is set, the framework adapters auto-wire it.
Environment
All adapters share the same environment contract:
Local development with ast dev injects GRPC_SERVER_ADDR so the same serve(agent) call works both locally and in production.