agentbyte 0.4.3__tar.gz → 0.4.6__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 (243) hide show
  1. {agentbyte-0.4.3 → agentbyte-0.4.6}/.github/skills/agentbyte-ai-driven-orchestration/SKILL.md +55 -17
  2. {agentbyte-0.4.3 → agentbyte-0.4.6}/.github/skills/agentbyte-dataset/SKILL.md +47 -4
  3. agentbyte-0.4.6/.github/skills/agentbyte-multi-turn-context/SKILL.md +135 -0
  4. agentbyte-0.4.6/.github/skills/agentbyte-otel-tracing/SKILL.md +109 -0
  5. {agentbyte-0.4.3 → agentbyte-0.4.6}/.github/skills/agentbyte-plan-based-orchestration/SKILL.md +57 -10
  6. {agentbyte-0.4.3 → agentbyte-0.4.6}/.github/skills/agentbyte-round-robin-orchestration/SKILL.md +44 -15
  7. agentbyte-0.4.6/.github/skills/agentbyte-workflow/SKILL.md +157 -0
  8. {agentbyte-0.4.3 → agentbyte-0.4.6}/.gitignore +4 -0
  9. {agentbyte-0.4.3 → agentbyte-0.4.6}/CHANGELOG.md +44 -0
  10. {agentbyte-0.4.3 → agentbyte-0.4.6}/PKG-INFO +23 -3
  11. {agentbyte-0.4.3 → agentbyte-0.4.6}/README.md +22 -2
  12. {agentbyte-0.4.3 → agentbyte-0.4.6}/pyproject.toml +4 -0
  13. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/__about__.py +1 -1
  14. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/__init__.py +42 -4
  15. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/dataset/__init__.py +48 -41
  16. agentbyte-0.4.6/src/agentbyte/dataset/config.py +116 -0
  17. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/dataset/json.py +10 -12
  18. agentbyte-0.4.6/src/agentbyte/dataset/loader.py +83 -0
  19. agentbyte-0.4.6/src/agentbyte/dataset/sources.py +205 -0
  20. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/dataset/sqlite.py +18 -18
  21. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/orchestration/__init__.py +10 -0
  22. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/orchestration/ai.py +83 -32
  23. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/orchestration/base.py +153 -7
  24. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/orchestration/plan.py +183 -31
  25. agentbyte-0.4.6/src/agentbyte/orchestration/policies.py +81 -0
  26. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/orchestration/round_robin.py +24 -24
  27. agentbyte-0.4.6/src/agentbyte/presets/__init__.py +24 -0
  28. agentbyte-0.4.6/src/agentbyte/presets/agents.py +190 -0
  29. agentbyte-0.4.6/src/agentbyte/presets/clients.py +79 -0
  30. agentbyte-0.4.6/src/agentbyte/presets/orchestration.py +216 -0
  31. agentbyte-0.4.6/src/agentbyte/presets/workflow.py +106 -0
  32. agentbyte-0.4.6/src/agentbyte/session_store.py +182 -0
  33. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/webui/__init__.py +8 -1
  34. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/webui/execution.py +12 -7
  35. agentbyte-0.4.6/src/agentbyte/webui/session_store.py +15 -0
  36. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/workflow/steps/agentbyte_agent.py +8 -3
  37. {agentbyte-0.4.3 → agentbyte-0.4.6}/tests/cli/test_create_skills.py +2 -0
  38. agentbyte-0.4.6/tests/dataset/test_loader.py +200 -0
  39. {agentbyte-0.4.3 → agentbyte-0.4.6}/tests/orchestration/test_ai_orchestrator.py +119 -25
  40. {agentbyte-0.4.3 → agentbyte-0.4.6}/tests/orchestration/test_plan_orchestrator.py +242 -14
  41. agentbyte-0.4.6/tests/orchestration/test_round_robin.py +234 -0
  42. agentbyte-0.4.6/tests/presets/test_agents.py +53 -0
  43. agentbyte-0.4.6/tests/presets/test_clients.py +130 -0
  44. agentbyte-0.4.6/tests/presets/test_orchestration.py +166 -0
  45. agentbyte-0.4.6/tests/presets/test_workflow.py +30 -0
  46. agentbyte-0.4.6/tests/test_package_api.py +145 -0
  47. agentbyte-0.4.3/.github/skills/agentbyte-multi-turn-context/SKILL.md +0 -34
  48. agentbyte-0.4.3/.github/skills/agentbyte-otel-tracing/SKILL.md +0 -42
  49. agentbyte-0.4.3/src/agentbyte/dataset/loader.py +0 -101
  50. agentbyte-0.4.3/src/agentbyte/session.py +0 -121
  51. agentbyte-0.4.3/src/agentbyte/webui/session_store.py +0 -63
  52. agentbyte-0.4.3/tests/orchestration/test_round_robin.py +0 -156
  53. agentbyte-0.4.3/tests/test_package_api.py +0 -94
  54. agentbyte-0.4.3/tests/test_session.py +0 -156
  55. {agentbyte-0.4.3 → agentbyte-0.4.6}/.github/skills/agentbyte-agent-as-tool/SKILL.md +0 -0
  56. {agentbyte-0.4.3 → agentbyte-0.4.6}/.github/skills/agentbyte-function-tools/SKILL.md +0 -0
  57. {agentbyte-0.4.3 → agentbyte-0.4.6}/.github/skills/agentbyte-list-memory/SKILL.md +0 -0
  58. {agentbyte-0.4.3 → agentbyte-0.4.6}/.github/skills/agentbyte-llm-client/SKILL.md +0 -0
  59. {agentbyte-0.4.3 → agentbyte-0.4.6}/.github/skills/agentbyte-memory-tool/SKILL.md +0 -0
  60. {agentbyte-0.4.3 → agentbyte-0.4.6}/.github/skills/agentbyte-middleware/SKILL.md +0 -0
  61. {agentbyte-0.4.3 → agentbyte-0.4.6}/.github/skills/agentbyte-simple-agent/SKILL.md +0 -0
  62. {agentbyte-0.4.3 → agentbyte-0.4.6}/.github/skills/agentbyte-tool-approval/SKILL.md +0 -0
  63. {agentbyte-0.4.3 → agentbyte-0.4.6}/.github/skills/skill-authoring/SKILL.md +0 -0
  64. {agentbyte-0.4.3 → agentbyte-0.4.6}/LICENSE +0 -0
  65. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/agents/__init__.py +0 -0
  66. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/agents/agent.py +0 -0
  67. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/agents/agent_as_tool.py +0 -0
  68. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/agents/base.py +0 -0
  69. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/agents/types.py +0 -0
  70. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/cancellation_token.py +0 -0
  71. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/cli/__init__.py +0 -0
  72. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/cli/main.py +0 -0
  73. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/component.py +0 -0
  74. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/context.py +0 -0
  75. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/dataset/base.py +0 -0
  76. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/dataset/loaders.py +0 -0
  77. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/entity.py +0 -0
  78. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/llm/__init__.py +0 -0
  79. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/llm/auth.py +0 -0
  80. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/llm/azure_openai.py +0 -0
  81. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/llm/azure_openai_embedding.py +0 -0
  82. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/llm/base.py +0 -0
  83. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/llm/embeddings_base.py +0 -0
  84. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/llm/openai.py +0 -0
  85. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/llm/openai_embedding.py +0 -0
  86. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/llm/pricing.py +0 -0
  87. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/llm/settings.py +0 -0
  88. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/llm/types.py +0 -0
  89. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/memory/__init__.py +0 -0
  90. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/memory/base.py +0 -0
  91. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/messages.py +0 -0
  92. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/middleware/__init__.py +0 -0
  93. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/middleware/base.py +0 -0
  94. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/middleware/otel.py +0 -0
  95. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/notebook.py +0 -0
  96. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/termination/__init__.py +0 -0
  97. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/termination/base.py +0 -0
  98. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/termination/cancellation.py +0 -0
  99. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/termination/composite.py +0 -0
  100. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/termination/external.py +0 -0
  101. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/termination/function_call.py +0 -0
  102. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/termination/handoff.py +0 -0
  103. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/termination/max_message.py +0 -0
  104. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/termination/text_mention.py +0 -0
  105. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/termination/timeout.py +0 -0
  106. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/termination/token_usage.py +0 -0
  107. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/tools/__init__.py +0 -0
  108. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/tools/base.py +0 -0
  109. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/tools/core_tools.py +0 -0
  110. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/tools/decorator.py +0 -0
  111. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/tools/memory_tool.py +0 -0
  112. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/types.py +0 -0
  113. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/webui/agent_framework_devui/ui/assets/index-BzhEszHZ.css +0 -0
  114. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/webui/agent_framework_devui/ui/assets/index-DByFJNGD.js +0 -0
  115. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/webui/agent_framework_devui/ui/index.html +0 -0
  116. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/webui/agent_framework_devui/ui/vite.svg +0 -0
  117. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/webui/discovery.py +0 -0
  118. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/webui/frontend/.gitignore +0 -0
  119. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/webui/frontend/README.md +0 -0
  120. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/webui/frontend/components.json +0 -0
  121. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/webui/frontend/eslint.config.js +0 -0
  122. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/webui/frontend/index.html +0 -0
  123. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/webui/frontend/package.json +0 -0
  124. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/webui/frontend/plan.md +0 -0
  125. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/webui/frontend/public/vite.svg +0 -0
  126. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/webui/frontend/src/App.css +0 -0
  127. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/webui/frontend/src/App.tsx +0 -0
  128. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/webui/frontend/src/assets/react.svg +0 -0
  129. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/webui/frontend/src/components/agent/agent-view.tsx +0 -0
  130. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/webui/frontend/src/components/message_renderer/ContentRenderer.tsx +0 -0
  131. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/webui/frontend/src/components/message_renderer/MessageRenderer.tsx +0 -0
  132. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/webui/frontend/src/components/message_renderer/index.ts +0 -0
  133. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/webui/frontend/src/components/message_renderer/types.ts +0 -0
  134. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/webui/frontend/src/components/mode-toggle.tsx +0 -0
  135. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/webui/frontend/src/components/orchestrator/orchestrator-view.tsx +0 -0
  136. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/webui/frontend/src/components/shared/app-header.tsx +0 -0
  137. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/webui/frontend/src/components/shared/chat-base.tsx +0 -0
  138. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/webui/frontend/src/components/shared/context-inspector.tsx +0 -0
  139. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/webui/frontend/src/components/shared/debug-panel.tsx +0 -0
  140. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/webui/frontend/src/components/shared/entity-selector.tsx +0 -0
  141. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/webui/frontend/src/components/shared/example-tasks-display.tsx +0 -0
  142. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/webui/frontend/src/components/shared/examples-gallery.tsx +0 -0
  143. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/webui/frontend/src/components/shared/session-switcher.tsx +0 -0
  144. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/webui/frontend/src/components/shared/tool-approval-banner.tsx +0 -0
  145. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/webui/frontend/src/components/theme-provider.tsx +0 -0
  146. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/webui/frontend/src/components/ui/attachment-gallery.tsx +0 -0
  147. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/webui/frontend/src/components/ui/badge.tsx +0 -0
  148. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/webui/frontend/src/components/ui/button.tsx +0 -0
  149. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/webui/frontend/src/components/ui/card.tsx +0 -0
  150. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/webui/frontend/src/components/ui/dialog.tsx +0 -0
  151. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/webui/frontend/src/components/ui/dropdown-menu.tsx +0 -0
  152. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/webui/frontend/src/components/ui/file-upload.tsx +0 -0
  153. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/webui/frontend/src/components/ui/input.tsx +0 -0
  154. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/webui/frontend/src/components/ui/label.tsx +0 -0
  155. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/webui/frontend/src/components/ui/loading-spinner.tsx +0 -0
  156. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/webui/frontend/src/components/ui/loading-state.tsx +0 -0
  157. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/webui/frontend/src/components/ui/message-input.tsx +0 -0
  158. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/webui/frontend/src/components/ui/scroll-area.tsx +0 -0
  159. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/webui/frontend/src/components/ui/slider.tsx +0 -0
  160. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/webui/frontend/src/components/ui/tabs.tsx +0 -0
  161. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/webui/frontend/src/components/ui/textarea.tsx +0 -0
  162. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/webui/frontend/src/components/workflow/workflow-view.tsx +0 -0
  163. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/webui/frontend/src/hooks/messageHandlers.ts +0 -0
  164. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/webui/frontend/src/hooks/useEntityExecution.ts +0 -0
  165. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/webui/frontend/src/index.css +0 -0
  166. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/webui/frontend/src/main.tsx +0 -0
  167. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/webui/frontend/src/services/api.ts +0 -0
  168. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/webui/frontend/src/types/index.ts +0 -0
  169. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/webui/frontend/src/types/picoagents.ts +0 -0
  170. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/webui/frontend/src/utils/message-utils.ts +0 -0
  171. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/webui/frontend/src/vite-env.d.ts +0 -0
  172. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/webui/frontend/tsconfig.app.json +0 -0
  173. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/webui/frontend/tsconfig.json +0 -0
  174. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/webui/frontend/tsconfig.node.json +0 -0
  175. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/webui/frontend/vite.config.ts +0 -0
  176. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/webui/frontend/yarn.lock +0 -0
  177. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/webui/models.py +0 -0
  178. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/webui/registry.py +0 -0
  179. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/webui/server.py +0 -0
  180. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/webui/sessions.py +0 -0
  181. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/webui/ui/assets/index-CWk64UM3.js +0 -0
  182. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/webui/ui/assets/index-vt1cujlT.css +0 -0
  183. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/webui/ui/index.html +0 -0
  184. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/webui/ui/vite.svg +0 -0
  185. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/workflow/__init__.py +0 -0
  186. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/workflow/core/__init__.py +0 -0
  187. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/workflow/core/checkpoint.py +0 -0
  188. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/workflow/core/models.py +0 -0
  189. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/workflow/core/runner.py +0 -0
  190. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/workflow/core/workflow.py +0 -0
  191. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/workflow/defaults.py +0 -0
  192. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/workflow/schema_utils.py +0 -0
  193. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/workflow/steps/__init__.py +0 -0
  194. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/workflow/steps/echo.py +0 -0
  195. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/workflow/steps/function.py +0 -0
  196. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/workflow/steps/http.py +0 -0
  197. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/workflow/steps/step.py +0 -0
  198. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/workflow/steps/transform.py +0 -0
  199. {agentbyte-0.4.3 → agentbyte-0.4.6}/src/agentbyte/workflow/visualizer.py +0 -0
  200. {agentbyte-0.4.3 → agentbyte-0.4.6}/tests/agents/test_agent_as_tool.py +0 -0
  201. {agentbyte-0.4.3 → agentbyte-0.4.6}/tests/agents/test_agent_basic.py +0 -0
  202. {agentbyte-0.4.3 → agentbyte-0.4.6}/tests/agents/test_agent_event_types.py +0 -0
  203. {agentbyte-0.4.3 → agentbyte-0.4.6}/tests/agents/test_agent_memory_integration.py +0 -0
  204. {agentbyte-0.4.3 → agentbyte-0.4.6}/tests/agents/test_agent_middleware_integration.py +0 -0
  205. {agentbyte-0.4.3 → agentbyte-0.4.6}/tests/agents/test_agent_stream_events.py +0 -0
  206. {agentbyte-0.4.3 → agentbyte-0.4.6}/tests/agents/test_tool_approval.py +0 -0
  207. {agentbyte-0.4.3 → agentbyte-0.4.6}/tests/llm/test_azure_client.py +0 -0
  208. {agentbyte-0.4.3 → agentbyte-0.4.6}/tests/llm/test_azure_embedding_client.py +0 -0
  209. {agentbyte-0.4.3 → agentbyte-0.4.6}/tests/llm/test_llm_types.py +0 -0
  210. {agentbyte-0.4.3 → agentbyte-0.4.6}/tests/llm/test_openai_client.py +0 -0
  211. {agentbyte-0.4.3 → agentbyte-0.4.6}/tests/llm/test_openai_embedding_client.py +0 -0
  212. {agentbyte-0.4.3 → agentbyte-0.4.6}/tests/memory/test_memory.py +0 -0
  213. {agentbyte-0.4.3 → agentbyte-0.4.6}/tests/middleware/test_middleware_chain.py +0 -0
  214. {agentbyte-0.4.3 → agentbyte-0.4.6}/tests/middleware/test_otel.py +0 -0
  215. {agentbyte-0.4.3 → agentbyte-0.4.6}/tests/orchestration/test_base_orchestrator.py +0 -0
  216. {agentbyte-0.4.3 → agentbyte-0.4.6}/tests/termination/test_base.py +0 -0
  217. {agentbyte-0.4.3 → agentbyte-0.4.6}/tests/termination/test_cancellation.py +0 -0
  218. {agentbyte-0.4.3 → agentbyte-0.4.6}/tests/termination/test_composite.py +0 -0
  219. {agentbyte-0.4.3 → agentbyte-0.4.6}/tests/termination/test_external.py +0 -0
  220. {agentbyte-0.4.3 → agentbyte-0.4.6}/tests/termination/test_function_call.py +0 -0
  221. {agentbyte-0.4.3 → agentbyte-0.4.6}/tests/termination/test_handoff.py +0 -0
  222. {agentbyte-0.4.3 → agentbyte-0.4.6}/tests/termination/test_max_message.py +0 -0
  223. {agentbyte-0.4.3 → agentbyte-0.4.6}/tests/termination/test_text_mention.py +0 -0
  224. {agentbyte-0.4.3 → agentbyte-0.4.6}/tests/termination/test_timeout.py +0 -0
  225. {agentbyte-0.4.3 → agentbyte-0.4.6}/tests/termination/test_token_usage.py +0 -0
  226. {agentbyte-0.4.3 → agentbyte-0.4.6}/tests/test_cancellation_token.py +0 -0
  227. {agentbyte-0.4.3 → agentbyte-0.4.6}/tests/test_context.py +0 -0
  228. {agentbyte-0.4.3 → agentbyte-0.4.6}/tests/test_messages.py +0 -0
  229. {agentbyte-0.4.3 → agentbyte-0.4.6}/tests/test_types.py +0 -0
  230. {agentbyte-0.4.3 → agentbyte-0.4.6}/tests/tools/test_memory_tool.py +0 -0
  231. {agentbyte-0.4.3 → agentbyte-0.4.6}/tests/tools/test_tools.py +0 -0
  232. {agentbyte-0.4.3 → agentbyte-0.4.6}/tests/webui/__init__.py +0 -0
  233. {agentbyte-0.4.3 → agentbyte-0.4.6}/tests/webui/helpers.py +0 -0
  234. {agentbyte-0.4.3 → agentbyte-0.4.6}/tests/webui/test_execution.py +0 -0
  235. {agentbyte-0.4.3 → agentbyte-0.4.6}/tests/webui/test_package_api.py +0 -0
  236. {agentbyte-0.4.3 → agentbyte-0.4.6}/tests/webui/test_registry.py +0 -0
  237. {agentbyte-0.4.3 → agentbyte-0.4.6}/tests/webui/test_server.py +0 -0
  238. {agentbyte-0.4.3 → agentbyte-0.4.6}/tests/workflow/test_checkpoint.py +0 -0
  239. {agentbyte-0.4.3 → agentbyte-0.4.6}/tests/workflow/test_workflow_class.py +0 -0
  240. {agentbyte-0.4.3 → agentbyte-0.4.6}/tests/workflow/test_workflow_models.py +0 -0
  241. {agentbyte-0.4.3 → agentbyte-0.4.6}/tests/workflow/test_workflow_runner.py +0 -0
  242. {agentbyte-0.4.3 → agentbyte-0.4.6}/tests/workflow/test_workflow_steps.py +0 -0
  243. {agentbyte-0.4.3 → agentbyte-0.4.6}/tests/workflow/test_workflow_visualizer.py +0 -0
@@ -6,11 +6,24 @@ license: MIT
6
6
 
7
7
  Use this skill when implementing multi-agent collaboration where an LLM intelligently selects which agent should respond next based on conversation context and agent capabilities.
8
8
 
9
+ ## Inputs to confirm
10
+ - Which agents are available and how clearly their descriptions express specialization
11
+ - What should stop the orchestration
12
+ - Whether the selector should see a compact summary or a richer selector context
13
+ - Whether worker agents should receive full history or a narrower execution history
14
+
9
15
  ## Pattern: Basic AI-Driven Orchestration
10
16
 
11
17
  ```python
12
18
  import asyncio
13
- from agentbyte import AIOrchestrator, Agent, UserMessage
19
+ from agentbyte import (
20
+ AIOrchestrator,
21
+ Agent,
22
+ AgentHistoryPolicy,
23
+ HistoryContextPolicy,
24
+ SelectorContextPolicy,
25
+ UserMessage,
26
+ )
14
27
  from agentbyte.llm import OpenAIChatCompletionClient
15
28
  from agentbyte.termination import MaxMessageTermination, TextMentionTermination
16
29
 
@@ -47,7 +60,15 @@ async def main():
47
60
  agents=[researcher, writer],
48
61
  termination=termination,
49
62
  model_client=client, # Required: LLM for agent selection
50
- max_iterations=6
63
+ max_iterations=6,
64
+ history_policy=HistoryContextPolicy(
65
+ default=AgentHistoryPolicy(window="full", format="text")
66
+ ),
67
+ selector_policy=SelectorContextPolicy(
68
+ window="recent",
69
+ message_limit=12,
70
+ format="summary",
71
+ ),
51
72
  )
52
73
 
53
74
  # 5. Run the collaboration
@@ -87,25 +108,47 @@ async for item in orchestrator.run_stream(task, verbose=True):
87
108
  3. **Reasoning Included:** Selection events include the LLM's reasoning for why it chose that agent
88
109
  4. **Fallback Safety:** If LLM selection fails or returns invalid agent name, falls back to round-robin
89
110
 
90
- ## Configuration Options
111
+ ## Policy Surface
91
112
 
92
113
  ```python
93
114
  orchestrator = AIOrchestrator(
94
- agents=[agent1, agent2, agent3], # Required: List of agents
95
- termination=termination_condition, # Required: When to stop
96
- model_client=selection_model_client, # Required: LLM for agent selection
97
- max_iterations=10, # Optional: Safety limit (default: 10)
98
- verbose=False # Optional: Enable event logging
115
+ agents=[agent1, agent2, agent3],
116
+ termination=termination_condition,
117
+ model_client=selection_model_client,
118
+ max_iterations=10,
119
+ history_policy=HistoryContextPolicy(
120
+ default=AgentHistoryPolicy(window="full", format="text")
121
+ ),
122
+ selector_policy=SelectorContextPolicy(
123
+ window="recent",
124
+ message_limit=12,
125
+ format="summary",
126
+ ),
99
127
  )
100
128
  ```
101
129
 
130
+ Use the two policies for different jobs:
131
+ - `HistoryContextPolicy`: contains a default `AgentHistoryPolicy` plus optional per-agent `AgentHistoryPolicy` overrides for worker execution
132
+ - `SelectorContextPolicy`: controls what the selector model sees when deciding which agent should go next
133
+
134
+ `AgentHistoryPolicy` is the per-agent rule that actually defines:
135
+ - `window`
136
+ - `message_limit`
137
+ - `format`
138
+ - `include_turn_prompt`
139
+
140
+ Selector formatting affects routing quality:
141
+ - `summary` is compact and best for many coordination tasks
142
+ - `markdown` can help readability on long transcripts
143
+ - `json` can help when explicit role/source/content structure matters
144
+
102
145
  ## Pattern Metadata
103
146
 
104
147
  After completion, `result.pattern_metadata` contains:
105
148
  - `iterations_completed`: Total agent executions
106
149
  - `selector_calls`: Number of LLM selection calls made
107
- - `fallback_count`: How many times round-robin fallback was used
108
- - `final_reason`: Why orchestration stopped
150
+ - `selector_model`: Model used for routing
151
+ - `selector_policy`: Serialized selector-context configuration
109
152
 
110
153
  ## Usage Tracking
111
154
 
@@ -136,8 +179,9 @@ description="Agent 1" # No capability info
136
179
 
137
180
  - **Model Client Required:** `AIOrchestrator` needs a `model_client` parameter for agent selection (unlike `RoundRobinOrchestrator`).
138
181
  - **Clear Descriptions:** Write specific agent descriptions—the LLM uses these to decide who should respond.
182
+ - **Two Context Surfaces:** Do not confuse `history_policy` with `selector_policy`; one shapes execution, the other shapes routing.
139
183
  - **Termination Required:** Always provide termination conditions to prevent infinite loops.
140
- - **Safety Fallback:** If LLM selection fails, orchestrator falls back to round-robin (check `fallback_count` in metadata).
184
+ - **Safety Fallback:** If LLM selection fails, the orchestrator falls back to round-robin selection to preserve forward progress.
141
185
  - **Usage Accounting:** Final usage includes both agent tokens AND selector tokens.
142
186
  - **Case Insensitive:** Agent name matching is case-insensitive for robustness.
143
187
  - **Event Observability:** Use `verbose=True` with `run_stream()` to see AI selection reasoning.
@@ -160,12 +204,6 @@ description="Agent 1" # No capability info
160
204
  4. **Dynamic Collaboration:** Agents with overlapping capabilities—LLM picks best fit
161
205
  5. **Question Routing:** Route user questions to the most appropriate agent based on content
162
206
 
163
- ## Examples
164
-
165
- - Basic: `examples/orchestration/ai_driven_basic.py`
166
- - Streaming: `examples/orchestration/ai_driven_stream.py`
167
- - With OTel: `examples/orchestration/ai_driven_with_otel.py`
168
-
169
207
  ## OpenTelemetry Integration
170
208
 
171
209
  For observability with Jaeger:
@@ -6,13 +6,16 @@ description: Guide for creating and using Agentbyte datasets with SQLite or JSON
6
6
  Use this skill when you need to:
7
7
  - **Load** an existing dataset using `load_dataset()`
8
8
  - **Create** a new dataset with config.json, schema.json, and data.json
9
+ - **Load** the same dataset structure from local disk or S3
9
10
  - **Query** SQLite datasets with SQL or iterate JSON datasets
10
11
  - **Display** dataset schemas in pretty or raw format
11
12
  - **Work with** multiple data engines (SQLite for structured, JSON for semi-structured)
12
13
 
13
14
  ## Dataset Architecture
14
15
 
15
- Agentbyte datasets are file-based and engine-agnostic. Each dataset lives in `data/samples/{category}/{name}/` with three files:
16
+ Agentbyte datasets are file-based and engine-agnostic. The dataset contract stays the same whether the files live on local disk or in S3.
17
+
18
+ Local layout:
16
19
 
17
20
  ### File Structure
18
21
  ```
@@ -22,6 +25,14 @@ data/samples/{category}/{name}/
22
25
  └── data.json # Records only ({"records": [...]})
23
26
  ```
24
27
 
28
+ Equivalent S3 layout:
29
+ ```
30
+ s3://<bucket>/<optional-prefix>/{category}/{name}/
31
+ ├── config.json
32
+ ├── schema.json
33
+ └── data.json
34
+ ```
35
+
25
36
  ### Supported Engines
26
37
  - **sqlite** (default): Structured data with SQL queries, strict schema, constraints
27
38
  - **json**: Semi-structured data, flexible JSON format, inferred schema
@@ -92,11 +103,17 @@ with open(dataset_dir / "data.json", "w") as f:
92
103
 
93
104
  ### Load a Dataset
94
105
  ```python
95
- from agentbyte.dataset import load_dataset
106
+ from agentbyte.dataset import DatasetSettings, load_dataset
96
107
 
97
108
  ds = load_dataset("category/name") # Returns SQLiteDataset or JSONDataset
98
109
  print(ds.engine) # "sqlite" or "json"
99
110
  print(ds.table_name) # Table/collection name
111
+
112
+ settings = DatasetSettings(
113
+ s3_bucket="datapsycho-datasets",
114
+ s3_prefix="datasets",
115
+ )
116
+ ds_s3 = load_dataset("category/name", source="s3", settings=settings)
100
117
  ```
101
118
 
102
119
  ### Connect & Get Data
@@ -163,13 +180,30 @@ for i, record in enumerate(data["records"], 1):
163
180
  ### Example 3: Create Dataset Programmatically
164
181
  See "Creating a Dataset" section above for step-by-step code.
165
182
 
183
+ ### Example 4: Load From S3
184
+ ```python
185
+ from agentbyte.dataset import DatasetSettings, load_dataset
186
+
187
+ settings = DatasetSettings(
188
+ s3_bucket="datapsycho-datasets",
189
+ s3_region="eu-west-1",
190
+ s3_prefix="datasets",
191
+ )
192
+
193
+ ds = load_dataset("contracts10/asmd", source="s3", settings=settings)
194
+ conn = ds.connect()
195
+ rows = conn.execute("SELECT * FROM contracts_asmd").fetchall()
196
+ ```
197
+
166
198
  ## Guardrails
167
199
 
168
200
  - **Do** use relative paths from project root in `load_dataset()` (e.g., `"contracts/asmd"`, not full file paths).
201
+ - **Do** keep `dataset_id` logical (`"category/name"`) and configure S3 location through `DatasetSettings`.
169
202
  - **Do** keep schema.json separate from data.json for clarity and reusability.
170
203
  - **Do** use `dict(row)` to convert sqlite3.Row objects to dicts for JSON serialization.
171
204
  - **Do** call `ds.connect()` only once; it caches the connection and schema on first call.
172
205
  - **Don't** hard-code values in datasets (use config.json for metadata).
206
+ - **Don't** store bucket names or S3 prefixes inside `config.json`.
173
207
  - **Don't** forget `.json` extensions for all three files.
174
208
  - **Don't** put schema definitions inside data.json (separate files for clarity).
175
209
  - **Don't** assume JSON datasets support SQL—use dict iteration instead.
@@ -178,15 +212,22 @@ See "Creating a Dataset" section above for step-by-step code.
178
212
 
179
213
  ### Factory Function
180
214
  ```python
181
- load_dataset(dataset_id: str) -> BaseDataset
215
+ load_dataset(
216
+ dataset_id: str,
217
+ source: Literal["local", "s3"] = "local",
218
+ settings: DatasetSettings | None = None,
219
+ ) -> BaseDataset
182
220
  ```
183
- Loads dataset from `data/samples/{category}/{name}/`. Returns `SQLiteDataset` or `JSONDataset` based on config.engine.
221
+ Loads dataset from `data/samples/{category}/{name}/` or from
222
+ `s3://bucket/prefix/{category}/{name}/`. Returns `SQLiteDataset` or `JSONDataset`
223
+ based on `config.engine`.
184
224
 
185
225
  ### Classes (Generic)
186
226
  - **Column**: name (str), type (str)
187
227
  - **Schema**: columns (list[Column])
188
228
  - **DataRecord**: id (str), data (Any), metadata (dict)
189
229
  - **DatasetConfig**: engine (str), table_name (str), in_memory (bool), description (str)
230
+ - **DatasetSettings**: s3_bucket (str), s3_region (str), s3_prefix (str)
190
231
  - **SchemaFormat**: RAW or PRETTY enum for display formats
191
232
 
192
233
  ### Classes (SQLite-Specific)
@@ -203,6 +244,8 @@ Loads dataset from `data/samples/{category}/{name}/`. Returns `SQLiteDataset` or
203
244
  |-------|-----|
204
245
  | `FileNotFoundError: Schema file not found` | Ensure `schema.json` exists in dataset directory |
205
246
  | `FileNotFoundError: Data file not found` | Ensure `data.json` exists in dataset directory |
247
+ | `FileNotFoundError: Dataset object not found: s3://...` | Ensure the bucket, prefix, dataset_id, and object names are correct |
248
+ | `ValueError: Missing required dataset S3 settings` | Set `AGENTBYTE_DATASET_S3_BUCKET` or pass `DatasetSettings(...)` explicitly |
206
249
  | `KeyError: 'records'` | data.json must have `{"records": [...]}` structure |
207
250
  | `sqlite3.Row has no .dict() method` | Use `dict(row)` instead of `row.dict()` |
208
251
  | Notebook paths fail in `load_dataset()` | Use relative paths from project root; notebook working directory is handled by loader |
@@ -0,0 +1,135 @@
1
+ ---
2
+ name: agentbyte-multi-turn-context
3
+ description: Guide for managing Agentbyte multi-turn conversations using AgentContext and session stores. Use this when implementing stateful chats, persistent sessions, session switching, or threading history across agents, orchestrators, and workflow steps.
4
+ ---
5
+
6
+ Use this skill when building conversational agents that need to remember previous turns, or when sessions must persist across process restarts.
7
+
8
+ ## Core Concept
9
+
10
+ `AgentContext` IS the session — it carries `messages`, `session_id`, `metadata`, and
11
+ `shared_state`. There is no separate `Session` domain model. The caller owns the context
12
+ and passes it in; the agent or orchestrator reads and writes it in place.
13
+
14
+ ## Pattern: Basic Multi-Turn Agent
15
+
16
+ ```python
17
+ from agentbyte.context import AgentContext
18
+ from agentbyte.agents import Agent
19
+
20
+ session_context = AgentContext(session_id="user-123")
21
+ agent = Agent(name="chat-bot", ...)
22
+
23
+ # First turn
24
+ response1 = await agent.run("Hi, I am Alex", context=session_context)
25
+
26
+ # Second turn — re-use the same context; history is already updated
27
+ response2 = await agent.run("What is my name?", context=session_context)
28
+ print(response2.final_content) # "Your name is Alex"
29
+ ```
30
+
31
+ ## Pattern: Persistent Sessions with Session Stores
32
+
33
+ Session stores persist `AgentContext` across process restarts. Three built-in options:
34
+
35
+ | Store | Backend | Use when |
36
+ |-------|---------|----------|
37
+ | `InMemorySessionStore` | Python dict (volatile) | Tests, single-process demos |
38
+ | `FileSessionStore` | One JSON file per session | Simple persistence, low concurrency |
39
+ | `CachedFileSessionStore` | In-memory cache + file | Production: fast reads, durable writes |
40
+
41
+ ```python
42
+ from agentbyte.context import AgentContext
43
+ from agentbyte.session_store import CachedFileSessionStore
44
+
45
+ store = CachedFileSessionStore(".sessions")
46
+ session_id = "user-123"
47
+
48
+ # Load or create
49
+ ctx = await store.get(session_id) or AgentContext(session_id=session_id)
50
+
51
+ response = await agent.run("Remember: my budget is $500", context=ctx)
52
+
53
+ # Persist after each turn
54
+ await store.save(session_id, ctx)
55
+ ```
56
+
57
+ All three stores share the same `SessionStore` interface:
58
+ ```python
59
+ await store.get(session_id) # AgentContext | None
60
+ await store.save(session_id, ctx) # None
61
+ await store.list() # Iterable[tuple[str, AgentContext]]
62
+ await store.delete(session_id) # bool
63
+ await store.clear_all() # int (count deleted)
64
+ ```
65
+
66
+ Import from any of these paths:
67
+ ```python
68
+ from agentbyte import CachedFileSessionStore # package root
69
+ from agentbyte.session_store import FileSessionStore # module
70
+ from agentbyte.webui import InMemorySessionStore # webui re-export
71
+ ```
72
+
73
+ ## Pattern: Orchestrator Sessions
74
+
75
+ `BaseOrchestrator.run()` and `run_stream()` accept an optional `context` parameter.
76
+ The orchestrator seeds its `shared_messages` from `context.messages` at the start of
77
+ each run, then writes the full conversation back before returning.
78
+
79
+ ```python
80
+ from agentbyte.context import AgentContext
81
+ from agentbyte.session_store import CachedFileSessionStore
82
+ from agentbyte.presets.orchestration import get_orchestrator
83
+
84
+ store = CachedFileSessionStore(".sessions")
85
+ session_id = "orch-session-1"
86
+ orchestrator = get_orchestrator("round_robin", agents=[agent_a, agent_b])
87
+
88
+ # Turn 1
89
+ ctx = await store.get(session_id) or AgentContext(session_id=session_id)
90
+ response = await orchestrator.run(task="Draft an intro paragraph.", context=ctx)
91
+ await store.save(session_id, ctx)
92
+
93
+ # Turn 2 — prior conversation is loaded from the store
94
+ ctx = await store.get(session_id)
95
+ response = await orchestrator.run(task="Now make it more concise.", context=ctx)
96
+ await store.save(session_id, ctx)
97
+ ```
98
+
99
+ ## Pattern: Workflow Step Sessions (AgentbyteAgentStep)
100
+
101
+ Workflows are pipelines — they do not thread conversation history automatically.
102
+ Pass `AgentContext` via `agent_context` on `AgentbyteAgentInput` when a step agent
103
+ needs session continuity.
104
+
105
+ ```python
106
+ from agentbyte.context import AgentContext
107
+ from agentbyte.session_store import CachedFileSessionStore
108
+ from agentbyte.workflow.steps import AgentbyteAgentInput
109
+
110
+ store = CachedFileSessionStore(".sessions")
111
+ ctx = await store.get("step-session") or AgentContext(session_id="step-session")
112
+
113
+ execution = await runner.run(
114
+ workflow,
115
+ AgentbyteAgentInput(task="Summarise the report", agent_context=ctx),
116
+ )
117
+ await store.save("step-session", ctx)
118
+ ```
119
+
120
+ `agent_context` is always optional — omit it for a stateless step.
121
+
122
+ ## Key Attributes
123
+
124
+ - **`context.messages`**: Conversation history (list of `Message`).
125
+ - **`context.session_id`**: Identifier set at creation; used as store key.
126
+ - **`context.metadata`**: Dict of custom data carried across turns.
127
+ - **`context.shared_state`**: Cross-agent shared state (orchestrators).
128
+
129
+ ## Guardrails
130
+
131
+ - Never store conversation history on the `Agent` object — always on `AgentContext`.
132
+ - The caller is responsible for persisting the context (call `store.save()` after each turn).
133
+ - Do not pass the same `AgentContext` to two concurrent agent runs — it is not thread-safe.
134
+ - For workflow pipelines, use `AgentbyteAgentInput.agent_context`; do not embed `AgentContext` in the workflow `Context` dict.
135
+ - Add `.sessions/` to `.gitignore` to avoid committing session JSON files.
@@ -0,0 +1,109 @@
1
+ ---
2
+ name: agentbyte-otel-tracing
3
+ description: Guide for enabling OpenTelemetry tracing in Agentbyte for agents, orchestrators, and workflows. Use this when adding Jaeger/OTLP observability, tracing model or tool calls, or validating runtime span hierarchies.
4
+ license: MIT
5
+ ---
6
+
7
+ Use this skill when adding OpenTelemetry-based observability to Agentbyte code.
8
+
9
+ ## Inputs to confirm
10
+ - Whether tracing should cover agents only, or also orchestrators and workflows
11
+ - Which OTLP endpoint and service name should be used
12
+ - Whether prompt/response content may be captured safely
13
+ - Whether metrics are needed or traces alone are sufficient
14
+
15
+ ## Pattern 1: Environment-First Auto-Instrumentation
16
+
17
+ Set environment variables before the first `agentbyte` import.
18
+
19
+ ```python
20
+ import os
21
+
22
+ os.environ["AGENTBYTE_ENABLE_OTEL"] = "true"
23
+ os.environ["OTEL_EXPORTER_OTLP_ENDPOINT"] = "http://localhost:4318"
24
+ os.environ["OTEL_SERVICE_NAME"] = "my-agentbyte-service"
25
+
26
+ # Optional debugging / privacy-sensitive flags
27
+ os.environ["AGENTBYTE_OTEL_CAPTURE_CONTENT"] = "false"
28
+ os.environ["OTEL_METRICS_ENABLED"] = "false"
29
+
30
+ from agentbyte import Agent
31
+ ```
32
+
33
+ This is the preferred path because importing package root already triggers Agentbyte's OTel auto-instrumentation when `AGENTBYTE_ENABLE_OTEL=true`.
34
+
35
+ What auto-instrumentation gives you:
36
+ - agent root spans
37
+ - child `chat <model>` spans
38
+ - child `tool <name>` spans
39
+ - orchestration root spans
40
+ - workflow root and workflow-step spans
41
+
42
+ ## Pattern 2: Manual Agent Middleware
43
+
44
+ Use this only when you do not want global auto-instrumentation and need opt-in tracing on specific agents.
45
+
46
+ ```python
47
+ from agentbyte import Agent
48
+ from agentbyte.middleware import OTelMiddleware
49
+
50
+ agent = Agent(
51
+ name="traced_agent",
52
+ ...,
53
+ middlewares=[OTelMiddleware()],
54
+ )
55
+ ```
56
+
57
+ ## What Gets Traced
58
+
59
+ ### Agents
60
+ - root span: `agent <name>`
61
+ - child spans for model calls
62
+ - child spans for tool calls
63
+
64
+ ### Orchestrators
65
+ - root span: `orchestration <PatternName>`
66
+ - span attributes such as:
67
+ - `agentbyte.orchestration.pattern`
68
+ - `agentbyte.orchestration.agent_count`
69
+ - `agentbyte.orchestration.iterations`
70
+ - `agentbyte.orchestration.message_count`
71
+ - `agentbyte.orchestration.stop_reason`
72
+
73
+ ### Workflows
74
+ - root span: `workflow <workflow_name>`
75
+ - child spans: `workflow step <step_id>`
76
+ - embedded `AgentbyteAgentStep` executions can contain nested agent/chat/tool spans beneath the workflow step span
77
+
78
+ ## Jaeger / OTLP Setup
79
+
80
+ For local Jaeger all-in-one, use an OTLP HTTP endpoint such as:
81
+
82
+ ```python
83
+ os.environ["OTEL_EXPORTER_OTLP_ENDPOINT"] = "http://localhost:4318"
84
+ ```
85
+
86
+ Agentbyte appends `/v1/traces` internally for the trace exporter, so pass the base OTLP endpoint, not the full traces path.
87
+
88
+ ## Useful Environment Variables
89
+
90
+ | Variable | Purpose |
91
+ |---|---|
92
+ | `AGENTBYTE_ENABLE_OTEL` | Enable Agentbyte tracing |
93
+ | `OTEL_EXPORTER_OTLP_ENDPOINT` | Base OTLP HTTP endpoint |
94
+ | `OTEL_SERVICE_NAME` | Service name shown in traces |
95
+ | `OTEL_METRICS_ENABLED` | Enable metrics export when supported |
96
+ | `AGENTBYTE_OTEL_CAPTURE_CONTENT` | Opt in to prompt/response content capture |
97
+
98
+ ## Validation Approach
99
+ - Run a simple traced agent first to verify exporter setup.
100
+ - Then verify orchestrator/workflow traces if those surfaces are in scope.
101
+ - Check the trace hierarchy, not just whether any span appears.
102
+ - For local Jaeger setups, confirm the service name is visible in the UI before debugging deeper instrumentation issues.
103
+
104
+ ## Guardrails
105
+ - Set OTel environment variables before the first `agentbyte` import.
106
+ - Prefer auto-instrumentation unless you specifically need per-agent manual control.
107
+ - Treat `AGENTBYTE_OTEL_CAPTURE_CONTENT` as opt-in only; it may expose sensitive prompts, completions, or tool arguments.
108
+ - Do not assume Jaeger supports metrics by default; traces are the primary integration path.
109
+ - If local proxy settings interfere with `localhost`, clear or bypass them for the OTLP endpoint.
@@ -6,11 +6,24 @@ license: MIT
6
6
 
7
7
  Use this skill when implementing multi-agent collaboration with an explicit plan up front, step-by-step execution, evaluator-driven retries, and focused context per step.
8
8
 
9
+ ## Inputs to confirm
10
+ - Which specialist agents should be available to the planner
11
+ - Whether review steps need explicit approval gating
12
+ - Whether the default recent `messages` history is sufficient for step execution
13
+ - How many retries and review-revision loops are acceptable
14
+
9
15
  ## Pattern: Basic Plan-Based Orchestration
10
16
 
11
17
  ```python
12
18
  import asyncio
13
- from agentbyte import Agent, PlanBasedOrchestrator, UserMessage
19
+ from agentbyte import (
20
+ Agent,
21
+ AgentHistoryPolicy,
22
+ HistoryContextPolicy,
23
+ PlanBasedOrchestrator,
24
+ ReviewGatePolicy,
25
+ UserMessage,
26
+ )
14
27
  from agentbyte.llm import OpenAIChatCompletionClient
15
28
  from agentbyte.termination import MaxMessageTermination
16
29
 
@@ -58,7 +71,21 @@ async def main():
58
71
  model_client=client, # Required: used for planning and evaluation
59
72
  max_iterations=10, # Safety limit for total agent turns
60
73
  max_step_retries=2, # Retry failed steps with evaluator feedback
61
- recent_messages_limit=5, # Focus context on the latest shared history
74
+ history_policy=HistoryContextPolicy(
75
+ default=AgentHistoryPolicy(
76
+ window="recent",
77
+ message_limit=5,
78
+ format="messages",
79
+ )
80
+ ),
81
+ review_gate_policy=ReviewGatePolicy(
82
+ enabled=True,
83
+ reviewer_agent_name="reviewer",
84
+ revision_agent_name="writer",
85
+ approval_signal="APPROVED",
86
+ max_revision_rounds=2,
87
+ prefer_final_result_from_agent="writer",
88
+ ),
62
89
  )
63
90
 
64
91
  # 4. Run the task
@@ -134,19 +161,36 @@ class StepProgressEvaluation(BaseModel):
134
161
  suggested_improvements: list[str]
135
162
  ```
136
163
 
137
- ## Configuration Options
164
+ ## Policy Surface
138
165
 
139
166
  ```python
140
167
  orchestrator = PlanBasedOrchestrator(
141
- agents=[agent1, agent2, agent3], # Required: specialist agents
142
- termination=termination_condition, # Required: stop condition
143
- model_client=planner_client, # Required: plan + evaluation model client
144
- max_iterations=50, # Optional: total agent-turn safety limit
145
- max_step_retries=3, # Optional: retries per failed step
146
- recent_messages_limit=5, # Optional: focused context window
168
+ agents=[agent1, agent2, agent3],
169
+ termination=termination_condition,
170
+ model_client=planner_client,
171
+ max_iterations=50,
172
+ max_step_retries=3,
173
+ history_policy=HistoryContextPolicy(
174
+ default=AgentHistoryPolicy(
175
+ window="recent",
176
+ message_limit=5,
177
+ format="messages",
178
+ )
179
+ ),
180
+ review_gate_policy=ReviewGatePolicy(enabled=False),
147
181
  )
148
182
  ```
149
183
 
184
+ Use the two policies for different concerns:
185
+ - `HistoryContextPolicy`: contains a default `AgentHistoryPolicy` plus optional per-agent `AgentHistoryPolicy` overrides for step execution
186
+ - `ReviewGatePolicy`: controls explicit approval gating, revision loops, approval signals, and preferred final-result agent
187
+
188
+ `AgentHistoryPolicy` is the per-agent rule that actually defines:
189
+ - `window`
190
+ - `message_limit`
191
+ - `format`
192
+ - `include_turn_prompt`
193
+
150
194
  ## Pattern Metadata
151
195
 
152
196
  After completion, `result.pattern_metadata` contains plan-aware state such as:
@@ -160,6 +204,8 @@ After completion, `result.pattern_metadata` contains plan-aware state such as:
160
204
  - `planner_model`: Model name used for plan/evaluation calls
161
205
  - `planner_calls`: Number of planning calls made
162
206
  - `evaluation_calls`: Number of step evaluations made
207
+ - `history_policy`: Serialized step-execution history policy
208
+ - `review_gate_policy`: Serialized review-gate configuration
163
209
 
164
210
  ## Usage Tracking
165
211
 
@@ -184,10 +230,11 @@ This makes plan-based orchestration more expensive than simpler patterns, but mu
184
230
 
185
231
  - **Model Client Required:** `PlanBasedOrchestrator` requires `model_client` for both plan generation and step evaluation.
186
232
  - **Agent Names Must Match:** `PlanStep.agent_name` must match an actual agent name. Matching is case-insensitive, but the name still has to exist.
233
+ - **Review Gate Validation:** If `ReviewGatePolicy.enabled=True`, the configured reviewer and revision agent names must exist in the orchestrator pool.
187
234
  - **Descriptions Matter:** Agent descriptions should clearly state specialization because the planner uses them to assign steps.
188
235
  - **Termination Still Required:** Even though the pattern can stop when the plan completes, still provide a real termination condition as a safety boundary.
189
236
  - **Retries Are Bounded:** Use `max_step_retries` to keep failed steps from looping forever.
190
- - **Focused Context:** Plan-based orchestration intentionally sends only recent shared context plus the current step task. Do not assume every step sees the full history.
237
+ - **Focused Context:** By default plan-based orchestration sends only recent shared context plus the current step task. This is configurable via `HistoryContextPolicy`.
191
238
  - **Fallback Behavior Exists:** If structured planning or evaluation fails, the orchestrator falls back to safe default behavior instead of crashing.
192
239
 
193
240
  ## Common Use Cases