Overview
The default LangGraph message-mapping flow is:- A distribution or client sends an A2A request into Aion Server.
- Aion maps conversational text into LangGraph state.
- Aion injects request-scoped Aion context at invocation time.
- Your graph writes to the response buffer,
a2a_outbox, or normal LangGraph output. - Aion turns that result back into an A2A
MessageorTask.
Inbound Surfaces
There are four relevant surfaces when a LangGraph run starts:| Surface | Purpose |
|---|---|
state.messages | Model-facing transcript for ordinary LangGraph and LangChain logic |
runtime.context | Planned Aion-aware request context, including thread, message, and event |
a2a_inbox | Hybrid escape hatch for raw A2A task, message, and request metadata |
config["configurable"]["thread_id"] | LangGraph’s own checkpoint thread identifier |
thread_id is not the same
thing as Aion’s inbound messaging thread or context identifier. thread_id
belongs to LangGraph persistence. The inbound distribution context should
instead surface through the Aion request context.
Runtime Context vs Graph State
The fluent LangGraph SDK should prefer invocation-scoped context for transport metadata and routing:Outbound Resolution
Aion should resolve the outbound reply in this order:- SDK-managed response buffer Helper-emitted reply content and streamed output intended to become the durable reply live here first.
a2a_outboxUse this when you want full protocol-level control over the outbound A2A object.- Framework-native fallback
If neither higher-precedence channel is used, Aion falls back to the
current turn’s streamed chunks and then the last agent-authored
AIMessagein LangGraph state.
thread.reply(...),
thread.post(...), and related helpers instead of forcing authors to choose
between custom stream events and final message construction.
What This Means for Distribution Flows
For messaging distributions, the default target should remain inherited from the inbound request:- DM in, DM out
- thread reply in, thread reply out
- mention in shared conversation, reply in that same conversation
a2a_outbox.