diff --git a/docs/docs/tutorials/get-started/3-add-memory.md b/docs/docs/tutorials/get-started/3-add-memory.md index cffc9cb47..7b6c28085 100644 --- a/docs/docs/tutorials/get-started/3-add-memory.md +++ b/docs/docs/tutorials/get-started/3-add-memory.md @@ -426,10 +426,9 @@ const State = z.object({ const tools = [new TavilySearch({ maxResults: 2 })]; const llm = new ChatOpenAI({ model: "gpt-4o-mini" }).bindTools(tools); +// highlight-next-line const memory = new MemorySaver(); -async function generateText(content: string) { - const graph = new StateGraph(State) .addNode("chatbot", async (state) => ({ messages: [await llm.invoke(state.messages)], @@ -438,6 +437,7 @@ const graph = new StateGraph(State) .addConditionalEdges("chatbot", toolsCondition, ["tools", END]) .addEdge("tools", "chatbot") .addEdge(START, "chatbot") + // highlight-next-line .compile({ checkpointer: memory }); ```