CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-langchain--langgraph

Low-level orchestration framework for building stateful, multi-actor applications with LLMs

Overview
Eval results
Files

state-management.mddocs/api/

State Management API

API reference for channels, reducers, and state management.

Channels

LastValue

Store last value, error on concurrent writes.

class LastValue<Value> extends BaseChannel<Value, Value, Value> {
  constructor(initialValueFactory?: () => Value);
  update(values: Value[]): boolean;
  get(): Value;
}

BinaryOperatorAggregate

Apply reducer function for custom aggregation.

class BinaryOperatorAggregate<ValueType, UpdateType = ValueType> {
  constructor(
    operator: BinaryOperator<ValueType, UpdateType>,
    initialValueFactory?: () => ValueType
  );
}

type BinaryOperator<ValueType, UpdateType> = (
  a: ValueType,
  b: UpdateType
) => ValueType;

Topic

Accumulate messages as array.

class Topic<Value> extends BaseChannel<Array<Value>, Value | Value[]> {
  constructor(fields?: {
    unique?: boolean;
    accumulate?: boolean;
  });
}

State Reducers

Message Reducer

function messagesStateReducer(
  left: Messages,
  right: Messages
): BaseMessage[];

const addMessages: typeof messagesStateReducer;

pushMessage

function pushMessage(
  message: BaseMessage | BaseMessageLike,
  options?: RunnableConfig & { stateKey?: string | null }
): BaseMessage;

See: Core Concepts for channel usage. See: State & Channels Guide for in-depth patterns.

Install with Tessl CLI

npx tessl i tessl/npm-langchain--langgraph@1.0.1

docs

api

channels.md

control-flow-api.md

execution-api.md

functional-api.md

graph-api.md

graph-construction-full.md

imports.md

persistence-api.md

persistence-full.md

prebuilt.md

remote.md

state-management.md

types.md

zod.md

index.md

tile.json