Aligning with latest Python changes updating endpoints to be:
POST /threads/{thread_id}/stream/events — SSE event stream
POST /threads/{thread_id}/commands — JSON command
WS /threads/{thread_id}/stream/events
for new streaming features.
Adds a first-class `returnMinimal` option to JS SDK `threads.update`.
When enabled, the SDK sends `Prefer: return=minimal` and resolves with
`undefined` for the 204 response. Includes a patch changeset and focused
fetch test coverage.
As a safe guard for the upcoming major release of the framework SDK
packages we pin the 0.x packages to whatever the latest langgraph-sdk
was at the time.
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.
# Releases
## @langchain/langgraph-checkpoint-mongodb@1.3.0
### Minor Changes
- [#2326](https://github.com/langchain-ai/langgraphjs/pull/2326)
[`36916ed`](https://github.com/langchain-ai/langgraphjs/commit/36916ed86e63eb07249a68ecf0508e3b986ba587)
Thanks [@tadjik1](https://github.com/tadjik1)! - feat: add MongoDBStore
for long-term memory
New `MongoDBStore` class for persisting data across threads and sessions
— user preferences, learned facts, agent memory, and more.
- Store and retrieve JSON documents organized by hierarchical namespaces
- Search with field-based filtering and comparison operators
- Vector similarity search with manual embedding (bring your own
embedding model) or auto embedding (MongoDB generates embeddings via
Voyage AI)
- Automatic document expiration via configurable TTL
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Hunter Lovell <hunter@hntrl.io>
## Summary
Adds `MongoDBStore` - a `BaseStore` implementation backed by MongoDB for
long-term cross-thread memory. While the existing `MongoDBSaver`
persists graph execution state within a single thread (checkpoints),
`MongoDBStore` enables agents to store and retrieve data across threads
and sessions - user preferences, learned facts, agent instructions, and
more.
Fixes [NODE-7497](https://jira.mongodb.org/browse/NODE-7497)
Built on top of the initial implementation by @PavelSafronov and
@RaschidJFR (PR #2320). Their work provided the foundation for the
store, auto embedding integration, and Docker test setup.
## Review notes
This PR is organized into two self-contained commits that can be
reviewed independently:
1. **[`add MongoDBStore with core CRUD and field-based
search`](https://github.com/langchain-ai/langgraphjs/commit/1415f7f6c7df0338644444feffa14f8123e2f0a8)**
- the store itself with all non-embedding functionality, namespace
prefix matching, matchConditions, tests
2. **[`add manual and auto embedding
support`](https://github.com/langchain-ai/langgraphjs/pull/2326/changes/7bc2ecd80840b1bd291d7dfcdc012a704b614040)**
- adds vector search on top of the first commit, including IndexConfig,
embedding logic in put/search, vector search index creation, tests
## What's included
### Core store (commit 1)
- `MongoDBStore` extending `BaseStore` with Put, Get, Delete, Search,
and ListNamespaces operations
- Hierarchical namespace organization with unique `(namespace, key)`
index
- Field-based search with comparison operators (`$eq`, `$ne`, `$gt`,
`$gte`, `$lt`, `$lte`)
- Namespace prefix matching in search using dot-notation array indexing
- ListNamespaces with `matchConditions` support (prefix, suffix, and
wildcard filtering)
- TTL support via MongoDB TTL index with optional refresh-on-read
- Factory method `fromConnString` for convenient setup
- Refactors existing `MongoDBSaver` into separate `checkpoint.ts` file
### Embedding support (commit 2)
Two modes for vector similarity search via MongoDB `$vectorSearch`, both
requiring `indexConfig`:
**Manual embedding** - app provides an `EmbeddingsInterface`:
- Store computes vectors on put via `embedDocuments()`
- Search computes query vector via `embedQuery()` and uses `queryVector`
in `$vectorSearch`
**Auto embedding** - no `EmbeddingsInterface` needed:
- Store writes plain text to the embedding field
- MongoDB generates embeddings server-side via Voyage AI (requires
`model` in `indexConfig`)
- Search sends query text via `query.text` in `$vectorSearch`
- Requires MongoDB 8.2+ with auto embedding support
---------
Co-authored-by: Hunter Lovell <40191806+hntrl@users.noreply.github.com>
## Summary
This updates Pregel callback manager initialization to pass
`tracerInheritableMetadata` defaults derived from `config.configurable`,
and narrows `ensureLangGraphConfig` metadata mirroring to the
allowlisted LangGraph identifiers used in stream/runtime metadata.
## Changes
### `@langchain/langgraph` (`libs/langgraph-core`)
- Updated Pregel callback manager setup to configure core callbacks with
`tracerInheritableMetadata` based on configurable primitive values,
excluding internal and secret-like keys.
- Hoisted tracing default logic into `_getTracingMetadataDefaults` and
`_excludeAsMetadata` for parity with the Python implementation shape.
- Restricted `ensureLangGraphConfig` configurable-to-metadata
propagation to the identifier allowlist:
- `thread_id`
- `checkpoint_id`
- `checkpoint_ns`
- `task_id`
- `run_id`
- `assistant_id`
- `graph_id`
- Updated config tests to assert the narrowed metadata propagation
behavior.
Issue:
In multi-agent sustem with handoffs like this example:
https://docs.langchain.com/oss/python/langchain/multi-agent/handoffs#multiple-agent-subgraphs,
if we trigger an interrupt from an agent within a swarm workflow, the
interrupt is propagated and sent twice, the last interrupt contains
values from the main graphs state, which is always going to be behind
the state of the agent from where interrupt is triggered. So,
temporarily, the message data becomes empty, it gets refilled when
interrupt is resumed
Fixes:
Do not update values when interrupt is recieved, just update the
interrupt in the state with the latest __interrupt data.
---------
Co-authored-by: Hunter Lovell <hunter@hntrl.io>
## Description
TypeScript 6.0 requires that any type emitted to a declaration file is
reachable via the package's `exports` field. Several types used in
`StateGraph`'s public API (class extends clause, constructor overloads,
method signatures) were not exported from the package entrypoints,
causing TS6 consumers to fail when exporting `StateGraph` instances from
their own packages.
Adds exports for: `ToStateDefinition`, `StateGraphNodeSpec`, `NodeSpec`,
`AddNodeOptions`, `StateGraphAddNodeOptions`,
`StateGraphArgsWithStateSchema`, `StateGraphArgsWithInputOutputSchemas`,
`CachePolicy`, `AnyStateSchema`, `StateSchemaFieldToChannel`,
`StateSchemaFieldsToStateDefinition`.
## Test Plan
- [ ] Verify a TS6 project can export a `StateGraph` instance without
declaration file errors
- [ ] Build passes with `pnpm build`
---------
Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>
Co-authored-by: Christian Bromann <git@bromann.dev>