AgentConfig
Configuration for an agent instance. Combines connection defaults with per-component options so the agent can be constructed once at provider time and injected everywhere it is needed.
import type { AgentConfig } from '@threadplane/langgraph';Declaration
export interface AgentConfig<T = Record<string, unknown>, _Bag extends BagTemplate = BagTemplate> {
apiUrl?: string;
assistantId?: string;
clientOptions?: LangGraphClientOptions;
initialValues?: Partial<T>;
onThreadId?: (id: string) => void;
subagentToolNames?: string[];
telemetry?: AgentRuntimeTelemetrySink | false;
threadId?: Signal<string | null> | string | null;
throttle?: number | false;
toMessage?: (msg: unknown) => BaseMessage;
transcriptNodeNames?: string[];
transport?: AgentTransport;
}Type parameters
TDefault:Record<string, unknown>_BagBagTemplateDefault:BagTemplate
Members
apiUrl
Base URL of the LangGraph Platform API (e.g., 'http://localhost:2024').
apiUrl?: string;assistantId
Agent or graph identifier on the LangGraph platform.
assistantId?: string;clientOptions
Tuning options for the default transport's LangGraph SDK client (e.g. retry budget).
clientOptions?: LangGraphClientOptions;initialValues
Initial state values before the first stream response arrives.
initialValues?: Partial<T>;onThreadId
Called when a new thread is auto-created by the transport.
onThreadId?: (id: string) => void;subagentToolNames
Tool names that indicate a subagent invocation.
subagentToolNames?: string[];telemetry
Omit to enable automatic development-only collection. Set false to disable.
An app-owned sink replaces the automatic destination and receives the
existing runtime lifecycle callbacks.
telemetry?: AgentRuntimeTelemetrySink | false;threadId
Thread ID to connect to. Pass a Signal for reactive thread switching.
threadId?: Signal<string | null> | string | null;throttle
Throttle signal updates in milliseconds. false to disable.
throttle?: number | false;toMessage
Custom message deserializer for non-standard message formats.
toMessage?: (msg: unknown) => BaseMessage;transcriptNodeNames
LangGraph node names whose messages-tuple LLM chunks should be projected
into the main chat transcript. Omit to accept all top-level message chunks.
Child-graph (namespaced) chunks never reach the transcript regardless of
this option — they belong to their child stream in subagents().
transcriptNodeNames?: string[];transport
Custom transport. Defaults to FetchStreamTransport.
A custom transport owns its own thread creation, so the runtime cannot
observe it directly: report every thread id the transport creates through
AgentConfig.onThreadId or through the threadId signal, otherwise
the runtime keeps sending null and a new thread is created on each submit.
transport?: AgentTransport;