🐛 Bug: RemoveMessage Does Not Remove Messages from State #726

Closed
opened 2026-02-20 17:41:27 -05:00 by yindo · 2 comments
Owner

Originally created by @SKNahin on GitHub (Jun 15, 2025).

Checked other resources

  • This is a bug, not a usage question. For questions, please use GitHub Discussions.
  • I added a clear and detailed title that summarizes the issue.
  • I read what a minimal reproducible example is (https://stackoverflow.com/help/minimal-reproducible-example).
  • I included a self-contained, minimal example that demonstrates the issue INCLUDING all the relevant imports. The code run AS IS to reproduce the issue.

Example Code

from typing import Annotated, TypedDict

from langchain_core.messages import HumanMessage, AIMessage, RemoveMessage
from langchain_core.tools import tool
from langgraph.checkpoint.memory import MemorySaver
from langgraph.graph import END, START, StateGraph
from typing_extensions import TypedDict
from langgraph.graph.message import AnyMessage, add_messages

class State(TypedDict):
    messages: Annotated[list[AnyMessage], add_messages]

class Assistant:
    def __init__(self):
        pass

    def __call__(self, state: State):
        result = "Assistant's response."
        return {"messages": AIMessage(content=result)}

graph_builder = StateGraph(State)
graph_builder.add_node("assistant", Assistant())
graph_builder.add_edge(START, "assistant")
graph_builder.add_edge("assistant", END)
graph_memory = MemorySaver()
graph = graph_builder.compile(checkpointer=graph_memory)

config = {"configurable": {"thread_id": "1"}, "checkpoint": graph_memory}
for i in range(3):
    response = graph.invoke({"messages": [HumanMessage(content="Hi")]},config=config)

present_state = graph.get_state(config=config)
history = present_state.values.get("messages", [])
print("History Before removal:", history)

to_remove_ids = [x.id for x in history][-2:]
print("History IDs to remove:", to_remove_ids)

for idd in to_remove_ids:
    graph.update_state(present_state.config, {"messages": RemoveMessage(id=idd)})

print("History After removal:", graph.get_state(present_state.config).values.get("messages",[]))
print(history==graph.get_state(present_state.config).values.get("messages",[]))

Error Message and Stack Trace (if applicable)


Description

When calling graph.update_state() with RemoveMessage, messages are not being removed from the conversation state. The state remains unchanged even after the removal call, and RemoveMessage appears to have no effect.

Reproduction

Code:

from typing import Annotated, TypedDict

from langchain_core.messages import HumanMessage, AIMessage, RemoveMessage
from langchain_core.tools import tool
from langgraph.checkpoint.memory import MemorySaver
from langgraph.graph import END, START, StateGraph
from typing_extensions import TypedDict
from langgraph.graph.message import AnyMessage, add_messages

class State(TypedDict):
    messages: Annotated[list[AnyMessage], add_messages]

class Assistant:
    def __init__(self):
        pass

    def __call__(self, state: State):
        result = "Assistant's response."
        return {"messages": AIMessage(content=result)}

graph_builder = StateGraph(State)
graph_builder.add_node("assistant", Assistant())
graph_builder.add_edge(START, "assistant")
graph_builder.add_edge("assistant", END)
graph_memory = MemorySaver()
graph = graph_builder.compile(checkpointer=graph_memory)

config = {"configurable": {"thread_id": "1"}, "checkpoint": graph_memory}
for i in range(3):
    response = graph.invoke({"messages": [HumanMessage(content="Hi")]},config=config)

present_state = graph.get_state(config=config)
history = present_state.values.get("messages", [])
print("History Before removal:", history)

to_remove_ids = [x.id for x in history][-2:]
print("History IDs to remove:", to_remove_ids)

for idd in to_remove_ids:
    graph.update_state(present_state.config, {"messages": RemoveMessage(id=idd)})

print("History After removal:", graph.get_state(present_state.config).values.get("messages",[]))
print(history==graph.get_state(present_state.config).values.get("messages",[]))

Output:

History Before removal: [
  HumanMessage(content='Hi', id='8e11a645-c071-4339-8abd-a130c9fb27a3'), 
  AIMessage(content="Assistant's response.", id='11425ddb-333d-4bf1-bacb-89e1fbc0d8d6'), 
  HumanMessage(content='Hi', id='2e97f478-d82c-40ae-a3bc-9afa1a8ec4fb'), 
  AIMessage(content="Assistant's response.", id='a682d39c-47bf-46c3-bff1-d899c2d4037f'), 
  HumanMessage(content='Hi', id='3fa9e709-50e1-407f-b430-9d358681bba9'), 
  AIMessage(content="Assistant's response.", id='8ef1748c-b100-424f-b753-a74e937bbf69')
]
History IDs to remove: [
  '3fa9e709-50e1-407f-b430-9d358681bba9', 
  '8ef1748c-b100-424f-b753-a74e937bbf69'
]
History After removal: [
  HumanMessage(content='Hi', id='8e11a645-c071-4339-8abd-a130c9fb27a3'), 
  AIMessage(content="Assistant's response.", id='11425ddb-333d-4bf1-bacb-89e1fbc0d8d6'), 
  HumanMessage(content='Hi', id='2e97f478-d82c-40ae-a3bc-9afa1a8ec4fb'), 
  AIMessage(content="Assistant's response.", id='a682d39c-47bf-46c3-bff1-d899c2d4037f'), 
  HumanMessage(content='Hi', id='3fa9e709-50e1-407f-b430-9d358681bba9'), 
  AIMessage(content="Assistant's response.", id='8ef1748c-b100-424f-b753-a74e937bbf69')
]
True

The state remains the same before and after attempting to remove messages. The final comparison prints True, indicating that RemoveMessage did not work. Messages with the given IDs should be removed from the state after calling update_state with RemoveMessage.

System Info

System Information

OS: Linux
OS Version: #1 SMP Debian 5.10.237-1 (2025-05-19)
Python Version: 3.11.11 (main, Dec 11 2024, 16:28:39) [GCC 11.2.0]

Package Information

langchain_core: 0.3.63
langchain: 0.3.19
langchain_community: 0.3.17
langsmith: 0.3.42
langchain_anthropic: 0.3.7
langchain_fireworks: 0.2.5
langchain_groq: 0.2.4
langchain_openai: 0.3.6
langchain_text_splitters: 0.3.6
langgraph_sdk: 0.1.70

Optional packages not installed

langserve

Other Dependencies

aiohttp: 3.11.10
aiohttp<4.0.0,>=3.8.3: Installed. No version info available.
anthropic<1,>=0.45.0: Installed. No version info available.
async-timeout<5.0.0,>=4.0.0;: Installed. No version info available.
dataclasses-json<0.7,>=0.5.7: Installed. No version info available.
fireworks-ai: 0.17.15
groq: 0.25.0
httpx: 0.28.1
httpx-sse<1.0.0,>=0.4.0: Installed. No version info available.
httpx>=0.25.2: Installed. No version info available.
jsonpatch<2.0,>=1.33: Installed. No version info available.
langchain-anthropic;: Installed. No version info available.
langchain-aws;: Installed. No version info available.
langchain-cohere;: Installed. No version info available.
langchain-community;: Installed. No version info available.
langchain-core<1.0.0,>=0.3.34: Installed. No version info available.
langchain-core<1.0.0,>=0.3.35: Installed. No version info available.
langchain-deepseek;: Installed. No version info available.
langchain-fireworks;: Installed. No version info available.
langchain-google-genai;: Installed. No version info available.
langchain-google-vertexai;: Installed. No version info available.
langchain-groq;: Installed. No version info available.
langchain-huggingface;: Installed. No version info available.
langchain-mistralai;: Installed. No version info available.
langchain-ollama;: Installed. No version info available.
langchain-openai;: Installed. No version info available.
langchain-text-splitters<1.0.0,>=0.3.6: Installed. No version info available.
langchain-together;: Installed. No version info available.
langchain-xai;: Installed. No version info available.
langchain<1.0.0,>=0.3.18: Installed. No version info available.
langsmith-pyo3: Installed. No version info available.
langsmith<0.4,>=0.1.125: Installed. No version info available.
langsmith<0.4,>=0.1.126: Installed. No version info available.
langsmith<0.4,>=0.1.17: Installed. No version info available.
numpy<2,>=1.26.4;: Installed. No version info available.
numpy<3,>=1.26.2;: Installed. No version info available.
openai: 1.82.0
openai-agents: Installed. No version info available.
openai<2.0.0,>=1.58.1: Installed. No version info available.
opentelemetry-api: 1.33.1
opentelemetry-exporter-otlp-proto-http: Installed. No version info available.
opentelemetry-sdk: Installed. No version info available.
orjson: 3.10.18
orjson>=3.10.1: Installed. No version info available.
packaging: 24.2
packaging<25,>=23.2: Installed. No version info available.
pydantic: 2.9.2
pydantic-settings<3.0.0,>=2.4.0: Installed. No version info available.
pydantic<3.0.0,>=2.7.4: Installed. No version info available.
pydantic>=2.7.4: Installed. No version info available.
pytest: Installed. No version info available.
PyYAML>=5.3: Installed. No version info available.
requests: 2.31.0
requests-toolbelt: 1.0.0
requests<3,>=2: Installed. No version info available.
rich: 14.0.0
SQLAlchemy<3,>=1.4: Installed. No version info available.
tenacity!=8.4.0,<10,>=8.1.0: Installed. No version info available.
tenacity!=8.4.0,<10.0.0,>=8.1.0: Installed. No version info available.
tiktoken<1,>=0.7: Installed. No version info available.
typing-extensions>=4.7: Installed. No version info available.
zstandard: 0.23.0

Originally created by @SKNahin on GitHub (Jun 15, 2025). ### Checked other resources - [x] This is a bug, not a usage question. For questions, please use GitHub Discussions. - [x] I added a clear and detailed title that summarizes the issue. - [x] I read what a minimal reproducible example is (https://stackoverflow.com/help/minimal-reproducible-example). - [x] I included a self-contained, minimal example that demonstrates the issue INCLUDING all the relevant imports. The code run AS IS to reproduce the issue. ### Example Code ```python from typing import Annotated, TypedDict from langchain_core.messages import HumanMessage, AIMessage, RemoveMessage from langchain_core.tools import tool from langgraph.checkpoint.memory import MemorySaver from langgraph.graph import END, START, StateGraph from typing_extensions import TypedDict from langgraph.graph.message import AnyMessage, add_messages class State(TypedDict): messages: Annotated[list[AnyMessage], add_messages] class Assistant: def __init__(self): pass def __call__(self, state: State): result = "Assistant's response." return {"messages": AIMessage(content=result)} graph_builder = StateGraph(State) graph_builder.add_node("assistant", Assistant()) graph_builder.add_edge(START, "assistant") graph_builder.add_edge("assistant", END) graph_memory = MemorySaver() graph = graph_builder.compile(checkpointer=graph_memory) config = {"configurable": {"thread_id": "1"}, "checkpoint": graph_memory} for i in range(3): response = graph.invoke({"messages": [HumanMessage(content="Hi")]},config=config) present_state = graph.get_state(config=config) history = present_state.values.get("messages", []) print("History Before removal:", history) to_remove_ids = [x.id for x in history][-2:] print("History IDs to remove:", to_remove_ids) for idd in to_remove_ids: graph.update_state(present_state.config, {"messages": RemoveMessage(id=idd)}) print("History After removal:", graph.get_state(present_state.config).values.get("messages",[])) print(history==graph.get_state(present_state.config).values.get("messages",[])) ``` ### Error Message and Stack Trace (if applicable) ```shell ``` ### Description When calling `graph.update_state()` with `RemoveMessage`, messages are not being removed from the conversation state. The state remains unchanged even after the removal call, and `RemoveMessage` appears to have no effect. ### **Reproduction** #### **Code:** ```python from typing import Annotated, TypedDict from langchain_core.messages import HumanMessage, AIMessage, RemoveMessage from langchain_core.tools import tool from langgraph.checkpoint.memory import MemorySaver from langgraph.graph import END, START, StateGraph from typing_extensions import TypedDict from langgraph.graph.message import AnyMessage, add_messages class State(TypedDict): messages: Annotated[list[AnyMessage], add_messages] class Assistant: def __init__(self): pass def __call__(self, state: State): result = "Assistant's response." return {"messages": AIMessage(content=result)} graph_builder = StateGraph(State) graph_builder.add_node("assistant", Assistant()) graph_builder.add_edge(START, "assistant") graph_builder.add_edge("assistant", END) graph_memory = MemorySaver() graph = graph_builder.compile(checkpointer=graph_memory) config = {"configurable": {"thread_id": "1"}, "checkpoint": graph_memory} for i in range(3): response = graph.invoke({"messages": [HumanMessage(content="Hi")]},config=config) present_state = graph.get_state(config=config) history = present_state.values.get("messages", []) print("History Before removal:", history) to_remove_ids = [x.id for x in history][-2:] print("History IDs to remove:", to_remove_ids) for idd in to_remove_ids: graph.update_state(present_state.config, {"messages": RemoveMessage(id=idd)}) print("History After removal:", graph.get_state(present_state.config).values.get("messages",[])) print(history==graph.get_state(present_state.config).values.get("messages",[])) ``` #### **Output:** ``` History Before removal: [ HumanMessage(content='Hi', id='8e11a645-c071-4339-8abd-a130c9fb27a3'), AIMessage(content="Assistant's response.", id='11425ddb-333d-4bf1-bacb-89e1fbc0d8d6'), HumanMessage(content='Hi', id='2e97f478-d82c-40ae-a3bc-9afa1a8ec4fb'), AIMessage(content="Assistant's response.", id='a682d39c-47bf-46c3-bff1-d899c2d4037f'), HumanMessage(content='Hi', id='3fa9e709-50e1-407f-b430-9d358681bba9'), AIMessage(content="Assistant's response.", id='8ef1748c-b100-424f-b753-a74e937bbf69') ] History IDs to remove: [ '3fa9e709-50e1-407f-b430-9d358681bba9', '8ef1748c-b100-424f-b753-a74e937bbf69' ] History After removal: [ HumanMessage(content='Hi', id='8e11a645-c071-4339-8abd-a130c9fb27a3'), AIMessage(content="Assistant's response.", id='11425ddb-333d-4bf1-bacb-89e1fbc0d8d6'), HumanMessage(content='Hi', id='2e97f478-d82c-40ae-a3bc-9afa1a8ec4fb'), AIMessage(content="Assistant's response.", id='a682d39c-47bf-46c3-bff1-d899c2d4037f'), HumanMessage(content='Hi', id='3fa9e709-50e1-407f-b430-9d358681bba9'), AIMessage(content="Assistant's response.", id='8ef1748c-b100-424f-b753-a74e937bbf69') ] True ``` The state remains the same before and after attempting to remove messages. The final comparison prints `True`, indicating that `RemoveMessage` did not work. Messages with the given IDs should be removed from the state after calling `update_state` with `RemoveMessage`. ### System Info System Information ------------------ > OS: Linux > OS Version: #1 SMP Debian 5.10.237-1 (2025-05-19) > Python Version: 3.11.11 (main, Dec 11 2024, 16:28:39) [GCC 11.2.0] Package Information ------------------- > langchain_core: 0.3.63 > langchain: 0.3.19 > langchain_community: 0.3.17 > langsmith: 0.3.42 > langchain_anthropic: 0.3.7 > langchain_fireworks: 0.2.5 > langchain_groq: 0.2.4 > langchain_openai: 0.3.6 > langchain_text_splitters: 0.3.6 > langgraph_sdk: 0.1.70 Optional packages not installed ------------------------------- > langserve Other Dependencies ------------------ > aiohttp: 3.11.10 > aiohttp<4.0.0,>=3.8.3: Installed. No version info available. > anthropic<1,>=0.45.0: Installed. No version info available. > async-timeout<5.0.0,>=4.0.0;: Installed. No version info available. > dataclasses-json<0.7,>=0.5.7: Installed. No version info available. > fireworks-ai: 0.17.15 > groq: 0.25.0 > httpx: 0.28.1 > httpx-sse<1.0.0,>=0.4.0: Installed. No version info available. > httpx>=0.25.2: Installed. No version info available. > jsonpatch<2.0,>=1.33: Installed. No version info available. > langchain-anthropic;: Installed. No version info available. > langchain-aws;: Installed. No version info available. > langchain-cohere;: Installed. No version info available. > langchain-community;: Installed. No version info available. > langchain-core<1.0.0,>=0.3.34: Installed. No version info available. > langchain-core<1.0.0,>=0.3.35: Installed. No version info available. > langchain-deepseek;: Installed. No version info available. > langchain-fireworks;: Installed. No version info available. > langchain-google-genai;: Installed. No version info available. > langchain-google-vertexai;: Installed. No version info available. > langchain-groq;: Installed. No version info available. > langchain-huggingface;: Installed. No version info available. > langchain-mistralai;: Installed. No version info available. > langchain-ollama;: Installed. No version info available. > langchain-openai;: Installed. No version info available. > langchain-text-splitters<1.0.0,>=0.3.6: Installed. No version info available. > langchain-together;: Installed. No version info available. > langchain-xai;: Installed. No version info available. > langchain<1.0.0,>=0.3.18: Installed. No version info available. > langsmith-pyo3: Installed. No version info available. > langsmith<0.4,>=0.1.125: Installed. No version info available. > langsmith<0.4,>=0.1.126: Installed. No version info available. > langsmith<0.4,>=0.1.17: Installed. No version info available. > numpy<2,>=1.26.4;: Installed. No version info available. > numpy<3,>=1.26.2;: Installed. No version info available. > openai: 1.82.0 > openai-agents: Installed. No version info available. > openai<2.0.0,>=1.58.1: Installed. No version info available. > opentelemetry-api: 1.33.1 > opentelemetry-exporter-otlp-proto-http: Installed. No version info available. > opentelemetry-sdk: Installed. No version info available. > orjson: 3.10.18 > orjson>=3.10.1: Installed. No version info available. > packaging: 24.2 > packaging<25,>=23.2: Installed. No version info available. > pydantic: 2.9.2 > pydantic-settings<3.0.0,>=2.4.0: Installed. No version info available. > pydantic<3.0.0,>=2.7.4: Installed. No version info available. > pydantic>=2.7.4: Installed. No version info available. > pytest: Installed. No version info available. > PyYAML>=5.3: Installed. No version info available. > requests: 2.31.0 > requests-toolbelt: 1.0.0 > requests<3,>=2: Installed. No version info available. > rich: 14.0.0 > SQLAlchemy<3,>=1.4: Installed. No version info available. > tenacity!=8.4.0,<10,>=8.1.0: Installed. No version info available. > tenacity!=8.4.0,<10.0.0,>=8.1.0: Installed. No version info available. > tiktoken<1,>=0.7: Installed. No version info available. > typing-extensions>=4.7: Installed. No version info available. > zstandard: 0.23.0
yindo added the bugpending labels 2026-02-20 17:41:27 -05:00
yindo closed this issue 2026-02-20 17:41:27 -05:00
Author
Owner

@hinthornw commented on GitHub (Jun 15, 2025):

I'm afk but at a glance, this looks like a usage issue rather than a bug. It looks like you're always updating from the same checkpoint and then loading that original checkpoint.

Analogy is git branches: it appears that you're starting from some branch and then making three separate branches off that , then you're mistakenly fetching the original branch .

I think. Try it out only providing the config with thread_id (no checkpoint id) and let me know if that works for you. Or you can make sure you're not always using that old "present_config"

If that doesn't work we will TAL when someone has a moment

@hinthornw commented on GitHub (Jun 15, 2025): I'm afk but at a glance, this looks like a usage issue rather than a bug. It looks like you're always updating from the same checkpoint and then loading that original checkpoint. Analogy is git branches: it appears that you're starting from some branch and then making three separate branches off that , then you're mistakenly fetching the original branch . I think. Try it out only providing the config with thread_id (no checkpoint id) and let me know if that works for you. Or you can make sure you're not always using that old "present_config" If that doesn't work we will TAL when someone has a moment
Author
Owner

@SKNahin commented on GitHub (Jun 15, 2025):

@hinthornw
Thank you for your suggestions. Consistently using the config that was declared first has solved my problem. Here is the code and outputs:


code:

from typing import Annotated, TypedDict

from langchain_core.messages import HumanMessage, AIMessage, RemoveMessage
from langchain_core.tools import tool
from langgraph.checkpoint.memory import MemorySaver
from langgraph.graph import END, START, StateGraph
from typing_extensions import TypedDict
from langgraph.graph.message import AnyMessage, add_messages


class State(TypedDict):
    messages: Annotated[list[AnyMessage], add_messages]

class Assistant:
    def __init__(self):
        pass

    def __call__(self, state: State):
        result = "Assistant's response."
        return {"messages": AIMessage(content=result)}


graph_builder = StateGraph(State)
graph_builder.add_node("assistant", Assistant())
graph_builder.add_edge(START, "assistant")
graph_builder.add_edge("assistant", END)
graph_memory = MemorySaver()
graph = graph_builder.compile(checkpointer=graph_memory)


config = {"configurable": {"thread_id": "1"}, "checkpoint": graph_memory}
for i in range(3):
    response = graph.invoke({"messages": [HumanMessage(content="Hi")]},config=config)
    

history = graph.get_state(config=config).values.get("messages", [])
print("History Before removal:", history)
 
to_remove_ids = [x.id for x in history][-2:]

print("History IDs to remove:", to_remove_ids)
for idd in to_remove_ids:
    graph.update_state(config, {"messages": RemoveMessage(id=idd)})

print("History After removal:", graph.get_state(config).values.get("messages",[]))
print(history==graph.get_state(config).values.get("messages",[]))
        

Outputs:

History Before removal: [HumanMessage(content='Hi', additional_kwargs={}, response_metadata={}, id='88e97a99-0bce-453a-ac10-4e412e0dcb84'), AIMessage(content="Assistant's response.", additional_kwargs={}, response_metadata={}, id='6578dcf8-92de-422e-a298-56a75185bd61'), HumanMessage(content='Hi', additional_kwargs={}, response_metadata={}, id='dffa5a02-5371-48c0-b863-87171f99a6d0'), AIMessage(content="Assistant's response.", additional_kwargs={}, response_metadata={}, id='a9743358-f1d2-4bf0-9028-5a5317d17c28'), HumanMessage(content='Hi', additional_kwargs={}, response_metadata={}, id='ee33abdc-39c8-4817-94f2-fd34cabc9b7f'), AIMessage(content="Assistant's response.", additional_kwargs={}, response_metadata={}, id='312fa60d-5887-41e5-8bf1-000c481c9abe')]
History IDs to remove: ['ee33abdc-39c8-4817-94f2-fd34cabc9b7f', '312fa60d-5887-41e5-8bf1-000c481c9abe']
History After removal: [HumanMessage(content='Hi', additional_kwargs={}, response_metadata={}, id='88e97a99-0bce-453a-ac10-4e412e0dcb84'), AIMessage(content="Assistant's response.", additional_kwargs={}, response_metadata={}, id='6578dcf8-92de-422e-a298-56a75185bd61'), HumanMessage(content='Hi', additional_kwargs={}, response_metadata={}, id='dffa5a02-5371-48c0-b863-87171f99a6d0'), AIMessage(content="Assistant's response.", additional_kwargs={}, response_metadata={}, id='a9743358-f1d2-4bf0-9028-5a5317d17c28')]
False
@SKNahin commented on GitHub (Jun 15, 2025): @hinthornw Thank you for your suggestions. Consistently using the config that was declared first has solved my problem. Here is the code and outputs: --- ## code: ``` from typing import Annotated, TypedDict from langchain_core.messages import HumanMessage, AIMessage, RemoveMessage from langchain_core.tools import tool from langgraph.checkpoint.memory import MemorySaver from langgraph.graph import END, START, StateGraph from typing_extensions import TypedDict from langgraph.graph.message import AnyMessage, add_messages class State(TypedDict): messages: Annotated[list[AnyMessage], add_messages] class Assistant: def __init__(self): pass def __call__(self, state: State): result = "Assistant's response." return {"messages": AIMessage(content=result)} graph_builder = StateGraph(State) graph_builder.add_node("assistant", Assistant()) graph_builder.add_edge(START, "assistant") graph_builder.add_edge("assistant", END) graph_memory = MemorySaver() graph = graph_builder.compile(checkpointer=graph_memory) config = {"configurable": {"thread_id": "1"}, "checkpoint": graph_memory} for i in range(3): response = graph.invoke({"messages": [HumanMessage(content="Hi")]},config=config) history = graph.get_state(config=config).values.get("messages", []) print("History Before removal:", history) to_remove_ids = [x.id for x in history][-2:] print("History IDs to remove:", to_remove_ids) for idd in to_remove_ids: graph.update_state(config, {"messages": RemoveMessage(id=idd)}) print("History After removal:", graph.get_state(config).values.get("messages",[])) print(history==graph.get_state(config).values.get("messages",[])) ``` ## Outputs: ``` History Before removal: [HumanMessage(content='Hi', additional_kwargs={}, response_metadata={}, id='88e97a99-0bce-453a-ac10-4e412e0dcb84'), AIMessage(content="Assistant's response.", additional_kwargs={}, response_metadata={}, id='6578dcf8-92de-422e-a298-56a75185bd61'), HumanMessage(content='Hi', additional_kwargs={}, response_metadata={}, id='dffa5a02-5371-48c0-b863-87171f99a6d0'), AIMessage(content="Assistant's response.", additional_kwargs={}, response_metadata={}, id='a9743358-f1d2-4bf0-9028-5a5317d17c28'), HumanMessage(content='Hi', additional_kwargs={}, response_metadata={}, id='ee33abdc-39c8-4817-94f2-fd34cabc9b7f'), AIMessage(content="Assistant's response.", additional_kwargs={}, response_metadata={}, id='312fa60d-5887-41e5-8bf1-000c481c9abe')] History IDs to remove: ['ee33abdc-39c8-4817-94f2-fd34cabc9b7f', '312fa60d-5887-41e5-8bf1-000c481c9abe'] History After removal: [HumanMessage(content='Hi', additional_kwargs={}, response_metadata={}, id='88e97a99-0bce-453a-ac10-4e412e0dcb84'), AIMessage(content="Assistant's response.", additional_kwargs={}, response_metadata={}, id='6578dcf8-92de-422e-a298-56a75185bd61'), HumanMessage(content='Hi', additional_kwargs={}, response_metadata={}, id='dffa5a02-5371-48c0-b863-87171f99a6d0'), AIMessage(content="Assistant's response.", additional_kwargs={}, response_metadata={}, id='a9743358-f1d2-4bf0-9028-5a5317d17c28')] False ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraph#726