langchain-ai / langchain-ai/langgraphjs

The `batch` method is not implemented on `AsyncBatchedStore`

Open
#686 14 comments 1 reaction 0 assignees View on GitHub
bug stale triage: high-impact
Dominant language
TypeScript
Stars
3.3k
Forks
579
Avg merge
1d 1h
Merged PRs (30d)
56

Description

```
import {
LangGraphRunnableConfig
} from '@langchain/langgraph';
import { StateSchema } from '../state';
import {
Configuration
} from '../../../core/configurations/booking';
import { graph as backgroundStateManagerGraph } from '../../../graphs/background_state_manager/graph';

const manageStateInBackground = async (
state: StateSchema,
config: LangGraphRunnableConfig,
): Promise => {
void await backgroundStateManagerGraph.invoke(
state,
config
);
return state;
}

export default manageStateInBackground;
```

When I run a graph with this node, I get the following error:

```
Error: The `batch` method is not implemented on `AsyncBatchedStore`.
Instead, it calls the `batch` method on the wrapped store.
If you are seeing this error, something is wrong
```

Looking at the error, it seems to be because the store gets double wrapped...

This is what "store" looks like in the original graph
```
AsyncBatchedStore {
store: RemoteStore {},
}
```

This is what "store" looks like in the parent graph

```
AsyncBatchedStore { // Outer AsyncBatchedStore
store: AsyncBatchedStore { // Inner AsyncBatchedStore
store: RemoteStore {},
...
},
...
}
```

I think this is a bug, and if not the docs need to be updated! please can you advise...

Contributor guide

Open the contributing guide

Research direction

Start with the manageStateInBackground entry point and reproduce the graph invocation that produces the AsyncBatchedStore error. Compare the store wrapping shown for the original graph and parent graph, including the RemoteStore layers. Done means the cause of the double wrapping is established and the issue is resolved or the required documentation change is identified.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.