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.
Turns out that `moduleResolution: node10` will achieve the same result as setting `src/package.json` to `{}` (verified via git worktrees).
Also switching `moduleResolution: bundler` for ESM build, after which I've compared the build output of `libs/checkpoint` via `diff -r -q`.