aip-agents-binary 0.6.3__py3-none-macosx_13_0_arm64.whl → 0.6.4__py3-none-macosx_13_0_arm64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -54,7 +54,7 @@ from aip_agents.schema.a2a import A2AStreamEventType
54
54
  from aip_agents.schema.hitl import ApprovalDecision, HitlMetadata
55
55
  from aip_agents.schema.langgraph import ToolCallResult, ToolStorageParams
56
56
  from aip_agents.schema.step_limit import MaxStepsExceededError, StepLimitConfig
57
- from aip_agents.tools.memory_search_tool import MEMORY_SEARCH_TOOL_NAME
57
+ from aip_agents.tools.memory_search_tool import MEMORY_DELETE_TOOL_NAME, MEMORY_SEARCH_TOOL_NAME
58
58
  from aip_agents.tools.tool_config_injector import TOOL_CONFIGS_KEY
59
59
  from aip_agents.utils import add_references_chunks
60
60
  from aip_agents.utils.langgraph import (
@@ -584,6 +584,29 @@ class LangGraphReactAgent(LangGraphHitLMixin, BaseLangGraphAgent):
584
584
 
585
585
  return memory_node
586
586
 
587
+ def _should_save_interaction(self, final_state: dict[str, Any] | None) -> bool:
588
+ """Return True when interaction should be saved to memory."""
589
+ if self._contains_memory_delete_action(final_state):
590
+ logger.info("Memory: Skipping save_interaction due to memory delete action in state.")
591
+ return False
592
+ return True
593
+
594
+ @staticmethod
595
+ def _contains_memory_delete_action(final_state: dict[str, Any] | None) -> bool:
596
+ """Return True when final state includes a delete memory action block."""
597
+ if not isinstance(final_state, dict):
598
+ return False
599
+ messages = final_state.get("messages")
600
+ if not isinstance(messages, list):
601
+ return False
602
+ for message in messages:
603
+ content = getattr(message, "content", None)
604
+ if not isinstance(content, str):
605
+ continue
606
+ if "<MEMORY_ACTION>" in content and "action=delete" in content:
607
+ return True
608
+ return False
609
+
587
610
  def _extract_user_query_from_messages(self, messages: list[Any]) -> str | None:
588
611
  """Get latest user query string from a list of messages.
589
612
 
@@ -2277,11 +2300,12 @@ class LangGraphReactAgent(LangGraphHitLMixin, BaseLangGraphAgent):
2277
2300
  """
2278
2301
  try:
2279
2302
  tool_cfgs = metadata.get(TOOL_CONFIGS_KEY, {})
2280
- per_tool_config = tool_cfgs.get(MEMORY_SEARCH_TOOL_NAME)
2281
- if not isinstance(per_tool_config, dict):
2282
- per_tool_config = {}
2283
- per_tool_config["user_id"] = memory_user_id
2284
- tool_cfgs[MEMORY_SEARCH_TOOL_NAME] = per_tool_config
2303
+ for tool_name in (MEMORY_SEARCH_TOOL_NAME, MEMORY_DELETE_TOOL_NAME):
2304
+ per_tool_config = tool_cfgs.get(tool_name)
2305
+ if not isinstance(per_tool_config, dict):
2306
+ per_tool_config = {}
2307
+ per_tool_config["user_id"] = memory_user_id
2308
+ tool_cfgs[tool_name] = per_tool_config
2285
2309
  metadata[TOOL_CONFIGS_KEY] = tool_cfgs
2286
2310
  except Exception as e:
2287
2311
  # Non-fatal; metadata injection is best-effort
@@ -11,7 +11,7 @@ from aip_agents.schema.a2a import A2AStreamEventType as A2AStreamEventType
11
11
  from aip_agents.schema.hitl import ApprovalDecision as ApprovalDecision, HitlMetadata as HitlMetadata
12
12
  from aip_agents.schema.langgraph import ToolCallResult as ToolCallResult, ToolStorageParams as ToolStorageParams
13
13
  from aip_agents.schema.step_limit import MaxStepsExceededError as MaxStepsExceededError, StepLimitConfig as StepLimitConfig
14
- from aip_agents.tools.memory_search_tool import MEMORY_SEARCH_TOOL_NAME as MEMORY_SEARCH_TOOL_NAME
14
+ from aip_agents.tools.memory_search_tool import MEMORY_DELETE_TOOL_NAME as MEMORY_DELETE_TOOL_NAME, MEMORY_SEARCH_TOOL_NAME as MEMORY_SEARCH_TOOL_NAME
15
15
  from aip_agents.tools.tool_config_injector import TOOL_CONFIGS_KEY as TOOL_CONFIGS_KEY
16
16
  from aip_agents.utils import add_references_chunks as add_references_chunks
17
17
  from aip_agents.utils.langgraph import convert_langchain_messages_to_gllm_messages as convert_langchain_messages_to_gllm_messages, convert_lm_output_to_langchain_message as convert_lm_output_to_langchain_message
@@ -185,7 +185,11 @@ class HTTPTransport(Transport):
185
185
  headers = _sanitize_headers(self.config)
186
186
  logger.debug(f"Attempting streamable HTTP connection to {url} with headers: {list(headers.keys())}")
187
187
  try:
188
- http_client = httpx.AsyncClient(timeout=httpx.Timeout(timeout), headers=headers)
188
+ http_client = httpx.AsyncClient(
189
+ timeout=httpx.Timeout(timeout),
190
+ headers=headers,
191
+ follow_redirects=True,
192
+ )
189
193
  self._http_client = http_client
190
194
  self.ctx = streamable_http_client(url=url, http_client=http_client)
191
195
  read_stream, write_stream, _ = await self.ctx.__aenter__()
@@ -256,6 +256,100 @@ class BaseMemoryAdapter(BaseMemory):
256
256
 
257
257
  return [self._chunk_to_hit(chunk) for chunk in chunks]
258
258
 
259
+ def delete_by_query(
260
+ self,
261
+ *,
262
+ query: str,
263
+ user_id: str,
264
+ metadata: dict[str, Any] | None = None,
265
+ threshold: float | None = None,
266
+ top_k: int | None = None,
267
+ categories: list[str] | None = None,
268
+ ) -> Any:
269
+ """Delete memories by semantic query.
270
+
271
+ Args:
272
+ query: Semantic query describing memories to delete.
273
+ user_id: User identifier for the deletion scope.
274
+ metadata: Optional metadata filters to constrain deletion.
275
+ threshold: Optional semantic threshold (if supported by backend).
276
+ top_k: Optional max number of memories to delete by query.
277
+ categories: Optional categories to filter by (best-effort).
278
+
279
+ Returns:
280
+ Backend-specific delete result or None on failure.
281
+ """
282
+ try:
283
+ start = perf_counter()
284
+ result = self._runner.run(
285
+ self._call_manager_with_optional_categories(
286
+ self._manager.delete_by_user_query,
287
+ categories=categories,
288
+ query=query,
289
+ user_id=user_id or self.agent_id,
290
+ agent_id=self.agent_id,
291
+ scopes=DEFAULT_SCOPE,
292
+ metadata=metadata,
293
+ threshold=threshold,
294
+ top_k=top_k,
295
+ )
296
+ )
297
+ duration = perf_counter() - start
298
+ logger.info(
299
+ "BaseMemoryAdapter: delete_by_query user_id='%s' query='%s' completed in %.2fs",
300
+ user_id,
301
+ query,
302
+ duration,
303
+ )
304
+ return result
305
+ except Exception as exc: # noqa: BLE001
306
+ logger.debug("BaseMemoryAdapter.delete_by_query ignored error: %s", exc)
307
+ return None
308
+
309
+ def delete(
310
+ self,
311
+ *,
312
+ memory_ids: list[str] | None,
313
+ user_id: str,
314
+ metadata: dict[str, Any] | None = None,
315
+ categories: list[str] | None = None,
316
+ ) -> Any:
317
+ """Delete memories by IDs or by user scope when IDs are None.
318
+
319
+ Args:
320
+ memory_ids: Optional list of memory IDs to delete.
321
+ user_id: User identifier for the deletion scope.
322
+ metadata: Optional metadata filters to constrain deletion.
323
+ categories: Optional categories to filter by (best-effort).
324
+
325
+ Returns:
326
+ Backend-specific delete result or None on failure.
327
+ """
328
+ try:
329
+ start = perf_counter()
330
+ result = self._runner.run(
331
+ self._call_manager_with_optional_categories(
332
+ self._manager.delete,
333
+ categories=categories,
334
+ memory_ids=memory_ids,
335
+ user_id=user_id or self.agent_id,
336
+ agent_id=self.agent_id,
337
+ scopes=DEFAULT_SCOPE,
338
+ metadata=metadata,
339
+ )
340
+ )
341
+ duration = perf_counter() - start
342
+ logger.info(
343
+ "BaseMemoryAdapter: delete user_id='%s' memory_ids=%s completed in %.2fs",
344
+ user_id,
345
+ "None" if memory_ids is None else len(memory_ids),
346
+ duration,
347
+ )
348
+ return result
349
+ except Exception as exc: # noqa: BLE001
350
+ logger.debug("BaseMemoryAdapter.delete ignored error: %s", exc)
351
+ return None
352
+
259
353
  def save_interaction(self, *, user_text: str, ai_text: str, user_id: str) -> None:
260
354
  """Save a user-AI interaction as memories.
261
355
 
@@ -106,6 +106,32 @@ class BaseMemoryAdapter(BaseMemory):
106
106
  Returns:
107
107
  List of memory hits matching the criteria.
108
108
  """
109
+ def delete_by_query(self, *, query: str, user_id: str, metadata: dict[str, Any] | None = None, threshold: float | None = None, top_k: int | None = None, categories: list[str] | None = None) -> Any:
110
+ """Delete memories by semantic query.
111
+
112
+ Args:
113
+ query: Semantic query describing memories to delete.
114
+ user_id: User identifier for the deletion scope.
115
+ metadata: Optional metadata filters to constrain deletion.
116
+ threshold: Optional semantic threshold (if supported by backend).
117
+ top_k: Optional max number of memories to delete by query.
118
+ categories: Optional categories to filter by (best-effort).
119
+
120
+ Returns:
121
+ Backend-specific delete result or None on failure.
122
+ """
123
+ def delete(self, *, memory_ids: list[str] | None, user_id: str, metadata: dict[str, Any] | None = None, categories: list[str] | None = None) -> Any:
124
+ """Delete memories by IDs or by user scope when IDs are None.
125
+
126
+ Args:
127
+ memory_ids: Optional list of memory IDs to delete.
128
+ user_id: User identifier for the deletion scope.
129
+ metadata: Optional metadata filters to constrain deletion.
130
+ categories: Optional categories to filter by (best-effort).
131
+
132
+ Returns:
133
+ Backend-specific delete result or None on failure.
134
+ """
109
135
  def save_interaction(self, *, user_text: str, ai_text: str, user_id: str) -> None:
110
136
  """Save a user-AI interaction as memories.
111
137
 
@@ -6,17 +6,24 @@ Authors:
6
6
 
7
7
  from aip_agents.tools.memory_search.base import LongTermMemorySearchTool
8
8
  from aip_agents.tools.memory_search.mem0 import (
9
+ MEMORY_DELETE_TOOL_NAME,
9
10
  MEMORY_SEARCH_TOOL_NAME,
11
+ Mem0DeleteInput,
12
+ Mem0DeleteTool,
10
13
  Mem0SearchInput,
11
14
  Mem0SearchTool,
12
15
  )
13
- from aip_agents.tools.memory_search.schema import LongTermMemorySearchInput, MemoryConfig
16
+ from aip_agents.tools.memory_search.schema import LongTermMemoryDeleteInput, LongTermMemorySearchInput, MemoryConfig
14
17
 
15
18
  __all__ = [
16
19
  "MemoryConfig",
20
+ "LongTermMemoryDeleteInput",
17
21
  "LongTermMemorySearchInput",
18
22
  "LongTermMemorySearchTool",
23
+ "Mem0DeleteInput",
24
+ "Mem0DeleteTool",
19
25
  "Mem0SearchInput",
20
26
  "Mem0SearchTool",
27
+ "MEMORY_DELETE_TOOL_NAME",
21
28
  "MEMORY_SEARCH_TOOL_NAME",
22
29
  ]
@@ -1,5 +1,5 @@
1
1
  from aip_agents.tools.memory_search.base import LongTermMemorySearchTool as LongTermMemorySearchTool
2
- from aip_agents.tools.memory_search.mem0 import MEMORY_SEARCH_TOOL_NAME as MEMORY_SEARCH_TOOL_NAME, Mem0SearchInput as Mem0SearchInput, Mem0SearchTool as Mem0SearchTool
3
- from aip_agents.tools.memory_search.schema import LongTermMemorySearchInput as LongTermMemorySearchInput, MemoryConfig as MemoryConfig
2
+ from aip_agents.tools.memory_search.mem0 import MEMORY_DELETE_TOOL_NAME as MEMORY_DELETE_TOOL_NAME, MEMORY_SEARCH_TOOL_NAME as MEMORY_SEARCH_TOOL_NAME, Mem0DeleteInput as Mem0DeleteInput, Mem0DeleteTool as Mem0DeleteTool, Mem0SearchInput as Mem0SearchInput, Mem0SearchTool as Mem0SearchTool
3
+ from aip_agents.tools.memory_search.schema import LongTermMemoryDeleteInput as LongTermMemoryDeleteInput, LongTermMemorySearchInput as LongTermMemorySearchInput, MemoryConfig as MemoryConfig
4
4
 
5
- __all__ = ['MemoryConfig', 'LongTermMemorySearchInput', 'LongTermMemorySearchTool', 'Mem0SearchInput', 'Mem0SearchTool', 'MEMORY_SEARCH_TOOL_NAME']
5
+ __all__ = ['MemoryConfig', 'LongTermMemoryDeleteInput', 'LongTermMemorySearchInput', 'LongTermMemorySearchTool', 'Mem0DeleteInput', 'Mem0DeleteTool', 'Mem0SearchInput', 'Mem0SearchTool', 'MEMORY_DELETE_TOOL_NAME', 'MEMORY_SEARCH_TOOL_NAME']
@@ -13,13 +13,14 @@ from langchain_core.runnables import RunnableConfig
13
13
 
14
14
  from aip_agents.memory.constants import MemoryDefaults
15
15
  from aip_agents.tools.memory_search.base import LongTermMemorySearchTool
16
- from aip_agents.tools.memory_search.schema import LongTermMemorySearchInput
16
+ from aip_agents.tools.memory_search.schema import LongTermMemoryDeleteInput, LongTermMemorySearchInput
17
17
  from aip_agents.utils.datetime import is_valid_date_string, next_day_iso
18
18
  from aip_agents.utils.logger import get_logger
19
19
 
20
20
  logger = get_logger(__name__)
21
21
 
22
22
  MEMORY_SEARCH_TOOL_NAME = "built_in_mem0_search"
23
+ MEMORY_DELETE_TOOL_NAME = "built_in_mem0_delete"
23
24
 
24
25
 
25
26
  class Mem0SearchTool(LongTermMemorySearchTool):
@@ -256,3 +257,109 @@ class Mem0SearchTool(LongTermMemorySearchTool):
256
257
 
257
258
 
258
259
  Mem0SearchInput = LongTermMemorySearchInput
260
+
261
+
262
+ class Mem0DeleteTool(LongTermMemorySearchTool):
263
+ """Mem0-specific implementation of the long-term memory delete tool."""
264
+
265
+ name: str = MEMORY_DELETE_TOOL_NAME
266
+ description: str = (
267
+ "Delete memories from long-term mem0 storage. Supports three modes:\n"
268
+ "1. DELETE BY IDS: Provide 'memory_ids'\n"
269
+ "2. DELETE BY QUERY: Provide 'query'\n"
270
+ "3. DELETE ALL: Provide 'delete_all=true' with no query/IDs\n"
271
+ )
272
+ args_schema: type[LongTermMemoryDeleteInput] = LongTermMemoryDeleteInput
273
+ LOG_PREFIX: ClassVar[str] = "Mem0DeleteTool"
274
+ METADATA_FILTER_BLOCKLIST: ClassVar[set[str]] = {"user_id", "memory_user_id"}
275
+
276
+ async def _arun(
277
+ self,
278
+ query: str | None = None,
279
+ config: RunnableConfig | None = None,
280
+ run_manager: Any | None = None,
281
+ **kwargs: Any,
282
+ ) -> str:
283
+ """Execute the memory delete asynchronously for LangChain.
284
+
285
+ Args:
286
+ query: Semantic delete query when provided.
287
+ config: Runnable configuration containing LangChain metadata.
288
+ run_manager: LangChain callbacks (unused).
289
+ **kwargs: Additional arguments such as ``memory_ids``, ``delete_all``, ``metadata``.
290
+
291
+ Returns:
292
+ str: JSON-encoded delete result or an error message.
293
+ """
294
+ logger.info("%s: Received config: %s", self.LOG_PREFIX, config)
295
+
296
+ memory_ids: list[str] | None = kwargs.get("memory_ids")
297
+ delete_all: bool | None = kwargs.get("delete_all")
298
+ threshold: float | None = kwargs.get("threshold")
299
+ top_k: int | None = kwargs.get("top_k")
300
+ categories: list[str] | None = kwargs.get("categories")
301
+ metadata: dict[str, Any] | None = kwargs.get("metadata")
302
+
303
+ user_id = self._resolve_user_id(metadata=metadata, config=config)
304
+
305
+ metadata_filter = None
306
+ if isinstance(metadata, dict):
307
+ metadata_filter = {k: v for k, v in metadata.items() if k not in self.METADATA_FILTER_BLOCKLIST} or None
308
+
309
+ if memory_ids:
310
+ if not hasattr(self.memory, "delete"):
311
+ return f"Error executing memory tool '{self.name}': backend does not support delete()"
312
+ mode = "ids"
313
+ result = self.memory.delete( # type: ignore[attr-defined]
314
+ memory_ids=memory_ids,
315
+ user_id=user_id,
316
+ metadata=metadata_filter,
317
+ categories=categories,
318
+ )
319
+ elif query:
320
+ if not hasattr(self.memory, "delete_by_query"):
321
+ return f"Error executing memory tool '{self.name}': backend does not support delete_by_query()"
322
+ mode = "query"
323
+ result = self.memory.delete_by_query( # type: ignore[attr-defined]
324
+ query=query,
325
+ user_id=user_id,
326
+ metadata=metadata_filter,
327
+ threshold=threshold,
328
+ top_k=top_k,
329
+ categories=categories,
330
+ )
331
+ elif delete_all:
332
+ if not hasattr(self.memory, "delete"):
333
+ return f"Error executing memory tool '{self.name}': backend does not support delete()"
334
+ mode = "all"
335
+ result = self.memory.delete( # type: ignore[attr-defined]
336
+ memory_ids=None,
337
+ user_id=user_id,
338
+ metadata=metadata_filter,
339
+ categories=categories,
340
+ )
341
+ else:
342
+ return f"Error executing memory tool '{self.name}': provide memory_ids, query, or delete_all=true."
343
+
344
+ count = None
345
+ if isinstance(result, dict):
346
+ count = result.get("count") or result.get("deleted") or result.get("total")
347
+
348
+ logger.info(
349
+ "%s: delete mode=%s user_id='%s' count=%s",
350
+ self.LOG_PREFIX,
351
+ mode,
352
+ user_id,
353
+ count if count is not None else "unknown",
354
+ )
355
+
356
+ payload = {"status": "success", "mode": mode}
357
+ try:
358
+ json.dumps(result)
359
+ payload["result"] = result
360
+ except TypeError:
361
+ payload["result"] = str(result)
362
+ return json.dumps(payload)
363
+
364
+
365
+ Mem0DeleteInput = LongTermMemoryDeleteInput
@@ -1,13 +1,14 @@
1
1
  from _typeshed import Incomplete
2
2
  from aip_agents.memory.constants import MemoryDefaults as MemoryDefaults
3
3
  from aip_agents.tools.memory_search.base import LongTermMemorySearchTool as LongTermMemorySearchTool
4
- from aip_agents.tools.memory_search.schema import LongTermMemorySearchInput as LongTermMemorySearchInput
4
+ from aip_agents.tools.memory_search.schema import LongTermMemoryDeleteInput as LongTermMemoryDeleteInput, LongTermMemorySearchInput as LongTermMemorySearchInput
5
5
  from aip_agents.utils.datetime import is_valid_date_string as is_valid_date_string, next_day_iso as next_day_iso
6
6
  from aip_agents.utils.logger import get_logger as get_logger
7
7
  from typing import ClassVar
8
8
 
9
9
  logger: Incomplete
10
10
  MEMORY_SEARCH_TOOL_NAME: str
11
+ MEMORY_DELETE_TOOL_NAME: str
11
12
 
12
13
  class Mem0SearchTool(LongTermMemorySearchTool):
13
14
  """Mem0-specific implementation of the long-term memory search tool."""
@@ -17,3 +18,12 @@ class Mem0SearchTool(LongTermMemorySearchTool):
17
18
  LOG_PREFIX: ClassVar[str]
18
19
  METADATA_FILTER_BLOCKLIST: ClassVar[set[str]]
19
20
  Mem0SearchInput = LongTermMemorySearchInput
21
+
22
+ class Mem0DeleteTool(LongTermMemorySearchTool):
23
+ """Mem0-specific implementation of the long-term memory delete tool."""
24
+ name: str
25
+ description: str
26
+ args_schema: type[LongTermMemoryDeleteInput]
27
+ LOG_PREFIX: ClassVar[str]
28
+ METADATA_FILTER_BLOCKLIST: ClassVar[set[str]]
29
+ Mem0DeleteInput = LongTermMemoryDeleteInput
@@ -46,3 +46,36 @@ class LongTermMemorySearchInput(BaseModel):
46
46
  None,
47
47
  description="Optional metadata dict to filter by (exact key-value match).",
48
48
  )
49
+
50
+
51
+ class LongTermMemoryDeleteInput(BaseModel):
52
+ """Input schema for unified long-term memory deletion."""
53
+
54
+ query: str | None = Field(
55
+ None,
56
+ description="Semantic query describing memories to delete. If provided, delete_by_user_query is used.",
57
+ )
58
+ memory_ids: list[str] | None = Field(
59
+ None,
60
+ description="Optional list of memory IDs to delete directly.",
61
+ )
62
+ delete_all: bool | None = Field(
63
+ None,
64
+ description="When True and no query/IDs are provided, delete all memories for the user scope.",
65
+ )
66
+ top_k: int | None = Field(
67
+ None,
68
+ description="Optional maximum number of memories to delete by query.",
69
+ )
70
+ threshold: float | None = Field(
71
+ None,
72
+ description="Optional semantic threshold for delete_by_user_query.",
73
+ )
74
+ categories: list[str] | None = Field(
75
+ None,
76
+ description="Optional categories to filter by (uses 'in' operator).",
77
+ )
78
+ metadata: dict[str, Any] | None = Field(
79
+ None,
80
+ description="Optional metadata dict to filter by (exact key-value match).",
81
+ )
@@ -13,3 +13,13 @@ class LongTermMemorySearchInput(BaseModel):
13
13
  limit: int | None
14
14
  categories: list[str] | None
15
15
  metadata: dict[str, Any] | None
16
+
17
+ class LongTermMemoryDeleteInput(BaseModel):
18
+ """Input schema for unified long-term memory deletion."""
19
+ query: str | None
20
+ memory_ids: list[str] | None
21
+ delete_all: bool | None
22
+ top_k: int | None
23
+ threshold: float | None
24
+ categories: list[str] | None
25
+ metadata: dict[str, Any] | None
@@ -8,9 +8,13 @@ Authors:
8
8
  """
9
9
 
10
10
  from aip_agents.tools.memory_search import (
11
+ MEMORY_DELETE_TOOL_NAME,
11
12
  MEMORY_SEARCH_TOOL_NAME,
13
+ LongTermMemoryDeleteInput,
12
14
  LongTermMemorySearchInput,
13
15
  LongTermMemorySearchTool,
16
+ Mem0DeleteInput,
17
+ Mem0DeleteTool,
14
18
  Mem0SearchInput,
15
19
  Mem0SearchTool,
16
20
  MemoryConfig,
@@ -18,9 +22,13 @@ from aip_agents.tools.memory_search import (
18
22
 
19
23
  __all__ = [
20
24
  "MemoryConfig",
25
+ "LongTermMemoryDeleteInput",
21
26
  "LongTermMemorySearchInput",
22
27
  "LongTermMemorySearchTool",
28
+ "Mem0DeleteInput",
29
+ "Mem0DeleteTool",
23
30
  "Mem0SearchInput",
24
31
  "Mem0SearchTool",
32
+ "MEMORY_DELETE_TOOL_NAME",
25
33
  "MEMORY_SEARCH_TOOL_NAME",
26
34
  ]
@@ -1,3 +1,3 @@
1
- from aip_agents.tools.memory_search import LongTermMemorySearchInput as LongTermMemorySearchInput, LongTermMemorySearchTool as LongTermMemorySearchTool, MEMORY_SEARCH_TOOL_NAME as MEMORY_SEARCH_TOOL_NAME, Mem0SearchInput as Mem0SearchInput, Mem0SearchTool as Mem0SearchTool, MemoryConfig as MemoryConfig
1
+ from aip_agents.tools.memory_search import LongTermMemoryDeleteInput as LongTermMemoryDeleteInput, LongTermMemorySearchInput as LongTermMemorySearchInput, LongTermMemorySearchTool as LongTermMemorySearchTool, MEMORY_DELETE_TOOL_NAME as MEMORY_DELETE_TOOL_NAME, MEMORY_SEARCH_TOOL_NAME as MEMORY_SEARCH_TOOL_NAME, Mem0DeleteInput as Mem0DeleteInput, Mem0DeleteTool as Mem0DeleteTool, Mem0SearchInput as Mem0SearchInput, Mem0SearchTool as Mem0SearchTool, MemoryConfig as MemoryConfig
2
2
 
3
- __all__ = ['MemoryConfig', 'LongTermMemorySearchInput', 'LongTermMemorySearchTool', 'Mem0SearchInput', 'Mem0SearchTool', 'MEMORY_SEARCH_TOOL_NAME']
3
+ __all__ = ['MemoryConfig', 'LongTermMemoryDeleteInput', 'LongTermMemorySearchInput', 'LongTermMemorySearchTool', 'Mem0DeleteInput', 'Mem0DeleteTool', 'Mem0SearchInput', 'Mem0SearchTool', 'MEMORY_DELETE_TOOL_NAME', 'MEMORY_SEARCH_TOOL_NAME']
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aip-agents-binary
3
- Version: 0.6.3
3
+ Version: 0.6.4
4
4
  Summary: A library for managing agents in Gen AI applications.
5
5
  Author-email: Raymond Christopher <raymond.christopher@gdplabs.id>
6
6
  Requires-Python: <3.13,>=3.11
@@ -476,26 +476,14 @@ The library supports Mem0 as a memory backend for long-term conversation recall.
476
476
  - Date range parsing for natural language time filters using `dateparser`.
477
477
  - Conditional auto-augmentation (disabled by default to reduce noise; enable with `memory_auto_augment=True`).
478
478
 
479
- #### Mem0 Date Recall Example
479
+ #### Mem0 Integration Tests
480
480
 
481
- Use the coordinator example with memory enabled:
481
+ Use the Mem0 integration tests to validate memory persistence, recall, and deletion:
482
482
 
483
483
  ```bash
484
- poetry run python aip_agents/examples/hello_world_a2a_mem0_coordinator_server.py
484
+ cd python/aip-agents && poetry run pytest tests/integration_tests/test_mem0_coordinator.py -q
485
485
  ```
486
486
 
487
- In client:
488
- ```python
489
- agent = LangGraphAgent(
490
- name="client",
491
- instruction="...",
492
- model="gpt-4o-mini",
493
- memory_backend="mem0",
494
- )
495
- ```
496
-
497
- Test recall: After some interactions, query "What did we discuss yesterday?" – agent uses tool to filter by created_at.
498
-
499
487
  ## Deep Agents Middleware
500
488
 
501
489
  The Deep Agents Middleware system provides composable components for enhancing agent capabilities with planning, context management, and custom lifecycle hooks.
@@ -20,7 +20,7 @@ aip_agents/agent/__init__.py,sha256=KBT-e5nEBMVJypC8OFulmErUK63gmQZus0UcBu6EqBo,
20
20
  aip_agents/agent/__init__.pyi,sha256=MxIAeAv1pPCtqfAa3lvmeCAN-IT5p3v77IeKhfKYvKo,855
21
21
  aip_agents/agent/base_agent.py,sha256=XH19lJZuumWBu2JMoretv6T4bSXcWMqK8jZ3mOWWzCk,39669
22
22
  aip_agents/agent/base_agent.pyi,sha256=xnWp05zTJrt1YfHmm9CsggBmrSsIY-SSy_G9EWGvEBQ,11118
23
- aip_agents/agent/base_langgraph_agent.py,sha256=Bt3LFYtoSkPnnxXOyu2dn7OkReQ4y78mEVlwPzhCaAo,123018
23
+ aip_agents/agent/base_langgraph_agent.py,sha256=f6pqDeaxSW8xeql7WdV46lbrilGuKuFyvUZo1p5D6_E,123831
24
24
  aip_agents/agent/base_langgraph_agent.pyi,sha256=7X9GWkGK4QkYrnjuBC8U4zcOlzYCt7-TgPmFwhJMt1Q,11593
25
25
  aip_agents/agent/google_adk_agent.py,sha256=V_b72Ig87UiW15YNc-PCcxd25ia9pj2T0IlqCDJ-3_Q,37136
26
26
  aip_agents/agent/google_adk_agent.pyi,sha256=o06bPfA7bRQ_ufdOmJ6j6A2_WxWr5G6jZEKRzEPYjTU,6248
@@ -32,10 +32,10 @@ aip_agents/agent/interfaces.py,sha256=Hi5GVCk4S2xwnNQ7a56VnkEFktNm7ofMDmA8axJUK2
32
32
  aip_agents/agent/interfaces.pyi,sha256=v9TnZ8fW1gglh5ynnpvcrN0wN2PDrJGVpgWhp3whvGQ,1600
33
33
  aip_agents/agent/langflow_agent.py,sha256=ZoJGOS8GcgGJ9Xfu4upzk3Nc1XVkpS8GSpcyKhGkXBA,17439
34
34
  aip_agents/agent/langflow_agent.pyi,sha256=z89Y7JifrsHi4Vn6LE_s0zbo77nLhkDKI-eRcxmnOr0,5667
35
- aip_agents/agent/langgraph_memory_enhancer_agent.py,sha256=EqH_olZ6Ue-SyQMrvYfuLkiCQAAZRMWx8izB19IYSlI,17426
36
- aip_agents/agent/langgraph_memory_enhancer_agent.pyi,sha256=e5sz1hbyOLw0eHo6fKf3HsCpyTe3yGqEidn9EOGb3QQ,2595
37
- aip_agents/agent/langgraph_react_agent.py,sha256=oKmrKm1qalpSpp4bMpg81fIbKa8Lx3QvA4VDIBqS8iI,116557
38
- aip_agents/agent/langgraph_react_agent.pyi,sha256=15rZxqRKwjooqiwKUZoq2BJt6V32GhKi2IP_Xxl888E,10475
35
+ aip_agents/agent/langgraph_memory_enhancer_agent.py,sha256=gsnS1iiygrNWHv-KJjmdqzQGWrS8Ia5v_91Z2Zvz2_M,31696
36
+ aip_agents/agent/langgraph_memory_enhancer_agent.pyi,sha256=5vP11BeaQhVryNKfve3c0mUoKsIBlEN15YbLJcej5pI,2905
37
+ aip_agents/agent/langgraph_react_agent.py,sha256=tY-KmRR_L6h46ygHNJrwTuCTc-sJJabDOrIfllJlrdQ,117670
38
+ aip_agents/agent/langgraph_react_agent.pyi,sha256=5X7PO-GD0UMKly-dgksCPHpP2kXb2b5qNcRbRGH5BY0,10527
39
39
  aip_agents/agent/system_instruction_context.py,sha256=xTWdpKVJsWcR1uI0alCLnUsbP5sh_VWHxfF2zoi7NY0,1186
40
40
  aip_agents/agent/system_instruction_context.pyi,sha256=mdSg5sApS9G7-zr3d9BunJqwe2GB6dDD3DOCDfRrpkU,411
41
41
  aip_agents/agent/hitl/__init__.py,sha256=IyE9kWVPO-uI2_HowNm_aAxr9jyto0ZM0sZKVtpUpzo,826
@@ -71,8 +71,6 @@ aip_agents/examples/compare_streaming_client.py,sha256=cUf2rv4ZfaDEJ-3cUb94qHh-a
71
71
  aip_agents/examples/compare_streaming_client.pyi,sha256=caRzRGjAcs7Vdoecll1ud7SKGnbRh1RnYcKrkWpNiQE,3008
72
72
  aip_agents/examples/compare_streaming_server.py,sha256=PyLGALAL0qWJUo2Ju7YXvh8US9Gp6jf61fjUL1NeY9E,5634
73
73
  aip_agents/examples/compare_streaming_server.pyi,sha256=NNu30WWoC6QQt-hiAq4zwCX3qJaSwz-LE5KolEfBp0A,842
74
- aip_agents/examples/demo_memory_recall.py,sha256=7_FmFpBRWZmIfvrinwT_WgPmMRew_WEW5khQitESlqg,15513
75
- aip_agents/examples/demo_memory_recall.pyi,sha256=eX0GEZ9EVKvvmMBc_d9NKQkHWHsbfi-cDpensKHHqC4,2570
76
74
  aip_agents/examples/hello_world_a2a_google_adk_client.py,sha256=Zh05vnN2O12w32b5s8lVSIcSnZt0GcRj77utrcBoAEQ,1658
77
75
  aip_agents/examples/hello_world_a2a_google_adk_client.pyi,sha256=iOnEywK-3OKQx9nv-H4BVTI1LAAFRMTxtvunh-f993w,374
78
76
  aip_agents/examples/hello_world_a2a_google_adk_client_agent.py,sha256=44uLJRjdEriULcsE9mxlIpmcQY4PZZA20BXYyXfsn_0,1553
@@ -314,7 +312,7 @@ aip_agents/mcp/client/persistent_session.py,sha256=sucOlCDvpX70_Ru_BZDGX-dHGlG9c
314
312
  aip_agents/mcp/client/persistent_session.pyi,sha256=B0N7gY0NFidELB4IAE7pk0QuskjhIAgN662wSgRrKxc,4267
315
313
  aip_agents/mcp/client/session_pool.py,sha256=_J8WduSo3HAfhE5n4u67IQQ71m_L2aPUY1NOgX5e7yA,12617
316
314
  aip_agents/mcp/client/session_pool.pyi,sha256=RtzN-5QDLS5MFAlnR5TiarY1xW4xo780n7lQL0sQbRU,3579
317
- aip_agents/mcp/client/transports.py,sha256=hHzZD-pmim5pj25ozV61lJ1D-hTYvvYXZryrRtPZBR8,9908
315
+ aip_agents/mcp/client/transports.py,sha256=I2opSOZUzf-g10WyyCkil5xogfpHP1ZToHIl6GuXJWU,9994
318
316
  aip_agents/mcp/client/transports.pyi,sha256=S7uhJIh-6bZq8_tgqTdeez78vIrtHy4a10GO1GDgEio,4958
319
317
  aip_agents/mcp/client/google_adk/__init__.py,sha256=ZJZE7IusoWFzEwaWsHOk-8VMdR-LUmWacepw_HHuOlI,280
320
318
  aip_agents/mcp/client/google_adk/__init__.pyi,sha256=TAbiDbysxbCtHQSASGdko6JIaZEnPbCmUqt4Jf966cs,127
@@ -342,8 +340,8 @@ aip_agents/memory/simple_memory.py,sha256=CpLr7mI_LyurFR6LHqFWXABxGP2Q0ef2GxZyGT
342
340
  aip_agents/memory/simple_memory.pyi,sha256=E-UJ-pqDOpHqMozwf5M3yHuim_46vzHmUwf_SthHIb4,1126
343
341
  aip_agents/memory/adapters/__init__.py,sha256=j-loIdfx_2K4JsjjolEeUrINgwogOOs_jm5pQlhZzac,279
344
342
  aip_agents/memory/adapters/__init__.pyi,sha256=KDmdDvG1tcfEQJ8c5_i9q3m74LPTlGsyTTY7b6n5nno,207
345
- aip_agents/memory/adapters/base_adapter.py,sha256=lYgOp04ONEx1upszXU7y181Q8p4imb9m6ctsoSCwXg0,25515
346
- aip_agents/memory/adapters/base_adapter.pyi,sha256=g__Agyf8Rt-iz6Oi54o16ubDsHUAGBn0h-Xn8H8fY8I,5948
343
+ aip_agents/memory/adapters/base_adapter.py,sha256=BIrmiD7sTVsUNzBRerdkOkqNQh0fY3en-StTw1RKr8M,28976
344
+ aip_agents/memory/adapters/base_adapter.pyi,sha256=a2NF-qNq6CuNzz2y6W_CL3V_AVrnYbpZ1TTnurU6CtE,7320
347
345
  aip_agents/memory/adapters/mem0.py,sha256=wWRUlCusOpMMayj4Uw8nYiAuI4TKxaKXqaTTerzXDL4,2955
348
346
  aip_agents/memory/adapters/mem0.pyi,sha256=C8hVoXKmk2J62Lns-OdafTiEEFEcH-SJn-bF3ATHx7s,1093
349
347
  aip_agents/middleware/__init__.py,sha256=ggAQsp9G0jNsrQ59unPrv6K8Bapi-WvLMwnI84Tt_Dg,485
@@ -444,8 +442,8 @@ aip_agents/tools/execute_ptc_code.py,sha256=mN8-G50voxVqWH9r3uJGQOtgPtxsHaTOnJrJ
444
442
  aip_agents/tools/execute_ptc_code.pyi,sha256=nDlpxV-kcKuNmtghahjXAtjWvtNv6D38x8-VTNCKYjU,4089
445
443
  aip_agents/tools/gl_connector_tools.py,sha256=bxl_3VQYZDv3lFn6Y3kDVVRFwH4cntOLz3f74YzDcic,3936
446
444
  aip_agents/tools/gl_connector_tools.pyi,sha256=2ATn_MW_FRg5Uv7dLI_ToBOtlgTSfj0zgDQpN1N-cJs,1366
447
- aip_agents/tools/memory_search_tool.py,sha256=gqTTb_Fao_Hl-SavfaFsqPDhnFQUjzIQUkzizSD2L0A,653
448
- aip_agents/tools/memory_search_tool.pyi,sha256=BCVFEEgH3pETnI9b6vRlMm2_PnnIeBe_vuMlL9y3LpU,453
445
+ aip_agents/tools/memory_search_tool.py,sha256=AOk9lySj6qR9e1uCrGd-DuGltosbKOx6eTZdQKxQbMY,863
446
+ aip_agents/tools/memory_search_tool.pyi,sha256=Kdo69aJYb0RmiO3udSXl3GZYzl32kBpQJAxV1fJQOSs,724
449
447
  aip_agents/tools/time_tool.py,sha256=NPjz73hy1SNc3okWhDXdR45q84vmRUerDGDk_E-XyZk,3732
450
448
  aip_agents/tools/time_tool.pyi,sha256=sF8INR8-VRmETquuQ6BIY0geEGXhMLzbcddpnMb0H7k,374
451
449
  aip_agents/tools/tool_config_injector.py,sha256=rk8uqwz-LUpZ_d0cUK0ywxnkzINfTPMN3GMxcKPLVjE,10559
@@ -500,14 +498,14 @@ aip_agents/tools/gl_connector/__init__.py,sha256=f8F4mdBFj0ulxewCQwG5qN2SDzlgI2j
500
498
  aip_agents/tools/gl_connector/__init__.pyi,sha256=96wtNkB3VUSI66aRlYxVrzMiPtqOYviRMKviRgX3_fc,113
501
499
  aip_agents/tools/gl_connector/tool.py,sha256=jzT8XmTfFQC9ZcQplVcRs2VmCtKewH9FzT7wSFtUJac,13106
502
500
  aip_agents/tools/gl_connector/tool.pyi,sha256=a5l0MHSOe_iWDvjMRzYtcbMdX0bFlK1m7Hl52HQ__iQ,2770
503
- aip_agents/tools/memory_search/__init__.py,sha256=YSsObYlHjdZEbJj4MVYy3Ht8JPlo42YhjnkI-yFNWV0,608
504
- aip_agents/tools/memory_search/__init__.pyi,sha256=NG0g94OoC_xw66yIqiPViqTnpj01QdnRsVBGzkSxJFI,554
501
+ aip_agents/tools/memory_search/__init__.py,sha256=LGVryzA5hiOGBPBdqQyAX34odd-2gZqKaKKxyWLAroc,814
502
+ aip_agents/tools/memory_search/__init__.pyi,sha256=T2ROZSTHZz3sL3QGbqVxHVqJLj9i017DIt5gk8haX30,825
505
503
  aip_agents/tools/memory_search/base.py,sha256=M4Vq5CnXge1rhVkESfVCAjyWEc6Ijmh8-6oAMkcZkjY,7333
506
504
  aip_agents/tools/memory_search/base.pyi,sha256=onVYE9m7WxUQ4qmW5Tj4xBLgFaBGcg8pJj-n6nR5FIw,3087
507
- aip_agents/tools/memory_search/mem0.py,sha256=mFtmdVULHQkMEPMjigdHgSM6PZKC2SAyvkBQHPyQxv0,9537
508
- aip_agents/tools/memory_search/mem0.pyi,sha256=YFIxvzoOEplbcKqVLddfA2FyjH2RNm6PqyzmYinnndY,896
509
- aip_agents/tools/memory_search/schema.py,sha256=Y01f-tVFOF_DibQRV-xYYd2rupeRV6vgXcvaVm2ZYnQ,1656
510
- aip_agents/tools/memory_search/schema.pyi,sha256=YkZgf0R9vtizEbjNy5WIS16M4pLWPW5MtHzMbScaiLc,435
505
+ aip_agents/tools/memory_search/mem0.py,sha256=7bULcmax2TKonTFC_hHq1lBDXOd77wwTvD9pDPLn83I,13786
506
+ aip_agents/tools/memory_search/mem0.pyi,sha256=Cg7EO70QIK8EwD4-nNARd7qp2izZiquxmhBIt5R6afg,1314
507
+ aip_agents/tools/memory_search/schema.py,sha256=7URsggujl5kw0d-1b71ymLzc9oZ_-xQGgkXuE1bXJow,2775
508
+ aip_agents/tools/memory_search/schema.pyi,sha256=qK_xhhSFo3ncVvybMXlAtUpg9XPydrB84-bsIzfLAzI,744
511
509
  aip_agents/tools/web_search/__init__.py,sha256=ZjklA94sIQoHDHhnsDoS-2z3eZJ3pc1rv7LQuTzG_6E,500
512
510
  aip_agents/tools/web_search/__init__.pyi,sha256=NROEUMdBJz0j7f29hut7DEJdiWNLWPXYjTNGO8U6hHA,121
513
511
  aip_agents/tools/web_search/serper_tool.py,sha256=quVR0sSsa5Utncq2diG-6sKGEzgdQggOSyc8qbLwK8M,6826
@@ -608,7 +606,7 @@ aip_agents/utils/pii/pii_helper.py,sha256=g0yRzakfA2AA6vjUNLWHqFlcxyLql6MXQ90NN3
608
606
  aip_agents/utils/pii/pii_helper.pyi,sha256=dulZs150ikbAL3Bw2YLcz3_g4DsGmL3lciwf8mKxEjI,2939
609
607
  aip_agents/utils/pii/uuid_deanonymizer_mapping.py,sha256=Gks8l8t0cuS9pzoQnrpiK1CaLmWYksjOnTeiHh3_7EE,7348
610
608
  aip_agents/utils/pii/uuid_deanonymizer_mapping.pyi,sha256=gnWfD1rWZh_tloJjgKiZ6f6iNUuBaHpKqCSiP0d-9bs,3084
611
- aip_agents_binary-0.6.3.dist-info/METADATA,sha256=7BAliBsUy5k6VWI4QIMhyqul_9tjgYDM4NtsxIr64ak,22416
612
- aip_agents_binary-0.6.3.dist-info/WHEEL,sha256=KxCTaSkoYs_EnWvWxmau4HAvN-_rCRYV_bfRc_41A9k,106
613
- aip_agents_binary-0.6.3.dist-info/top_level.txt,sha256=PEz8vcwC1bH4UrkhF0LkIYCNfXGWZUHdSklbvkBe25E,11
614
- aip_agents_binary-0.6.3.dist-info/RECORD,,
609
+ aip_agents_binary-0.6.4.dist-info/METADATA,sha256=IEUX5CDrYnEC8vfhCQ4_UuRBm8OsYx-aY246fcjOpyE,22194
610
+ aip_agents_binary-0.6.4.dist-info/WHEEL,sha256=KxCTaSkoYs_EnWvWxmau4HAvN-_rCRYV_bfRc_41A9k,106
611
+ aip_agents_binary-0.6.4.dist-info/top_level.txt,sha256=PEz8vcwC1bH4UrkhF0LkIYCNfXGWZUHdSklbvkBe25E,11
612
+ aip_agents_binary-0.6.4.dist-info/RECORD,,