-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The batch
method is not implemented on AsyncBatchedStore
#686
Comments
This is with |
This is what a log of the store looks like just before it gets used (and throws an error)
|
CC @bracesproul |
@ashburnham are you running this in LangGraph studio? Also, could you give me more context as to what's happening in |
Yup - this is running in Langgraph studio - the logs above are just copy/pasted from it.
I've copied the code for it below for completeness.
This issue is happening with all sub-graphs though, it's not specific to this graph. Just shout if you need anything else. |
@ashburnham are you using the built in store from LangGraph? (The store which is accessed via |
I'm just using the store accessed via config.store and using patterns that I've seen in langchain examples. Function to get the store:
Parent graph
Child graph
Node that throws error when it gets to the store..
This is the error
Except from console log above..
Just let me know if you need anything else |
Yes, I have the same problem, it appeared when I "splitted" my graph into multiple subgraphs. |
@bracesproul Here is the code to reproduce import {
Annotation,
END,
InMemoryStore,
LangGraphRunnableConfig,
MessagesAnnotation,
START,
StateGraph,
} from '@langchain/langgraph';
export const GraphState = Annotation.Root({
...MessagesAnnotation.spec,
});
const rootNode = (state: typeof GraphState.State, config: LangGraphRunnableConfig) => {
return state;
};
const subGraphNode = async (state: typeof GraphState.State, config: LangGraphRunnableConfig) => {
const userMainGoals = await config.store?.get(['test', 'preferences'], 'userMainGoals');
return state;
};
const notWorkingSubWorkflow = new StateGraph(GraphState)
.addNode('rootNode', rootNode)
.addNode('subGraphNode', subGraphNode)
.addEdge(START, 'rootNode')
.addEdge('rootNode', 'subGraphNode')
.addEdge('subGraphNode', END)
.compile();
const notWorkingWorkflow = new StateGraph(GraphState)
.addNode('rootNode', rootNode)
.addNode('notWorkingSubWorkflow', notWorkingSubWorkflow)
.addEdge(START, 'rootNode')
.addEdge('rootNode', 'notWorkingSubWorkflow')
.addEdge('notWorkingSubWorkflow', END);
const workingWorkflow = new StateGraph(GraphState)
.addNode('rootNode', rootNode)
.addNode('subGraphNode', subGraphNode)
.addEdge(START, 'rootNode')
.addEdge('rootNode', 'subGraphNode')
.addEdge('subGraphNode', END);
export const testNotWorking = async () => {
const store = new InMemoryStore();
await notWorkingWorkflow.compile({ store: store }).invoke({});
};
export const testWorking = async () => {
const store = new InMemoryStore();
await workingWorkflow.compile({ store: store }).invoke({});
}; |
When I run a graph with this node, I get the following error:
Looking at the error, it seems to be because the store gets double wrapped...
This is what "store" looks like in the original graph
This is what "store" looks like in the parent graph
I think this is a bug, and if not the docs need to be updated! please can you advise...
The text was updated successfully, but these errors were encountered: