agent-framework-core 1.17.0__tar.gz → 1.19.0__tar.gz

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.
Files changed (115) hide show
  1. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/PKG-INFO +18 -3
  2. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/README.md +15 -0
  3. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/__init__.py +70 -1
  4. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/__init__.pyi +61 -1
  5. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/_agents.py +23 -8
  6. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/_compaction.py +275 -15
  7. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/_evaluation.py +133 -169
  8. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/_feature_stage.py +1 -0
  9. agent_framework_core-1.19.0/agent_framework/_filesystem.py +138 -0
  10. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/_harness/_agent.py +2 -2
  11. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/_harness/_file_access.py +474 -76
  12. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/_harness/_file_memory.py +61 -7
  13. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/_harness/_memory.py +58 -13
  14. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/_harness/_mode.py +69 -17
  15. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/_harness/_todo.py +13 -40
  16. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/_harness/_tool_approval.py +67 -42
  17. agent_framework_core-1.19.0/agent_framework/_in_memory.py +508 -0
  18. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/_mcp.py +1112 -115
  19. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/_middleware.py +80 -12
  20. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/_serialization.py +144 -60
  21. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/_sessions.py +109 -65
  22. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/_settings.py +79 -17
  23. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/_skills.py +435 -276
  24. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/_telemetry.py +3 -0
  25. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/_tools.py +1988 -297
  26. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/_types.py +135 -29
  27. agent_framework_core-1.19.0/agent_framework/_vector_filters.py +874 -0
  28. agent_framework_core-1.19.0/agent_framework/_vectors.py +3305 -0
  29. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/_workflows/_agent.py +45 -18
  30. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/_workflows/_agent_executor.py +26 -32
  31. agent_framework_core-1.19.0/agent_framework/_workflows/_agent_utils.py +153 -0
  32. agent_framework_core-1.19.0/agent_framework/_workflows/_checkpoint.py +873 -0
  33. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/_workflows/_checkpoint_encoding.py +10 -3
  34. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/_workflows/_const.py +15 -2
  35. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/_workflows/_edge_runner.py +111 -6
  36. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/_workflows/_events.py +28 -5
  37. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/_workflows/_executor.py +8 -9
  38. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/_workflows/_function_executor.py +7 -9
  39. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/_workflows/_functional.py +124 -93
  40. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/_workflows/_request_info_mixin.py +46 -7
  41. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/_workflows/_runner.py +66 -21
  42. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/_workflows/_typing_utils.py +24 -3
  43. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/_workflows/_workflow.py +257 -76
  44. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/_workflows/_workflow_executor.py +48 -28
  45. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/ag_ui/__init__.py +4 -0
  46. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/ag_ui/__init__.pyi +4 -0
  47. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/azure/__init__.py +5 -0
  48. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/azure/__init__.pyi +8 -0
  49. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/exceptions.py +6 -0
  50. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/observability.py +152 -48
  51. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/redis/__init__.py +4 -1
  52. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/redis/__init__.pyi +6 -0
  53. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/security.py +1704 -740
  54. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/pyproject.toml +7 -4
  55. agent_framework_core-1.17.0/agent_framework/_filesystem.py +0 -23
  56. agent_framework_core-1.17.0/agent_framework/_workflows/_agent_utils.py +0 -17
  57. agent_framework_core-1.17.0/agent_framework/_workflows/_checkpoint.py +0 -462
  58. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/LICENSE +0 -0
  59. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/_agent_hooks.py +0 -0
  60. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/_clients.py +0 -0
  61. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/_docstrings.py +0 -0
  62. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/_harness/__init__.py +0 -0
  63. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/_harness/_agent.pyi +0 -0
  64. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/_harness/_background_agents.py +0 -0
  65. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/_harness/_loop.py +0 -0
  66. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/_workflows/__init__.py +0 -0
  67. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/_workflows/_conversation_history.py +0 -0
  68. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/_workflows/_edge.py +0 -0
  69. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/_workflows/_message_utils.py +0 -0
  70. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/_workflows/_model_utils.py +0 -0
  71. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/_workflows/_runner_context.py +0 -0
  72. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/_workflows/_state.py +0 -0
  73. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/_workflows/_validation.py +0 -0
  74. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/_workflows/_viz.py +0 -0
  75. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/_workflows/_workflow_builder.py +0 -0
  76. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/_workflows/_workflow_context.py +0 -0
  77. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/a2a/__init__.py +0 -0
  78. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/a2a/__init__.pyi +0 -0
  79. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/amazon/__init__.py +0 -0
  80. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/amazon/__init__.pyi +0 -0
  81. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/anthropic/__init__.py +0 -0
  82. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/anthropic/__init__.pyi +0 -0
  83. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/chatkit/__init__.py +0 -0
  84. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/chatkit/__init__.pyi +0 -0
  85. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/declarative/__init__.py +0 -0
  86. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/declarative/__init__.pyi +0 -0
  87. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/devui/__init__.py +0 -0
  88. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/devui/__init__.pyi +0 -0
  89. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/foundry/__init__.py +0 -0
  90. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/foundry/__init__.pyi +0 -0
  91. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/gemini/__init__.py +0 -0
  92. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/gemini/__init__.pyi +0 -0
  93. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/github/__init__.py +0 -0
  94. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/github/__init__.pyi +0 -0
  95. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/google/__init__.py +0 -0
  96. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/google/__init__.pyi +0 -0
  97. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/hyperlight/__init__.py +0 -0
  98. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/lab/__init__.py +0 -0
  99. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/mem0/__init__.py +0 -0
  100. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/mem0/__init__.pyi +0 -0
  101. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/microsoft/__init__.py +0 -0
  102. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/microsoft/__init__.pyi +0 -0
  103. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/mistral/__init__.py +0 -0
  104. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/mistral/__init__.pyi +0 -0
  105. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/monty/__init__.py +0 -0
  106. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/monty/__init__.pyi +0 -0
  107. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/ollama/__init__.py +0 -0
  108. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/ollama/__init__.pyi +0 -0
  109. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/openai/__init__.py +0 -0
  110. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/openai/__init__.pyi +0 -0
  111. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/orchestrations/__init__.py +0 -0
  112. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/orchestrations/__init__.pyi +0 -0
  113. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/py.typed +0 -0
  114. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/tools/__init__.py +0 -0
  115. {agent_framework_core-1.17.0 → agent_framework_core-1.19.0}/agent_framework/tools/__init__.pyi +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: agent-framework-core
3
- Version: 1.17.0
3
+ Version: 1.19.0
4
4
  Summary: Microsoft Agent Framework for building AI Agents with Python. This is the core package that has all the core abstractions and implementations.
5
5
  Author-email: Microsoft <af-support@microsoft.com>
6
6
  Requires-Python: >=3.10
@@ -21,6 +21,7 @@ Requires-Dist: typing-extensions>=4.15.0,<5
21
21
  Requires-Dist: pydantic>=2,<3
22
22
  Requires-Dist: python-dotenv>=1,<2
23
23
  Requires-Dist: opentelemetry-api>=1.39.0,<2
24
+ Requires-Dist: pyyaml>=6.0,<7.0
24
25
  Requires-Dist: mcp>=1.24.0,<2 ; extra == "all"
25
26
  Requires-Dist: agent-framework-a2a ; extra == "all"
26
27
  Requires-Dist: agent-framework-ag-ui ; extra == "all"
@@ -41,8 +42,7 @@ Requires-Dist: agent-framework-foundry-hosting ; extra == "all"
41
42
  Requires-Dist: agent-framework-foundry-local ; extra == "all"
42
43
  Requires-Dist: agent-framework-gemini ; extra == "all"
43
44
  Requires-Dist: agent-framework-github-copilot ; extra == "all" and ( python_version >= '3.11')
44
- Requires-Dist: agent-framework-hyperlight ; extra == "all" and ( ((sys_platform == 'linux' and platform_machine == 'x86_64') or (sys_platform == 'win32' and platform_machine == 'AMD64')) and python_version < '3.14')
45
- Requires-Dist: agent-framework-lab ; extra == "all"
45
+ Requires-Dist: agent-framework-hyperlight ; extra == "all" and ( python_version < '3.15' and ((sys_platform == 'linux' and platform_machine == 'x86_64') or (sys_platform == 'win32' and platform_machine == 'AMD64')))
46
46
  Requires-Dist: agent-framework-mem0 ; extra == "all"
47
47
  Requires-Dist: agent-framework-mistral ; extra == "all"
48
48
  Requires-Dist: agent-framework-monty ; extra == "all"
@@ -228,6 +228,21 @@ asyncio.run(main())
228
228
 
229
229
  You can explore additional agent samples [here](https://github.com/microsoft/agent-framework/tree/main/python/samples/02-agents).
230
230
 
231
+ ### MCP HTTP client ownership and cookies
232
+
233
+ **Breaking change:** HTTP clients created by `MCPStreamableHTTPTool` no longer persist
234
+ response cookies. This applies with or without a `header_provider`, including repeated
235
+ calls within the same MCP session. Connection reuse, timeout and redirect defaults,
236
+ and cleanup on close or reset are preserved. Explicit `Cookie` headers supplied through
237
+ `static_headers` or a `header_provider` are still supported.
238
+
239
+ Applications relying on cookie-based authentication, sessions, or load-balancer affinity
240
+ must supply an `httpx.AsyncClient` through `http_client=`. Supplied clients retain their
241
+ configuration and response-cookie handling and must be closed by the caller. Scope
242
+ cookie-bearing clients and MCP tool sessions to one authenticated principal; do not
243
+ share a user-specific cookie jar across users. Rejecting cookies does not partition
244
+ MCP protocol sessions or other server-side state between principals.
245
+
231
246
  ## 5. Multi-Agent Orchestration
232
247
 
233
248
  Coordinate multiple agents to collaborate on complex tasks using orchestration patterns:
@@ -168,6 +168,21 @@ asyncio.run(main())
168
168
 
169
169
  You can explore additional agent samples [here](https://github.com/microsoft/agent-framework/tree/main/python/samples/02-agents).
170
170
 
171
+ ### MCP HTTP client ownership and cookies
172
+
173
+ **Breaking change:** HTTP clients created by `MCPStreamableHTTPTool` no longer persist
174
+ response cookies. This applies with or without a `header_provider`, including repeated
175
+ calls within the same MCP session. Connection reuse, timeout and redirect defaults,
176
+ and cleanup on close or reset are preserved. Explicit `Cookie` headers supplied through
177
+ `static_headers` or a `header_provider` are still supported.
178
+
179
+ Applications relying on cookie-based authentication, sessions, or load-balancer affinity
180
+ must supply an `httpx.AsyncClient` through `http_client=`. Supplied clients retain their
181
+ configuration and response-cookie handling and must be closed by the caller. Scope
182
+ cookie-bearing clients and MCP tool sessions to one authenticated principal; do not
183
+ share a user-specific cookie jar across users. Rejecting cookies does not partition
184
+ MCP protocol sessions or other server-side state between principals.
185
+
171
186
  ## 5. Multi-Agent Orchestration
172
187
 
173
188
  Coordinate multiple agents to collaborate on complex tasks using orchestration patterns:
@@ -33,6 +33,7 @@ from ._telemetry import (
33
33
  from .exceptions import (
34
34
  AgentFrameworkException,
35
35
  MiddlewareException,
36
+ ResponseInvalidatedException,
36
37
  UserInputRequiredException,
37
38
  WorkflowCheckpointException,
38
39
  WorkflowConvergenceException,
@@ -284,6 +285,42 @@ _LAZY_MODULE_EXPORTS: Final[Mapping[str, tuple[str, ...]]] = {
284
285
  "validate_tool_mode",
285
286
  "validate_tools",
286
287
  ),
288
+ "._in_memory": (
289
+ "InMemoryCollection",
290
+ "InMemoryStore",
291
+ ),
292
+ "._vector_filters": (
293
+ "Filter",
294
+ "FilterGroup",
295
+ "FilterGroupOperator",
296
+ "FilterOperator",
297
+ "Param",
298
+ ),
299
+ "._vectors": (
300
+ "DISTANCE_FUNCTION_DIRECTION_HELPER",
301
+ "BaseVectorCollection",
302
+ "BaseVectorSearch",
303
+ "BaseVectorStore",
304
+ "DistanceFunction",
305
+ "FieldTypes",
306
+ "GenerateVectors",
307
+ "IndexKind",
308
+ "SearchResponse",
309
+ "SearchResults",
310
+ "SearchType",
311
+ "SupportsVectorSearch",
312
+ "SupportsVectorUpsert",
313
+ "VectorCollectionContextProvider",
314
+ "VectorStoreCollectionDefinition",
315
+ "VectorStoreField",
316
+ "VectorStoreHistoryProvider",
317
+ "create_delete_tool",
318
+ "create_get_tool",
319
+ "create_upsert_tool",
320
+ "create_vector_search_tool",
321
+ "register_vectorstoremodel",
322
+ "vectorstoremodel",
323
+ ),
287
324
  "._workflows._agent": ("WorkflowAgent",),
288
325
  "._workflows._agent_executor": ("AgentExecutor", "AgentExecutorRequest", "AgentExecutorResponse"),
289
326
  "._workflows._agent_utils": ("resolve_agent_id",),
@@ -343,7 +380,7 @@ _LAZY_MODULE_EXPORTS: Final[Mapping[str, tuple[str, ...]]] = {
343
380
  "validate_workflow_graph",
344
381
  ),
345
382
  "._workflows._viz": ("WorkflowViz",),
346
- "._workflows._workflow": ("Workflow", "WorkflowRunResult"),
383
+ "._workflows._workflow": ("Workflow", "WorkflowInvocationKwargs", "WorkflowRunResult"),
347
384
  "._workflows._workflow_builder": ("WorkflowBuilder",),
348
385
  "._workflows._workflow_context": ("WorkflowContext",),
349
386
  "._workflows._workflow_executor": (
@@ -371,6 +408,7 @@ __all__ = [
371
408
  "DEFAULT_MODE_SOURCE_ID",
372
409
  "DEFAULT_TODO_SOURCE_ID",
373
410
  "DEFAULT_TOOL_APPROVAL_SOURCE_ID",
411
+ "DISTANCE_FUNCTION_DIRECTION_HELPER",
374
412
  "EXCLUDED_KEY",
375
413
  "EXCLUDE_REASON_KEY",
376
414
  "GROUP_ANNOTATION_KEY",
@@ -412,6 +450,9 @@ __all__ = [
412
450
  "BaseAgent",
413
451
  "BaseChatClient",
414
452
  "BaseEmbeddingClient",
453
+ "BaseVectorCollection",
454
+ "BaseVectorSearch",
455
+ "BaseVectorStore",
415
456
  "CachingSkillsSource",
416
457
  "Case",
417
458
  "CharacterEstimatorTokenizer",
@@ -438,6 +479,7 @@ __all__ = [
438
479
  "DeduplicatingSkillsSource",
439
480
  "Default",
440
481
  "DelegatingSkillsSource",
482
+ "DistanceFunction",
441
483
  "Edge",
442
484
  "EdgeCondition",
443
485
  "EdgeDuplicationError",
@@ -456,6 +498,7 @@ __all__ = [
456
498
  "ExperimentalFeature",
457
499
  "FanInEdgeGroup",
458
500
  "FanOutEdgeGroup",
501
+ "FieldTypes",
459
502
  "FileAccessProvider",
460
503
  "FileCheckpointStorage",
461
504
  "FileHistoryProvider",
@@ -468,6 +511,10 @@ __all__ = [
468
511
  "FileSkillsSource",
469
512
  "FileStoreEntry",
470
513
  "FileSystemAgentFileStore",
514
+ "Filter",
515
+ "FilterGroup",
516
+ "FilterGroupOperator",
517
+ "FilterOperator",
471
518
  "FilteringSkillsSource",
472
519
  "FinalT",
473
520
  "FinishReason",
@@ -482,14 +529,18 @@ __all__ = [
482
529
  "FunctionalWorkflow",
483
530
  "FunctionalWorkflowAgent",
484
531
  "FunctionalWorkflowDefinition",
532
+ "GenerateVectors",
485
533
  "GeneratedEmbeddings",
486
534
  "GraphConnectivityError",
487
535
  "HistoryProvider",
488
536
  "InMemoryAgentFileStore",
489
537
  "InMemoryCheckpointStorage",
538
+ "InMemoryCollection",
490
539
  "InMemoryHistoryProvider",
491
540
  "InMemorySkillsSource",
541
+ "InMemoryStore",
492
542
  "InProcRunnerContext",
543
+ "IndexKind",
493
544
  "InlineSkill",
494
545
  "InlineSkillResource",
495
546
  "InlineSkillScript",
@@ -517,8 +568,10 @@ __all__ = [
517
568
  "MiddlewareTypes",
518
569
  "OuterFinalT",
519
570
  "OuterUpdateT",
571
+ "Param",
520
572
  "RawAgent",
521
573
  "ReleaseCandidateFeature",
574
+ "ResponseInvalidatedException",
522
575
  "ResponseStream",
523
576
  "Role",
524
577
  "RoleLiteral",
@@ -527,6 +580,9 @@ __all__ = [
527
580
  "Runner",
528
581
  "RunnerContext",
529
582
  "SamplingApprovalCallback",
583
+ "SearchResponse",
584
+ "SearchResults",
585
+ "SearchType",
530
586
  "SecretString",
531
587
  "SelectiveToolCallCompactionStrategy",
532
588
  "ServiceSessionId",
@@ -555,6 +611,8 @@ __all__ = [
555
611
  "SupportsImageGenerationTool",
556
612
  "SupportsMCPTool",
557
613
  "SupportsShellTool",
614
+ "SupportsVectorSearch",
615
+ "SupportsVectorUpsert",
558
616
  "SupportsWebSearchTool",
559
617
  "SwitchCaseEdgeGroup",
560
618
  "SwitchCaseEdgeGroupCase",
@@ -580,6 +638,10 @@ __all__ = [
580
638
  "UsageDetails",
581
639
  "UserInputRequiredException",
582
640
  "ValidationTypeEnum",
641
+ "VectorCollectionContextProvider",
642
+ "VectorStoreCollectionDefinition",
643
+ "VectorStoreField",
644
+ "VectorStoreHistoryProvider",
583
645
  "Workflow",
584
646
  "WorkflowAgent",
585
647
  "WorkflowBuilder",
@@ -593,6 +655,7 @@ __all__ = [
593
655
  "WorkflowEventType",
594
656
  "WorkflowException",
595
657
  "WorkflowExecutor",
658
+ "WorkflowInvocationKwargs",
596
659
  "WorkflowMessage",
597
660
  "WorkflowRunResult",
598
661
  "WorkflowRunState",
@@ -611,8 +674,12 @@ __all__ = [
611
674
  "create_agent_hooks_middleware_from_emitter",
612
675
  "create_always_approve_tool_response",
613
676
  "create_always_approve_tool_with_arguments_response",
677
+ "create_delete_tool",
614
678
  "create_edge_runner",
679
+ "create_get_tool",
615
680
  "create_harness_agent",
681
+ "create_upsert_tool",
682
+ "create_vector_search_tool",
616
683
  "detect_media_type_from_base64",
617
684
  "enqueue_messages",
618
685
  "evaluate_agent",
@@ -636,6 +703,7 @@ __all__ = [
636
703
  "prepend_instructions_to_messages",
637
704
  "register_checkpoint_type",
638
705
  "register_state_type",
706
+ "register_vectorstoremodel",
639
707
  "resolve_agent_id",
640
708
  "response_handler",
641
709
  "set_agent_mode",
@@ -650,6 +718,7 @@ __all__ = [
650
718
  "validate_tool_mode",
651
719
  "validate_tools",
652
720
  "validate_workflow_graph",
721
+ "vectorstoremodel",
653
722
  "workflow",
654
723
  ]
655
724
 
@@ -123,6 +123,7 @@ from ._harness._tool_approval import (
123
123
  create_always_approve_tool_response,
124
124
  create_always_approve_tool_with_arguments_response,
125
125
  )
126
+ from ._in_memory import InMemoryCollection, InMemoryStore
126
127
  from ._mcp import (
127
128
  MCPStdioTool,
128
129
  MCPStreamableHTTPTool,
@@ -250,6 +251,32 @@ from ._types import (
250
251
  validate_tool_mode,
251
252
  validate_tools,
252
253
  )
254
+ from ._vector_filters import Filter, FilterGroup, FilterGroupOperator, FilterOperator, Param
255
+ from ._vectors import (
256
+ DISTANCE_FUNCTION_DIRECTION_HELPER,
257
+ BaseVectorCollection,
258
+ BaseVectorSearch,
259
+ BaseVectorStore,
260
+ DistanceFunction,
261
+ FieldTypes,
262
+ GenerateVectors,
263
+ IndexKind,
264
+ SearchResponse,
265
+ SearchResults,
266
+ SearchType,
267
+ SupportsVectorSearch,
268
+ SupportsVectorUpsert,
269
+ VectorCollectionContextProvider,
270
+ VectorStoreCollectionDefinition,
271
+ VectorStoreField,
272
+ VectorStoreHistoryProvider,
273
+ create_delete_tool,
274
+ create_get_tool,
275
+ create_upsert_tool,
276
+ create_vector_search_tool,
277
+ register_vectorstoremodel,
278
+ vectorstoremodel,
279
+ )
253
280
  from ._workflows._agent import WorkflowAgent
254
281
  from ._workflows._agent_executor import AgentExecutor, AgentExecutorRequest, AgentExecutorResponse
255
282
  from ._workflows._agent_utils import resolve_agent_id
@@ -306,13 +333,14 @@ from ._workflows._validation import (
306
333
  validate_workflow_graph,
307
334
  )
308
335
  from ._workflows._viz import WorkflowViz
309
- from ._workflows._workflow import Workflow, WorkflowRunResult
336
+ from ._workflows._workflow import Workflow, WorkflowInvocationKwargs, WorkflowRunResult
310
337
  from ._workflows._workflow_builder import WorkflowBuilder
311
338
  from ._workflows._workflow_context import WorkflowContext
312
339
  from ._workflows._workflow_executor import SubWorkflowRequestMessage, SubWorkflowResponseMessage, WorkflowExecutor
313
340
  from .exceptions import (
314
341
  AgentFrameworkException,
315
342
  MiddlewareException,
343
+ ResponseInvalidatedException,
316
344
  UserInputRequiredException,
317
345
  WorkflowCheckpointException,
318
346
  WorkflowConvergenceException,
@@ -335,6 +363,7 @@ __all__ = [
335
363
  "DEFAULT_MODE_SOURCE_ID",
336
364
  "DEFAULT_TODO_SOURCE_ID",
337
365
  "DEFAULT_TOOL_APPROVAL_SOURCE_ID",
366
+ "DISTANCE_FUNCTION_DIRECTION_HELPER",
338
367
  "EXCLUDED_KEY",
339
368
  "EXCLUDE_REASON_KEY",
340
369
  "GROUP_ANNOTATION_KEY",
@@ -376,6 +405,9 @@ __all__ = [
376
405
  "BaseAgent",
377
406
  "BaseChatClient",
378
407
  "BaseEmbeddingClient",
408
+ "BaseVectorCollection",
409
+ "BaseVectorSearch",
410
+ "BaseVectorStore",
379
411
  "CachingSkillsSource",
380
412
  "Case",
381
413
  "CharacterEstimatorTokenizer",
@@ -402,6 +434,7 @@ __all__ = [
402
434
  "DeduplicatingSkillsSource",
403
435
  "Default",
404
436
  "DelegatingSkillsSource",
437
+ "DistanceFunction",
405
438
  "Edge",
406
439
  "EdgeCondition",
407
440
  "EdgeDuplicationError",
@@ -420,6 +453,7 @@ __all__ = [
420
453
  "ExperimentalFeature",
421
454
  "FanInEdgeGroup",
422
455
  "FanOutEdgeGroup",
456
+ "FieldTypes",
423
457
  "FileAccessProvider",
424
458
  "FileCheckpointStorage",
425
459
  "FileHistoryProvider",
@@ -432,6 +466,10 @@ __all__ = [
432
466
  "FileSkillsSource",
433
467
  "FileStoreEntry",
434
468
  "FileSystemAgentFileStore",
469
+ "Filter",
470
+ "FilterGroup",
471
+ "FilterGroupOperator",
472
+ "FilterOperator",
435
473
  "FilteringSkillsSource",
436
474
  "FinalT",
437
475
  "FinishReason",
@@ -446,14 +484,18 @@ __all__ = [
446
484
  "FunctionalWorkflow",
447
485
  "FunctionalWorkflowAgent",
448
486
  "FunctionalWorkflowDefinition",
487
+ "GenerateVectors",
449
488
  "GeneratedEmbeddings",
450
489
  "GraphConnectivityError",
451
490
  "HistoryProvider",
452
491
  "InMemoryAgentFileStore",
453
492
  "InMemoryCheckpointStorage",
493
+ "InMemoryCollection",
454
494
  "InMemoryHistoryProvider",
455
495
  "InMemorySkillsSource",
496
+ "InMemoryStore",
456
497
  "InProcRunnerContext",
498
+ "IndexKind",
457
499
  "InlineSkill",
458
500
  "InlineSkillResource",
459
501
  "InlineSkillScript",
@@ -481,8 +523,10 @@ __all__ = [
481
523
  "MiddlewareTypes",
482
524
  "OuterFinalT",
483
525
  "OuterUpdateT",
526
+ "Param",
484
527
  "RawAgent",
485
528
  "ReleaseCandidateFeature",
529
+ "ResponseInvalidatedException",
486
530
  "ResponseStream",
487
531
  "Role",
488
532
  "RoleLiteral",
@@ -491,6 +535,9 @@ __all__ = [
491
535
  "Runner",
492
536
  "RunnerContext",
493
537
  "SamplingApprovalCallback",
538
+ "SearchResponse",
539
+ "SearchResults",
540
+ "SearchType",
494
541
  "SecretString",
495
542
  "SelectiveToolCallCompactionStrategy",
496
543
  "ServiceSessionId",
@@ -519,6 +566,8 @@ __all__ = [
519
566
  "SupportsImageGenerationTool",
520
567
  "SupportsMCPTool",
521
568
  "SupportsShellTool",
569
+ "SupportsVectorSearch",
570
+ "SupportsVectorUpsert",
522
571
  "SupportsWebSearchTool",
523
572
  "SwitchCaseEdgeGroup",
524
573
  "SwitchCaseEdgeGroupCase",
@@ -544,6 +593,10 @@ __all__ = [
544
593
  "UsageDetails",
545
594
  "UserInputRequiredException",
546
595
  "ValidationTypeEnum",
596
+ "VectorCollectionContextProvider",
597
+ "VectorStoreCollectionDefinition",
598
+ "VectorStoreField",
599
+ "VectorStoreHistoryProvider",
547
600
  "Workflow",
548
601
  "WorkflowAgent",
549
602
  "WorkflowBuilder",
@@ -557,6 +610,7 @@ __all__ = [
557
610
  "WorkflowEventType",
558
611
  "WorkflowException",
559
612
  "WorkflowExecutor",
613
+ "WorkflowInvocationKwargs",
560
614
  "WorkflowMessage",
561
615
  "WorkflowRunResult",
562
616
  "WorkflowRunState",
@@ -575,8 +629,12 @@ __all__ = [
575
629
  "create_agent_hooks_middleware_from_emitter",
576
630
  "create_always_approve_tool_response",
577
631
  "create_always_approve_tool_with_arguments_response",
632
+ "create_delete_tool",
578
633
  "create_edge_runner",
634
+ "create_get_tool",
579
635
  "create_harness_agent",
636
+ "create_upsert_tool",
637
+ "create_vector_search_tool",
580
638
  "detect_media_type_from_base64",
581
639
  "enqueue_messages",
582
640
  "evaluate_agent",
@@ -600,6 +658,7 @@ __all__ = [
600
658
  "prepend_instructions_to_messages",
601
659
  "register_checkpoint_type",
602
660
  "register_state_type",
661
+ "register_vectorstoremodel",
603
662
  "resolve_agent_id",
604
663
  "response_handler",
605
664
  "set_agent_mode",
@@ -614,5 +673,6 @@ __all__ = [
614
673
  "validate_tool_mode",
615
674
  "validate_tools",
616
675
  "validate_workflow_graph",
676
+ "vectorstoremodel",
617
677
  "workflow",
618
678
  ]
@@ -1405,8 +1405,10 @@ class RawAgent(BaseAgent, Generic[OptionsCoT]):
1405
1405
  self.context_providers.append(InMemoryHistoryProvider())
1406
1406
 
1407
1407
  active_session = session
1408
+ framework_created_session = False
1408
1409
  if active_session is None and self.context_providers:
1409
1410
  active_session = AgentSession()
1411
+ framework_created_session = True
1410
1412
 
1411
1413
  per_service_call_history_providers = self._resolve_per_service_call_history_providers(
1412
1414
  session=active_session,
@@ -1455,12 +1457,22 @@ class RawAgent(BaseAgent, Generic[OptionsCoT]):
1455
1457
  # Normalize tools
1456
1458
  normalized_tools = _normalize_tools(tools_)
1457
1459
 
1460
+ # Extract additional function arguments
1461
+ effective_function_invocation_kwargs = (
1462
+ dict(function_invocation_kwargs) if function_invocation_kwargs is not None else {}
1463
+ )
1464
+ additional_function_arguments = {**effective_function_invocation_kwargs, **existing_additional_args}
1465
+
1458
1466
  # Resolve final tool list (configured tools + runtime provided tools + local MCP server tools)
1459
1467
  final_tools = list(base_tools)
1460
1468
  for tool in normalized_tools:
1461
1469
  if isinstance(tool, MCPTool):
1470
+ await tool._prepare_for_run(additional_function_arguments) # pyright: ignore[reportPrivateUsage]
1462
1471
  if not tool.is_connected:
1472
+ # The handshake and discovery requests are issued before any tool call, so the run's
1473
+ # kwargs must reach header_provider here or those requests go out unauthenticated.
1463
1474
  await self._async_exit_stack.enter_async_context(tool)
1475
+ await tool._prepare_for_run(additional_function_arguments) # pyright: ignore[reportPrivateUsage]
1464
1476
  _append_unique_tools(
1465
1477
  final_tools,
1466
1478
  tool.functions,
@@ -1470,19 +1482,18 @@ class RawAgent(BaseAgent, Generic[OptionsCoT]):
1470
1482
  _append_unique_tools(final_tools, [tool])
1471
1483
 
1472
1484
  for mcp_server in self.mcp_tools:
1485
+ await mcp_server._prepare_for_run(additional_function_arguments) # pyright: ignore[reportPrivateUsage]
1473
1486
  if not mcp_server.is_connected:
1474
1487
  await self._async_exit_stack.enter_async_context(mcp_server)
1488
+ await mcp_server._prepare_for_run( # pyright: ignore[reportPrivateUsage]
1489
+ additional_function_arguments
1490
+ )
1475
1491
  _append_unique_tools(
1476
1492
  final_tools,
1477
1493
  mcp_server.functions,
1478
1494
  duplicate_error_message=mcp_duplicate_message,
1479
1495
  )
1480
1496
 
1481
- effective_function_invocation_kwargs = (
1482
- dict(function_invocation_kwargs) if function_invocation_kwargs is not None else {}
1483
- )
1484
- additional_function_arguments = {**effective_function_invocation_kwargs, **existing_additional_args}
1485
-
1486
1497
  model = opts.pop("model", None)
1487
1498
 
1488
1499
  # Build options dict from run() options merged with provided options
@@ -1520,8 +1531,12 @@ class RawAgent(BaseAgent, Generic[OptionsCoT]):
1520
1531
  session_messages: list[Message] = session_context.get_messages(include_input=True)
1521
1532
 
1522
1533
  effective_client_kwargs = dict(client_kwargs) if client_kwargs is not None else {}
1534
+ from ._tools import _APPROVAL_SESSION_IS_AUTHORITATIVE_KEY # pyright: ignore[reportPrivateUsage]
1535
+
1536
+ effective_client_kwargs.pop(_APPROVAL_SESSION_IS_AUTHORITATIVE_KEY, None)
1523
1537
  if active_session is not None:
1524
1538
  effective_client_kwargs["session"] = active_session
1539
+ effective_client_kwargs[_APPROVAL_SESSION_IS_AUTHORITATIVE_KEY] = not framework_created_session
1525
1540
  per_service_call_history_middleware: PerServiceCallHistoryPersistingMiddleware | None = None
1526
1541
  if per_service_call_history_providers and active_session is not None:
1527
1542
  per_service_call_history_middleware = PerServiceCallHistoryPersistingMiddleware(
@@ -1712,7 +1727,7 @@ class RawAgent(BaseAgent, Generic[OptionsCoT]):
1712
1727
  logger.error("Failed to send log message to server: %s", e)
1713
1728
 
1714
1729
  @server.list_tools()
1715
- async def _list_tools() -> list[types.Tool]: # type: ignore
1730
+ async def _list_tools() -> list[types.Tool]:
1716
1731
  """List all tools in the agent."""
1717
1732
  schema = agent_tool.parameters()
1718
1733
 
@@ -1726,7 +1741,7 @@ class RawAgent(BaseAgent, Generic[OptionsCoT]):
1726
1741
  return [tool]
1727
1742
 
1728
1743
  @server.call_tool()
1729
- async def _call_tool( # type: ignore
1744
+ async def _call_tool(
1730
1745
  name: str, arguments: dict[str, Any]
1731
1746
  ) -> Sequence[types.TextContent | types.ImageContent | types.AudioContent | types.EmbeddedResource]:
1732
1747
  """Call a tool in the agent."""
@@ -1769,7 +1784,7 @@ class RawAgent(BaseAgent, Generic[OptionsCoT]):
1769
1784
  return mcp_content or [types.TextContent(type="text", text="")]
1770
1785
 
1771
1786
  @server.set_logging_level()
1772
- async def _set_logging_level(level: types.LoggingLevel) -> None: # type: ignore
1787
+ async def _set_logging_level(level: types.LoggingLevel) -> None:
1773
1788
  """Set the logging level for the server."""
1774
1789
  logger.setLevel(LOG_LEVEL_MAPPING[level])
1775
1790
  # emit this log with the new minimum level