Skip to main content
This page describes the three authoring styles LangGraph developers can choose from when running behind Aion. The goal is not to force one SDK shape onto every graph. Aion should work well for plain LangGraph graphs, for explicit A2A-aware graphs, and for a higher-level fluent SDK surface.

1. Plain LangGraph

Use plain LangGraph when you only need normal conversational input and output.
In this mode:
  • Aion maps inbound text into state.messages
  • Aion infers the final reply from streamed model output or the last agent-authored AIMessage
  • the graph does not need any Aion-specific dependency
This is the best fit for basic chat agents.

2. Hybrid A2A

Use hybrid authoring when you want raw protocol access without adopting the higher-level authoring helpers.
In this mode:
  • a2a_inbox gives you direct access to the inbound task, message, and request metadata
  • a2a_outbox gives you direct control over the outbound A2A object
  • LangGraph still provides ordinary state.messages for model-facing logic
This is the best fit when you need structured parts, explicit metadata, or fine-grained protocol control.

3. SDK-aware LangGraph

Use the aion-authoring-langgraph surface when you want normalized messaging, runtime-scoped Aion context, model-service helpers, and MCP tool loading without hand-assembling A2A envelopes.
In this mode:
  • request-scoped routing data stays in LangGraph runtime context, not graph state
  • thread.reply(...), thread.post(...), and thread.typing(...) emit through LangGraph custom streaming events
  • model helpers inject Aion model-service authentication and runtime principal attribution per request
  • MCP helpers resolve static and runtime capability references after AionRuntimeContext is available
This is the best fit when you want a higher-level authoring experience while still mapping to Aion’s generic A2A extensions.

Event router

For event-driven integrations, prefer create_event_router. It creates a normal LangGraph node and injects only the parameters your handler declares:
Handlers may declare any subset of state, runtime, context, event, distribution, behavior, environment, principal_identity, service_identity, inbox, thread, or message. Other declared parameters are left for LangGraph-native injection.

Model service

Use aion_chat_model or aion_chat_openai when LangChain model calls should go through Aion’s OpenAI-compatible model service:
The helper owns Aion connection settings such as api_key, base_url, default_headers, http_client, and http_async_client. Pass model behavior options such as temperature, token limits, timeouts, and retries.

MCP tools

Use load_aion_mcp_tools after an AionRuntimeContext exists. Static capability references address known control-plane endpoints, while runtime references resolve their subject from the incoming request:
Use AionLangGraphMcpResolver when you want to reuse the same MCP resolution settings across invocations.
Thread.history() is not implemented yet and currently returns an empty list. Avoid using it in production examples until the control-plane history lookup is available.

Which Pattern to Choose

It is important that these modes compose cleanly. A graph should be able to use the fluent SDK for one turn, a2a_outbox for another, and plain LangGraph fallback for the rest without switching adapters.