RemoveMessage id error #250

Closed
opened 2026-02-15 18:15:03 -05:00 by yindo · 2 comments
Owner

Originally created by @JiaErGen on GitHub (May 5, 2025).

Image

https://langchain-ai.github.io/langgraphjs/how-tos/delete-messages/#build-the-agent

Image

Image

Originally created by @JiaErGen on GitHub (May 5, 2025). ![Image](https://github.com/user-attachments/assets/dd3b3339-27d5-4773-aafa-e96b11d8b346) https://langchain-ai.github.io/langgraphjs/how-tos/delete-messages/#build-the-agent ![Image](https://github.com/user-attachments/assets/b5e9b996-a370-4aa8-bff3-36d0cd88eade) ![Image](https://github.com/user-attachments/assets/d12fafe5-9df7-45a4-8f95-423f442b3213)
yindo closed this issue 2026-02-15 18:15:03 -05:00
Author
Owner

@JiaErGen commented on GitHub (May 6, 2025):

Image
I used this state

@JiaErGen commented on GitHub (May 6, 2025): ![Image](https://github.com/user-attachments/assets/10f6351a-c2f0-4695-a7ef-25a28964aa72) I used this state
Author
Owner

@JiaErGen commented on GitHub (May 6, 2025):

import { Annotation, MessagesAnnotation } from "@langchain/langgraph";

const StateWithDocuments = Annotation.Root({
...MessagesAnnotation.spec, // Spread in the messages state
documents: Annotation<string[]>,
});

https://langchain-ai.github.io/langgraphjs/concepts/low_level/#messagesannotation
I solved the problem with this code

@JiaErGen commented on GitHub (May 6, 2025): import { Annotation, MessagesAnnotation } from "@langchain/langgraph"; const StateWithDocuments = Annotation.Root({ ...MessagesAnnotation.spec, // Spread in the messages state documents: Annotation<string[]>, }); https://langchain-ai.github.io/langgraphjs/concepts/low_level/#messagesannotation I solved the problem with this code
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraphjs#250