LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
LangGraph
  • Web
  • Channels
  • Pregel
  • Prebuilt
  • Remote
React SDK
Vue SDK
Svelte SDK
Angular SDK
LangGraph SDK
  • Ui
  • Client
  • Auth
  • React
  • Logging
  • React Ui
  • Utils
  • Server
LangGraph Checkpoint
LangGraph Checkpoint MongoDB
LangGraph Checkpoint Postgres
  • Store
LangGraph Checkpoint Redis
  • Shallow
  • Store
LangGraph Checkpoint SQLite
LangGraph Checkpoint Validation
  • Cli
LangGraph API
LangGraph CLI
LangGraph CUA
  • Utils
LangGraph Supervisor
LangGraph Swarm
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

LangGraph
WebChannelsPregelPrebuiltRemote
React SDK
Vue SDK
Svelte SDK
Angular SDK
LangGraph SDK
UiClientAuthReactLoggingReact UiUtilsServer
LangGraph Checkpoint
LangGraph Checkpoint MongoDB
LangGraph Checkpoint Postgres
Store
LangGraph Checkpoint Redis
ShallowStore
LangGraph Checkpoint SQLite
LangGraph Checkpoint Validation
Cli
LangGraph API
LangGraph CLI
LangGraph CUA
Utils
LangGraph Supervisor
LangGraph Swarm
Language
Theme
JavaScript@langchain/langgraph-sdkclientThreadsClient
Class●Since v0.0

ThreadsClient

Copy
class ThreadsClient

Bases

BaseClient

Constructors

Properties

Methods

View source on GitHub
constructor
constructor
property
apiUrl: string
property
asyncCaller: AsyncCaller
property
defaultHeaders: Record<string, HeaderValue>
property
onRequest: RequestHook
property
timeoutMs: number | undefined
method
copy→ Promise<Thread<TStateType, unknown>>
method
count→ Promise<number>
method
create→ Promise<Assistant>
method
delete→ Promise<void>
method
fetch
method
get→ Promise<Assistant>
method
getHistory→ Promise<ThreadState<ValuesType>[]>
method
getState→ Promise<ThreadState<ValuesType>>
method
joinStream→ AsyncGenerator<__type>
method
patchState→ Promise<void>
method
prepareFetchOptions
method
prune→ Promise<__type>
method
search→ Promise<AssistantsSearchResponse>
method
streamWithRetry
method
update→ Promise<Assistant>
method
updateState→ Promise<Pick<Config, "configurable">>

Copy an existing thread

Count assistants matching filters.

Create a new assistant.

Delete an assistant.

Get an assistant by ID.

Get all past states for a thread.

Get state for a thread.

Stream output from a run in real-time, until the run is done.

Patch the metadata of a thread.

Prune threads by ID. The 'delete' strategy removes threads entirely. The 'keep_latest' strategy prunes old checkpoints but keeps threads and their latest state.

List assistants.

Update an assistant.

Add state to a thread.