Skip to main content
This page describes the planned Thread type for aion-langgraph. The Thread object is the main fluent surface for replying, posting, looking up history, and emitting streaming intents without forcing authors to build raw A2A messages by hand.

Properties

PropertyPurpose
idCurrent messaging thread or context identifier
parent_idParent thread or context identifier when one exists
networkOriginating network or distribution identifier
default_reply_targetCanonical reply target derived from the inbound event

Methods

MethodPurpose
reply(content, *, metadata=None)Add a durable reply to the current thread
post(content, *, target=None, metadata=None)Create an explicit outbound post action
history(limit=20, before=None)Request recent conversation history through the control plane
typing()Emit a stream-only typing or progress intent
reply(...) and post(...) should accept the same content categories:
  • plain text
  • a provider-neutral card document
  • an async iterator of text chunks for streaming replies
  • an explicit low-level message builder when the author needs more control

reply(...)

reply(...) is intended for the most common case: answer in the same place the inbound message arrived.
async def node(state: State, runtime: Runtime[AionContext]) -> dict:
    await runtime.context.thread.reply("Thanks. I'm looking into that now.")
    return {}
When content is an async iterator, the SDK should:
  1. emit stream deltas during SendStreamingMessage
  2. accumulate the durable reply in the same request-scoped response buffer
That keeps streamed output and final reply compilation aligned.

post(...)

post(...) is intended for explicit outbound actions that should remain distinct from the default reply target.
async def node(state: State, runtime: Runtime[AionContext]) -> dict:
    thread = runtime.context.thread
    await thread.post("Posting a follow-up note to a different channel.")
    return {}
Unlike reply(...), post(...) should remain explicit in the response buffer so cross-target delivery is never inferred from transcript order alone.

history(...)

history(...) is intended to ask the control plane for more context than was included on the inbound turn.
async def node(state: State, runtime: Runtime[AionContext]) -> dict:
    recent = await runtime.context.thread.history(limit=5)
    return {}
This should compile down to a control-plane request that uses the distribution metadata already attached to the current turn.

typing()

typing() is intended for stream-only live intents.
async def node(state: State, runtime: Runtime[AionContext]) -> dict:
    await runtime.context.thread.typing()
    return {}
These intents should not replace the durable response precedence. They are best-effort live hints for streaming views.