Skip to content
This repository was archived by the owner on Jul 29, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ env:
PYTHONUNBUFFERED: "1"
FORCE_COLOR: "1"
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
COHERE_API_KEY: ${{ secrets.COHERE_API_KEY }}
MEM0_API_KEY: ${{ secrets.MEM0_API_KEY }}
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
AWS_REGION: "us-east-1"
jobs:
linting:
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ that includes it. Once it reaches the end of its lifespan, the experiment will b
| [`Agent`][17]; [`BreakpointConfirmationStrategy`][20]; [`HITLBreakpointException`][22] | Human in the Loop via Breakpoints | December 2025 | None | None | [Discuss][23] |
| [`LLMSummarizer`][24] | Document Summarizer | January 2025 | None | None | [Discuss][25] |
| [`InMemoryChatMessageStore`][1]; [`ChatMessageRetriever`][2]; [`ChatMessageWriter`][3] | Chat Message Store, Retriever, Writer | February 2025 | None | <a href="https://colab.research.google.com/github/deepset-ai/haystack-cookbook/blob/main/notebooks/conversational_rag_using_memory.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/> | [Discuss][4] |
| [`Mem0MemoryStore`][26] | MemoryStore | April 2025 | mem0ai | None | -- |

[1]: https://github.com/deepset-ai/haystack-experimental/blob/main/haystack_experimental/chat_message_stores/in_memory.py
[2]: https://github.com/deepset-ai/haystack-experimental/blob/main/haystack_experimental/components/retrievers/chat_message_retriever.py
Expand All @@ -64,7 +63,6 @@ that includes it. Once it reaches the end of its lifespan, the experiment will b
[23]: https://github.com/deepset-ai/haystack-experimental/discussions/381
[24]: https://github.com/deepset-ai/haystack-experimental/blob/main/haystack_experimental/components/sumarizers/llm_summarizer.py
[25]: https://github.com/deepset-ai/haystack-experimental/discussions/382
[26]: https://github.com/deepset-ai/haystack-experimental/blob/main/haystack_experimental/memory_stores/mem0/memory_store.py

### Adopted experiments
| Name | Type | Final release |
Expand All @@ -82,6 +80,7 @@ that includes it. Once it reaches the end of its lifespan, the experiment will b
| `MultiQueryTextRetriever` | MultiQueryTextRetriever | 0.14.3 |
| `EmbeddingBasedDocumentSplitter` | Document Splitting | 0.15.2 |
| `Confirmation Policies`; `ConfirmationUIs`; `BlockingConfirmationStrategy`; `ConfirmationUIResult`; `ToolExecutionDecision` | Human in the Loop | 0.16.0 |
| `Mem0MemoryStore` | MemoryStore | 0.19.0 |

### Discontinued experiments

Expand Down
78 changes: 0 additions & 78 deletions haystack_experimental/components/agents/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
from haystack_experimental.components.agents.human_in_the_loop import HITLBreakpointException
from haystack_experimental.components.retrievers import ChatMessageRetriever
from haystack_experimental.components.writers import ChatMessageWriter
from haystack_experimental.memory_stores.types import MemoryStore

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -123,7 +122,6 @@ def __init__( # noqa: PLR0913
confirmation_strategies: dict[str | tuple[str, ...], ConfirmationStrategy] | None = None,
tool_invoker_kwargs: dict[str, Any] | None = None,
chat_message_store: ChatMessageStore | None = None,
memory_store: MemoryStore | None = None,
) -> None:
"""
Initialize the agent component.
Expand All @@ -149,7 +147,6 @@ def __init__( # noqa: PLR0913
:param tool_invoker_kwargs: Additional keyword arguments to pass to the ToolInvoker.
:param chat_message_store: The ChatMessageStore that the agent can use to store
and retrieve chat messages history.
:param memory_store: The memory store that the agent can use to store and retrieve memories.
:raises TypeError: If the chat_generator does not support tools parameter in its run method.
:raises ValueError: If the exit_conditions are not valid.
"""
Expand All @@ -174,7 +171,6 @@ def __init__( # noqa: PLR0913
self._chat_message_writer = (
ChatMessageWriter(chat_message_store=chat_message_store) if chat_message_store else None
)
self._memory_store = memory_store

def _initialize_fresh_execution(
self,
Expand All @@ -188,7 +184,6 @@ def _initialize_fresh_execution(
tools: ToolsType | list[str] | None = None,
confirmation_strategy_context: dict[str, Any] | None = None,
chat_message_store_kwargs: dict[str, Any] | None = None,
memory_store_kwargs: dict[str, Any] | None = None,
**kwargs: dict[str, Any],
) -> _ExecutionContext:
"""
Expand All @@ -203,9 +198,6 @@ def _initialize_fresh_execution(
:param tools: Optional list of Tool objects, a Toolset, or list of tool names to use for this run.
When passing tool names, tools are selected from the Agent's originally configured tools.

:param memory_store_kwargs: Optional dictionary of keyword arguments to pass to the MemoryStore.
For example, it can include the `user_id`, `run_id`, and `agent_id` parameters
for storing and retrieving memories.
:param confirmation_strategy_context: Optional dictionary for passing request-scoped resources
to confirmation strategies.
:param chat_message_store_kwargs: Optional dictionary of keyword arguments to pass to the ChatMessageStore.
Expand All @@ -225,28 +217,6 @@ def _initialize_fresh_execution(
**kwargs,
)

# NOTE: difference with parent method to add memory retrieval
if self._memory_store and messages:
retrieved_memories = self._memory_store.search_memories(
query=messages[-1].text, **memory_store_kwargs if memory_store_kwargs else {}
)
# we combine the memories into a single string
combined_memory = "\n".join(
f"- MEMORY #{idx + 1}: {memory.text}" for idx, memory in enumerate(retrieved_memories)
)
retrieved_memory = ChatMessage.from_system(text=combined_memory)
memory_instruction = (
"\n\nWhen messages start with `[MEMORY]`, treat them as long-term context and use them to guide the "
"response if relevant."
)
new_system_message = ChatMessage.from_system(text=f"{system_prompt}{memory_instruction}")
memory_system_message = ChatMessage.from_system(
text=f"Here are the relevant memories for the user's query: {retrieved_memory.text}"
)
new_chat_history = [new_system_message] + messages + [memory_system_message]
# We replace the messages in state with the new chat history including memories
exe_context.state.set("messages", new_chat_history, handler_override=replace_values)

# NOTE: difference with parent method to add chat message retrieval
if self._chat_message_retriever:
retriever_kwargs = _select_kwargs(self._chat_message_retriever, chat_message_store_kwargs or {})
Expand Down Expand Up @@ -321,7 +291,6 @@ def run( # type: ignore[override] # noqa: PLR0915 PLR0912 C901
tools: ToolsType | list[str] | None = None,
confirmation_strategy_context: dict[str, Any] | None = None,
chat_message_store_kwargs: dict[str, Any] | None = None,
memory_store_kwargs: dict[str, Any] | None = None,
**kwargs: Any,
) -> dict[str, Any]:
"""
Expand All @@ -347,19 +316,6 @@ def run( # type: ignore[override] # noqa: PLR0915 PLR0912 C901
can use for non-blocking user interaction.
:param chat_message_store_kwargs: Optional dictionary of keyword arguments to pass to the ChatMessageStore.
For example, it can include the `chat_history_id` and `last_k` parameters for retrieving chat history.
:param memory_store_kwargs: Optional dictionary of keyword arguments to pass to the MemoryStore.
It can include:
- `user_id`: The user ID to search and add memories from.
- `run_id`: The run ID to search and add memories from.
- `agent_id`: The agent ID to search and add memories from.
- `search_criteria`: A dictionary of containing kwargs for the `search_memories` method.
This can include:
- `filters`: A dictionary of filters to search for memories.
- `query`: The query to search for memories.
Note: If you pass this, the user query passed to the agent will be
ignored for memory retrieval.
- `top_k`: The number of memories to return.
- `include_memory_metadata`: Whether to include the memory metadata in the ChatMessage.
:param kwargs: Additional data to pass to the State schema used by the Agent.
The keys must match the schema defined in the Agent's `state_schema`.
:returns:
Expand All @@ -370,7 +326,6 @@ def run( # type: ignore[override] # noqa: PLR0915 PLR0912 C901
:raises RuntimeError: If the Agent component wasn't warmed up before calling `run()`.
:raises BreakpointException: If an agent breakpoint is triggered.
"""
memory_store_kwargs = memory_store_kwargs or {}

agent_inputs = {
"messages": messages,
Expand Down Expand Up @@ -407,7 +362,6 @@ def run( # type: ignore[override] # noqa: PLR0915 PLR0912 C901
tools=tools,
confirmation_strategy_context=confirmation_strategy_context,
chat_message_store_kwargs=chat_message_store_kwargs,
memory_store_kwargs=memory_store_kwargs,
**kwargs,
)

Expand Down Expand Up @@ -564,11 +518,6 @@ def run( # type: ignore[override] # noqa: PLR0915 PLR0912 C901
if msgs := result.get("messages"):
result["last_message"] = msgs[-1]

# Add the new conversation as memories to the memory store
if self._memory_store:
new_memories = [message for message in msgs if message.role.value != "system"]
self._memory_store.add_memories(messages=new_memories, **memory_store_kwargs)

# Write messages to ChatMessageStore if configured
if self._chat_message_writer:
writer_kwargs = _select_kwargs(self._chat_message_writer, chat_message_store_kwargs or {})
Expand All @@ -590,7 +539,6 @@ async def run_async( # type: ignore[override] # noqa: PLR0915 PLR0912
tools: ToolsType | list[str] | None = None,
confirmation_strategy_context: dict[str, Any] | None = None,
chat_message_store_kwargs: dict[str, Any] | None = None,
memory_store_kwargs: dict[str, Any] | None = None,
**kwargs: Any,
) -> dict[str, Any]:
"""
Expand Down Expand Up @@ -619,19 +567,6 @@ async def run_async( # type: ignore[override] # noqa: PLR0915 PLR0912
can use for non-blocking user interaction.
:param chat_message_store_kwargs: Optional dictionary of keyword arguments to pass to the ChatMessageStore.
For example, it can include the `chat_history_id` and `last_k` parameters for retrieving chat history.
:param memory_store_kwargs: Optional dictionary of keyword arguments to pass to the MemoryStore.
It can include:
- `user_id`: The user ID to search and add memories from.
- `run_id`: The run ID to search and add memories from.
- `agent_id`: The agent ID to search and add memories from.
- `search_criteria`: A dictionary of containing kwargs for the `search_memories` method.
This can include:
- `filters`: A dictionary of filters to search for memories.
- `query`: The query to search for memories.
Note: If you pass this, the user query passed to the agent will be
ignored for memory retrieval.
- `top_k`: The number of memories to return.
- `include_memory_metadata`: Whether to include the memory metadata in the ChatMessage.
:param kwargs: Additional data to pass to the State schema used by the Agent.
The keys must match the schema defined in the Agent's `state_schema`.
:returns:
Expand All @@ -642,7 +577,6 @@ async def run_async( # type: ignore[override] # noqa: PLR0915 PLR0912
:raises RuntimeError: If the Agent component wasn't warmed up before calling `run_async()`.
:raises BreakpointException: If an agent breakpoint is triggered.
"""
memory_store_kwargs = memory_store_kwargs or {}

agent_inputs = {
"messages": messages,
Expand Down Expand Up @@ -676,7 +610,6 @@ async def run_async( # type: ignore[override] # noqa: PLR0915 PLR0912
tools=tools,
confirmation_strategy_context=confirmation_strategy_context,
chat_message_store_kwargs=chat_message_store_kwargs,
memory_store_kwargs=memory_store_kwargs,
**kwargs,
)

Expand Down Expand Up @@ -820,11 +753,6 @@ async def run_async( # type: ignore[override] # noqa: PLR0915 PLR0912
if msgs := result.get("messages"):
result["last_message"] = msgs[-1]

# Add the new conversation as memories to the memory store
if self._memory_store:
new_memories = [message for message in msgs if message.role.value != "system"]
self._memory_store.add_memories(messages=new_memories, **memory_store_kwargs)

# Write messages to ChatMessageStore if configured
if self._chat_message_writer:
writer_kwargs = _select_kwargs(self._chat_message_writer, chat_message_store_kwargs or {})
Expand All @@ -844,9 +772,6 @@ def to_dict(self) -> dict[str, Any]:
data["init_parameters"]["chat_message_store"] = (
self._chat_message_store.to_dict() if self._chat_message_store is not None else None
)
data["init_parameters"]["memory_store"] = (
self._memory_store.to_dict() if self._memory_store is not None else None
)
return data

@classmethod
Expand Down Expand Up @@ -888,9 +813,6 @@ def from_dict(cls, data: dict[str, Any]) -> "Agent":
if "chat_message_store" in init_params and init_params["chat_message_store"] is not None:
deserialize_component_inplace(init_params, key="chat_message_store")

if "memory_store" in init_params and init_params["memory_store"] is not None:
deserialize_component_inplace(init_params, key="memory_store")

return default_from_dict(cls, data)


Expand Down
7 changes: 0 additions & 7 deletions haystack_experimental/memory_stores/__init__.py

This file was deleted.

16 changes: 0 additions & 16 deletions haystack_experimental/memory_stores/mem0/__init__.py

This file was deleted.

Loading
Loading