aip-agents-binary 0.6.3__py3-none-any.whl → 0.6.5__py3-none-any.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.

Potentially problematic release.


This version of aip-agents-binary might be problematic. Click here for more details.

Files changed (317) hide show
  1. aip_agents/agent/__init__.py +44 -4
  2. aip_agents/agent/base_langgraph_agent.py +26 -6
  3. aip_agents/agent/langgraph_memory_enhancer_agent.py +368 -34
  4. aip_agents/agent/langgraph_react_agent.py +30 -6
  5. aip_agents/mcp/client/__init__.py +38 -2
  6. aip_agents/mcp/client/transports.py +5 -1
  7. aip_agents/memory/adapters/base_adapter.py +94 -0
  8. aip_agents/sentry/sentry.py +29 -8
  9. aip_agents/tools/memory_search/__init__.py +8 -1
  10. aip_agents/tools/memory_search/mem0.py +108 -1
  11. aip_agents/tools/memory_search/schema.py +33 -0
  12. aip_agents/tools/memory_search_tool.py +8 -0
  13. {aip_agents_binary-0.6.3.dist-info → aip_agents_binary-0.6.5.dist-info}/METADATA +4 -16
  14. aip_agents_binary-0.6.5.dist-info/RECORD +314 -0
  15. aip_agents/__init__.pyi +0 -19
  16. aip_agents/a2a/__init__.pyi +0 -3
  17. aip_agents/a2a/server/__init__.pyi +0 -4
  18. aip_agents/a2a/server/base_executor.pyi +0 -73
  19. aip_agents/a2a/server/google_adk_executor.pyi +0 -51
  20. aip_agents/a2a/server/langflow_executor.pyi +0 -43
  21. aip_agents/a2a/server/langgraph_executor.pyi +0 -47
  22. aip_agents/a2a/types.pyi +0 -132
  23. aip_agents/agent/__init__.pyi +0 -9
  24. aip_agents/agent/base_agent.pyi +0 -221
  25. aip_agents/agent/base_langgraph_agent.pyi +0 -233
  26. aip_agents/agent/google_adk_agent.pyi +0 -141
  27. aip_agents/agent/google_adk_constants.pyi +0 -3
  28. aip_agents/agent/hitl/__init__.pyi +0 -6
  29. aip_agents/agent/hitl/config.pyi +0 -15
  30. aip_agents/agent/hitl/langgraph_hitl_mixin.pyi +0 -42
  31. aip_agents/agent/hitl/manager.pyi +0 -200
  32. aip_agents/agent/hitl/models.pyi +0 -3
  33. aip_agents/agent/hitl/prompt/__init__.pyi +0 -4
  34. aip_agents/agent/hitl/prompt/base.pyi +0 -24
  35. aip_agents/agent/hitl/prompt/deferred.pyi +0 -30
  36. aip_agents/agent/hitl/registry.pyi +0 -101
  37. aip_agents/agent/interface.pyi +0 -81
  38. aip_agents/agent/interfaces.pyi +0 -44
  39. aip_agents/agent/langflow_agent.pyi +0 -133
  40. aip_agents/agent/langgraph_memory_enhancer_agent.pyi +0 -49
  41. aip_agents/agent/langgraph_react_agent.pyi +0 -170
  42. aip_agents/agent/system_instruction_context.pyi +0 -13
  43. aip_agents/clients/__init__.pyi +0 -4
  44. aip_agents/clients/langflow/__init__.pyi +0 -4
  45. aip_agents/clients/langflow/client.pyi +0 -140
  46. aip_agents/clients/langflow/types.pyi +0 -7
  47. aip_agents/constants.pyi +0 -7
  48. aip_agents/examples/__init__.pyi +0 -0
  49. aip_agents/examples/compare_streaming_client.pyi +0 -48
  50. aip_agents/examples/compare_streaming_server.pyi +0 -18
  51. aip_agents/examples/demo_memory_recall.py +0 -401
  52. aip_agents/examples/demo_memory_recall.pyi +0 -58
  53. aip_agents/examples/hello_world_a2a_google_adk_client.pyi +0 -9
  54. aip_agents/examples/hello_world_a2a_google_adk_client_agent.pyi +0 -9
  55. aip_agents/examples/hello_world_a2a_google_adk_client_streaming.pyi +0 -9
  56. aip_agents/examples/hello_world_a2a_google_adk_server.pyi +0 -15
  57. aip_agents/examples/hello_world_a2a_langchain_client.pyi +0 -5
  58. aip_agents/examples/hello_world_a2a_langchain_client_agent.pyi +0 -5
  59. aip_agents/examples/hello_world_a2a_langchain_client_lm_invoker.pyi +0 -5
  60. aip_agents/examples/hello_world_a2a_langchain_client_streaming.pyi +0 -5
  61. aip_agents/examples/hello_world_a2a_langchain_reference_client_streaming.pyi +0 -5
  62. aip_agents/examples/hello_world_a2a_langchain_reference_server.pyi +0 -15
  63. aip_agents/examples/hello_world_a2a_langchain_server.pyi +0 -15
  64. aip_agents/examples/hello_world_a2a_langchain_server_lm_invoker.pyi +0 -15
  65. aip_agents/examples/hello_world_a2a_langflow_client.pyi +0 -9
  66. aip_agents/examples/hello_world_a2a_langflow_server.pyi +0 -14
  67. aip_agents/examples/hello_world_a2a_langgraph_artifact_client.pyi +0 -5
  68. aip_agents/examples/hello_world_a2a_langgraph_artifact_client_streaming.pyi +0 -5
  69. aip_agents/examples/hello_world_a2a_langgraph_artifact_server.pyi +0 -16
  70. aip_agents/examples/hello_world_a2a_langgraph_client.pyi +0 -9
  71. aip_agents/examples/hello_world_a2a_langgraph_client_agent.pyi +0 -9
  72. aip_agents/examples/hello_world_a2a_langgraph_client_agent_lm_invoker.pyi +0 -2
  73. aip_agents/examples/hello_world_a2a_langgraph_client_streaming.pyi +0 -9
  74. aip_agents/examples/hello_world_a2a_langgraph_client_streaming_lm_invoker.pyi +0 -5
  75. aip_agents/examples/hello_world_a2a_langgraph_client_streaming_tool_streaming.pyi +0 -5
  76. aip_agents/examples/hello_world_a2a_langgraph_server.pyi +0 -14
  77. aip_agents/examples/hello_world_a2a_langgraph_server_lm_invoker.pyi +0 -15
  78. aip_agents/examples/hello_world_a2a_langgraph_server_tool_streaming.pyi +0 -15
  79. aip_agents/examples/hello_world_a2a_mcp_langgraph.pyi +0 -48
  80. aip_agents/examples/hello_world_a2a_three_level_agent_hierarchy_client.pyi +0 -48
  81. aip_agents/examples/hello_world_a2a_three_level_agent_hierarchy_server.pyi +0 -45
  82. aip_agents/examples/hello_world_a2a_with_metadata_langchain_client.pyi +0 -5
  83. aip_agents/examples/hello_world_a2a_with_metadata_langchain_server_lm_invoker.pyi +0 -15
  84. aip_agents/examples/hello_world_google_adk.pyi +0 -5
  85. aip_agents/examples/hello_world_google_adk_mcp_http.pyi +0 -5
  86. aip_agents/examples/hello_world_google_adk_mcp_http_stream.pyi +0 -5
  87. aip_agents/examples/hello_world_google_adk_mcp_sse.pyi +0 -5
  88. aip_agents/examples/hello_world_google_adk_mcp_sse_stream.pyi +0 -5
  89. aip_agents/examples/hello_world_google_adk_mcp_stdio.pyi +0 -5
  90. aip_agents/examples/hello_world_google_adk_mcp_stdio_stream.pyi +0 -5
  91. aip_agents/examples/hello_world_google_adk_stream.pyi +0 -5
  92. aip_agents/examples/hello_world_langchain.pyi +0 -5
  93. aip_agents/examples/hello_world_langchain_lm_invoker.pyi +0 -2
  94. aip_agents/examples/hello_world_langchain_mcp_http.pyi +0 -5
  95. aip_agents/examples/hello_world_langchain_mcp_http_interactive.pyi +0 -16
  96. aip_agents/examples/hello_world_langchain_mcp_http_stream.pyi +0 -5
  97. aip_agents/examples/hello_world_langchain_mcp_multi_server.pyi +0 -18
  98. aip_agents/examples/hello_world_langchain_mcp_sse.pyi +0 -5
  99. aip_agents/examples/hello_world_langchain_mcp_sse_stream.pyi +0 -5
  100. aip_agents/examples/hello_world_langchain_mcp_stdio.pyi +0 -5
  101. aip_agents/examples/hello_world_langchain_mcp_stdio_stream.pyi +0 -5
  102. aip_agents/examples/hello_world_langchain_stream.pyi +0 -5
  103. aip_agents/examples/hello_world_langchain_stream_lm_invoker.pyi +0 -5
  104. aip_agents/examples/hello_world_langflow_agent.pyi +0 -35
  105. aip_agents/examples/hello_world_langgraph.pyi +0 -5
  106. aip_agents/examples/hello_world_langgraph_gl_connector_twitter.pyi +0 -5
  107. aip_agents/examples/hello_world_langgraph_mcp_http.pyi +0 -5
  108. aip_agents/examples/hello_world_langgraph_mcp_http_stream.pyi +0 -5
  109. aip_agents/examples/hello_world_langgraph_mcp_sse.pyi +0 -5
  110. aip_agents/examples/hello_world_langgraph_mcp_sse_stream.pyi +0 -5
  111. aip_agents/examples/hello_world_langgraph_mcp_stdio.pyi +0 -5
  112. aip_agents/examples/hello_world_langgraph_mcp_stdio_stream.pyi +0 -5
  113. aip_agents/examples/hello_world_langgraph_stream.pyi +0 -5
  114. aip_agents/examples/hello_world_langgraph_stream_lm_invoker.pyi +0 -5
  115. aip_agents/examples/hello_world_model_switch_cli.pyi +0 -30
  116. aip_agents/examples/hello_world_multi_agent_adk.pyi +0 -6
  117. aip_agents/examples/hello_world_multi_agent_langchain.pyi +0 -5
  118. aip_agents/examples/hello_world_multi_agent_langgraph.pyi +0 -5
  119. aip_agents/examples/hello_world_multi_agent_langgraph_lm_invoker.pyi +0 -5
  120. aip_agents/examples/hello_world_pii_logger.pyi +0 -5
  121. aip_agents/examples/hello_world_ptc.pyi +0 -5
  122. aip_agents/examples/hello_world_sentry.pyi +0 -21
  123. aip_agents/examples/hello_world_step_limits.pyi +0 -17
  124. aip_agents/examples/hello_world_stock_a2a_server.pyi +0 -17
  125. aip_agents/examples/hello_world_tool_output_client.pyi +0 -5
  126. aip_agents/examples/hello_world_tool_output_server.pyi +0 -19
  127. aip_agents/examples/hitl_demo.pyi +0 -67
  128. aip_agents/examples/pii_demo_langgraph_client.pyi +0 -5
  129. aip_agents/examples/pii_demo_langgraph_server.pyi +0 -20
  130. aip_agents/examples/pii_demo_multi_agent_client.pyi +0 -5
  131. aip_agents/examples/pii_demo_multi_agent_server.pyi +0 -40
  132. aip_agents/examples/todolist_planning_a2a_langchain_client.pyi +0 -5
  133. aip_agents/examples/todolist_planning_a2a_langgraph_server.pyi +0 -19
  134. aip_agents/examples/tools/__init__.pyi +0 -9
  135. aip_agents/examples/tools/adk_arithmetic_tools.pyi +0 -24
  136. aip_agents/examples/tools/adk_weather_tool.pyi +0 -18
  137. aip_agents/examples/tools/data_generator_tool.pyi +0 -15
  138. aip_agents/examples/tools/data_visualization_tool.pyi +0 -19
  139. aip_agents/examples/tools/image_artifact_tool.pyi +0 -26
  140. aip_agents/examples/tools/langchain_arithmetic_tools.pyi +0 -17
  141. aip_agents/examples/tools/langchain_currency_exchange_tool.pyi +0 -20
  142. aip_agents/examples/tools/langchain_graph_artifact_tool.pyi +0 -25
  143. aip_agents/examples/tools/langchain_weather_tool.pyi +0 -19
  144. aip_agents/examples/tools/langgraph_streaming_tool.pyi +0 -43
  145. aip_agents/examples/tools/mock_retrieval_tool.pyi +0 -13
  146. aip_agents/examples/tools/pii_demo_tools.pyi +0 -54
  147. aip_agents/examples/tools/random_chart_tool.pyi +0 -20
  148. aip_agents/examples/tools/serper_tool.pyi +0 -16
  149. aip_agents/examples/tools/stock_tools.pyi +0 -36
  150. aip_agents/examples/tools/table_generator_tool.pyi +0 -22
  151. aip_agents/examples/tools/time_tool.pyi +0 -15
  152. aip_agents/examples/tools/weather_forecast_tool.pyi +0 -14
  153. aip_agents/guardrails/__init__.pyi +0 -6
  154. aip_agents/guardrails/engines/__init__.pyi +0 -4
  155. aip_agents/guardrails/engines/base.pyi +0 -61
  156. aip_agents/guardrails/engines/nemo.pyi +0 -46
  157. aip_agents/guardrails/engines/phrase_matcher.pyi +0 -48
  158. aip_agents/guardrails/exceptions.pyi +0 -23
  159. aip_agents/guardrails/manager.pyi +0 -42
  160. aip_agents/guardrails/middleware.pyi +0 -87
  161. aip_agents/guardrails/schemas.pyi +0 -43
  162. aip_agents/guardrails/utils.pyi +0 -19
  163. aip_agents/mcp/__init__.pyi +0 -0
  164. aip_agents/mcp/client/__init__.pyi +0 -5
  165. aip_agents/mcp/client/base_mcp_client.pyi +0 -148
  166. aip_agents/mcp/client/connection_manager.pyi +0 -51
  167. aip_agents/mcp/client/google_adk/__init__.pyi +0 -3
  168. aip_agents/mcp/client/google_adk/client.pyi +0 -75
  169. aip_agents/mcp/client/langchain/__init__.pyi +0 -3
  170. aip_agents/mcp/client/langchain/client.pyi +0 -48
  171. aip_agents/mcp/client/persistent_session.pyi +0 -122
  172. aip_agents/mcp/client/session_pool.pyi +0 -101
  173. aip_agents/mcp/client/transports.pyi +0 -132
  174. aip_agents/mcp/utils/__init__.pyi +0 -0
  175. aip_agents/mcp/utils/config_validator.pyi +0 -82
  176. aip_agents/memory/__init__.pyi +0 -5
  177. aip_agents/memory/adapters/__init__.pyi +0 -4
  178. aip_agents/memory/adapters/base_adapter.pyi +0 -150
  179. aip_agents/memory/adapters/mem0.pyi +0 -22
  180. aip_agents/memory/base.pyi +0 -60
  181. aip_agents/memory/constants.pyi +0 -25
  182. aip_agents/memory/factory.pyi +0 -24
  183. aip_agents/memory/guidance.pyi +0 -3
  184. aip_agents/memory/simple_memory.pyi +0 -23
  185. aip_agents/middleware/__init__.pyi +0 -5
  186. aip_agents/middleware/base.pyi +0 -75
  187. aip_agents/middleware/manager.pyi +0 -84
  188. aip_agents/middleware/todolist.pyi +0 -125
  189. aip_agents/ptc/__init__.pyi +0 -10
  190. aip_agents/ptc/doc_gen.pyi +0 -40
  191. aip_agents/ptc/exceptions.pyi +0 -22
  192. aip_agents/ptc/executor.pyi +0 -73
  193. aip_agents/ptc/mcp/__init__.pyi +0 -7
  194. aip_agents/ptc/mcp/sandbox_bridge.pyi +0 -47
  195. aip_agents/ptc/mcp/templates/__init__.pyi +0 -0
  196. aip_agents/ptc/naming.pyi +0 -76
  197. aip_agents/ptc/payload.pyi +0 -15
  198. aip_agents/ptc/prompt_builder.pyi +0 -55
  199. aip_agents/ptc/ptc_helper.pyi +0 -1
  200. aip_agents/ptc/sandbox_bridge.pyi +0 -25
  201. aip_agents/ptc/template_utils.pyi +0 -13
  202. aip_agents/ptc/templates/__init__.pyi +0 -0
  203. aip_agents/sandbox/__init__.pyi +0 -5
  204. aip_agents/sandbox/defaults.pyi +0 -2
  205. aip_agents/sandbox/e2b_runtime.pyi +0 -51
  206. aip_agents/sandbox/template_builder.pyi +0 -36
  207. aip_agents/sandbox/types.pyi +0 -14
  208. aip_agents/sandbox/validation.pyi +0 -20
  209. aip_agents/schema/__init__.pyi +0 -9
  210. aip_agents/schema/a2a.pyi +0 -40
  211. aip_agents/schema/agent.pyi +0 -65
  212. aip_agents/schema/hitl.pyi +0 -89
  213. aip_agents/schema/langgraph.pyi +0 -28
  214. aip_agents/schema/model_id.pyi +0 -54
  215. aip_agents/schema/step_limit.pyi +0 -63
  216. aip_agents/schema/storage.pyi +0 -21
  217. aip_agents/sentry/__init__.pyi +0 -3
  218. aip_agents/sentry/sentry.pyi +0 -48
  219. aip_agents/storage/__init__.pyi +0 -8
  220. aip_agents/storage/base.pyi +0 -58
  221. aip_agents/storage/clients/__init__.pyi +0 -3
  222. aip_agents/storage/clients/minio_client.pyi +0 -137
  223. aip_agents/storage/config.pyi +0 -29
  224. aip_agents/storage/providers/__init__.pyi +0 -5
  225. aip_agents/storage/providers/base.pyi +0 -88
  226. aip_agents/storage/providers/memory.pyi +0 -79
  227. aip_agents/storage/providers/object_storage.pyi +0 -98
  228. aip_agents/tools/__init__.pyi +0 -11
  229. aip_agents/tools/browser_use/__init__.pyi +0 -14
  230. aip_agents/tools/browser_use/action_parser.pyi +0 -18
  231. aip_agents/tools/browser_use/browser_use_tool.pyi +0 -50
  232. aip_agents/tools/browser_use/llm_config.pyi +0 -52
  233. aip_agents/tools/browser_use/minio_storage.pyi +0 -109
  234. aip_agents/tools/browser_use/schemas.pyi +0 -32
  235. aip_agents/tools/browser_use/session.pyi +0 -4
  236. aip_agents/tools/browser_use/session_errors.pyi +0 -53
  237. aip_agents/tools/browser_use/steel_session_recording.pyi +0 -63
  238. aip_agents/tools/browser_use/streaming.pyi +0 -81
  239. aip_agents/tools/browser_use/structured_data_parser.pyi +0 -86
  240. aip_agents/tools/browser_use/structured_data_recovery.pyi +0 -43
  241. aip_agents/tools/browser_use/types.pyi +0 -45
  242. aip_agents/tools/code_sandbox/__init__.pyi +0 -3
  243. aip_agents/tools/code_sandbox/constant.pyi +0 -4
  244. aip_agents/tools/code_sandbox/e2b_cloud_sandbox_extended.pyi +0 -102
  245. aip_agents/tools/code_sandbox/e2b_sandbox_tool.pyi +0 -29
  246. aip_agents/tools/constants.pyi +0 -138
  247. aip_agents/tools/date_range_tool.pyi +0 -21
  248. aip_agents/tools/document_loader/__init__.pyi +0 -7
  249. aip_agents/tools/document_loader/base_reader.pyi +0 -75
  250. aip_agents/tools/document_loader/docx_reader_tool.pyi +0 -10
  251. aip_agents/tools/document_loader/excel_reader_tool.pyi +0 -26
  252. aip_agents/tools/document_loader/pdf_reader_tool.pyi +0 -11
  253. aip_agents/tools/document_loader/pdf_splitter.pyi +0 -18
  254. aip_agents/tools/execute_ptc_code.pyi +0 -90
  255. aip_agents/tools/gl_connector/__init__.pyi +0 -3
  256. aip_agents/tools/gl_connector/tool.pyi +0 -74
  257. aip_agents/tools/gl_connector_tools.pyi +0 -39
  258. aip_agents/tools/memory_search/__init__.pyi +0 -5
  259. aip_agents/tools/memory_search/base.pyi +0 -69
  260. aip_agents/tools/memory_search/mem0.pyi +0 -19
  261. aip_agents/tools/memory_search/schema.pyi +0 -15
  262. aip_agents/tools/memory_search_tool.pyi +0 -3
  263. aip_agents/tools/time_tool.pyi +0 -16
  264. aip_agents/tools/tool_config_injector.pyi +0 -26
  265. aip_agents/tools/web_search/__init__.pyi +0 -3
  266. aip_agents/tools/web_search/serper_tool.pyi +0 -19
  267. aip_agents/types/__init__.pyi +0 -36
  268. aip_agents/types/a2a_events.pyi +0 -3
  269. aip_agents/utils/__init__.pyi +0 -11
  270. aip_agents/utils/a2a_connector.pyi +0 -146
  271. aip_agents/utils/artifact_helpers.pyi +0 -203
  272. aip_agents/utils/constants.pyi +0 -10
  273. aip_agents/utils/datetime/__init__.pyi +0 -4
  274. aip_agents/utils/datetime/normalization.pyi +0 -95
  275. aip_agents/utils/datetime/timezone.pyi +0 -48
  276. aip_agents/utils/env_loader.pyi +0 -10
  277. aip_agents/utils/event_handler_registry.pyi +0 -23
  278. aip_agents/utils/file_prompt_utils.pyi +0 -21
  279. aip_agents/utils/final_response_builder.pyi +0 -34
  280. aip_agents/utils/formatter_llm_client.pyi +0 -71
  281. aip_agents/utils/langgraph/__init__.pyi +0 -3
  282. aip_agents/utils/langgraph/converter.pyi +0 -49
  283. aip_agents/utils/langgraph/tool_managers/__init__.pyi +0 -5
  284. aip_agents/utils/langgraph/tool_managers/a2a_tool_manager.pyi +0 -35
  285. aip_agents/utils/langgraph/tool_managers/base_tool_manager.pyi +0 -48
  286. aip_agents/utils/langgraph/tool_managers/delegation_tool_manager.pyi +0 -56
  287. aip_agents/utils/langgraph/tool_output_management.pyi +0 -329
  288. aip_agents/utils/logger.pyi +0 -60
  289. aip_agents/utils/metadata/__init__.pyi +0 -5
  290. aip_agents/utils/metadata/activity_metadata_helper.pyi +0 -25
  291. aip_agents/utils/metadata/activity_narrative/__init__.pyi +0 -7
  292. aip_agents/utils/metadata/activity_narrative/builder.pyi +0 -35
  293. aip_agents/utils/metadata/activity_narrative/constants.pyi +0 -10
  294. aip_agents/utils/metadata/activity_narrative/context.pyi +0 -32
  295. aip_agents/utils/metadata/activity_narrative/formatters.pyi +0 -48
  296. aip_agents/utils/metadata/activity_narrative/utils.pyi +0 -12
  297. aip_agents/utils/metadata/schemas/__init__.pyi +0 -4
  298. aip_agents/utils/metadata/schemas/activity_schema.pyi +0 -18
  299. aip_agents/utils/metadata/schemas/thinking_schema.pyi +0 -20
  300. aip_agents/utils/metadata/thinking_metadata_helper.pyi +0 -4
  301. aip_agents/utils/metadata_helper.pyi +0 -117
  302. aip_agents/utils/name_preprocessor/__init__.pyi +0 -6
  303. aip_agents/utils/name_preprocessor/base_name_preprocessor.pyi +0 -52
  304. aip_agents/utils/name_preprocessor/google_name_preprocessor.pyi +0 -38
  305. aip_agents/utils/name_preprocessor/name_preprocessor.pyi +0 -41
  306. aip_agents/utils/name_preprocessor/openai_name_preprocessor.pyi +0 -34
  307. aip_agents/utils/pii/__init__.pyi +0 -5
  308. aip_agents/utils/pii/pii_handler.pyi +0 -96
  309. aip_agents/utils/pii/pii_helper.pyi +0 -78
  310. aip_agents/utils/pii/uuid_deanonymizer_mapping.pyi +0 -73
  311. aip_agents/utils/reference_helper.pyi +0 -81
  312. aip_agents/utils/sse_chunk_transformer.pyi +0 -166
  313. aip_agents/utils/step_limit_manager.pyi +0 -112
  314. aip_agents/utils/token_usage_helper.pyi +0 -60
  315. aip_agents_binary-0.6.3.dist-info/RECORD +0 -614
  316. {aip_agents_binary-0.6.3.dist-info → aip_agents_binary-0.6.5.dist-info}/WHEEL +0 -0
  317. {aip_agents_binary-0.6.3.dist-info → aip_agents_binary-0.6.5.dist-info}/top_level.txt +0 -0
@@ -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
 
@@ -6,6 +6,7 @@ Authors:
6
6
 
7
7
  import inspect
8
8
  import os
9
+ from typing import Any
9
10
 
10
11
  from bosa_core.telemetry import (
11
12
  FastAPIConfig,
@@ -20,7 +21,7 @@ from bosa_core.telemetry.opentelemetry.instrument.functions import (
20
21
  from dotenv import load_dotenv
21
22
  from fastapi import FastAPI
22
23
 
23
- from aip_agents.agent import BaseAgent, GoogleADKAgent, LangChainAgent, LangGraphAgent
24
+ from aip_agents.agent import BaseAgent, LangChainAgent, LangGraphAgent
24
25
  from aip_agents.utils.logger import get_logger
25
26
 
26
27
  load_dotenv()
@@ -35,12 +36,32 @@ VERSION_NUMBER = os.getenv("VERSION_NUMBER", "0.0.0")
35
36
  BUILD_NUMBER = os.getenv("BUILD_NUMBER", "0")
36
37
  USE_OPENTELEMETRY = os.getenv("USE_OPENTELEMETRY", "true").lower() == "true"
37
38
 
38
- CLASSES_TO_INSTRUMENT = [
39
- BaseAgent,
40
- LangGraphAgent,
41
- LangChainAgent,
42
- GoogleADKAgent,
43
- ]
39
+ # Lazy import of GoogleADKAgent to avoid heavy dependencies when not needed.
40
+ # This is initialized lazily by _get_classes_to_instrument() and can be
41
+ # patched by tests for mocking purposes.
42
+ CLASSES_TO_INSTRUMENT: list[type[Any]] | None = None
43
+
44
+
45
+ def _get_classes_to_instrument() -> list[type[Any]]:
46
+ """Get the list of classes to instrument.
47
+
48
+ This lazily imports GoogleADKAgent only when telemetry is being set up,
49
+ avoiding the heavy Google ADK dependencies during module import.
50
+
51
+ Returns:
52
+ List of agent classes to instrument.
53
+ """
54
+ global CLASSES_TO_INSTRUMENT
55
+ if CLASSES_TO_INSTRUMENT is None:
56
+ from aip_agents.agent import GoogleADKAgent
57
+
58
+ CLASSES_TO_INSTRUMENT = [
59
+ BaseAgent,
60
+ LangGraphAgent,
61
+ LangChainAgent,
62
+ GoogleADKAgent,
63
+ ]
64
+ return CLASSES_TO_INSTRUMENT
44
65
 
45
66
 
46
67
  def get_all_methods(cls: type) -> list:
@@ -66,7 +87,7 @@ def instrument_gl_functions() -> None:
66
87
  if BOSAFunctionsInstrumentor is None:
67
88
  return
68
89
  agent_methods = []
69
- for cls in CLASSES_TO_INSTRUMENT:
90
+ for cls in _get_classes_to_instrument():
70
91
  agent_methods.extend(get_all_methods(cls))
71
92
  BOSAFunctionsInstrumentor().instrument(methods=agent_methods)
72
93
 
@@ -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
  ]
@@ -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
@@ -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
+ )
@@ -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,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aip-agents-binary
3
- Version: 0.6.3
3
+ Version: 0.6.5
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.