agentbyte 0.2.4__tar.gz → 0.3.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 (108) hide show
  1. {agentbyte-0.2.4 → agentbyte-0.3.0}/.github/copilot-instructions.md +67 -0
  2. agentbyte-0.3.0/CHANGELOG.md +131 -0
  3. {agentbyte-0.2.4 → agentbyte-0.3.0}/PKG-INFO +40 -9
  4. {agentbyte-0.2.4 → agentbyte-0.3.0}/README.md +39 -8
  5. {agentbyte-0.2.4 → agentbyte-0.3.0}/docker/jaeger-compose.yml +0 -2
  6. agentbyte-0.3.0/docs/progress.md +81 -0
  7. agentbyte-0.3.0/docs/study/topic_agents.md +454 -0
  8. {agentbyte-0.2.4 → agentbyte-0.3.0}/docs/study/topic_approval.md +54 -15
  9. agentbyte-0.3.0/docs/study/topic_otel_spans.md +752 -0
  10. {agentbyte-0.2.4 → agentbyte-0.3.0}/examples/otel/agent_with_content_capture.py +47 -7
  11. agentbyte-0.3.0/examples/otel/agent_with_stream_telemetry.py +157 -0
  12. {agentbyte-0.2.4 → agentbyte-0.3.0}/examples/otel/agent_with_telemetry.py +47 -7
  13. agentbyte-0.3.0/examples/otel/inspect_trace.py +254 -0
  14. agentbyte-0.3.0/examples/otel/inspect_traces.py +179 -0
  15. {agentbyte-0.2.4 → agentbyte-0.3.0}/notebooks/concepts/agent/04-agent-with-context.ipynb +85 -51
  16. {agentbyte-0.2.4 → agentbyte-0.3.0}/notebooks/concepts/agent/05b-agent-with-otel-middleware.ipynb +78 -28
  17. {agentbyte-0.2.4 → agentbyte-0.3.0}/notebooks/concepts/agent/07-agent-as-tool-coordinator.ipynb +86 -68
  18. {agentbyte-0.2.4 → agentbyte-0.3.0}/notebooks/usecases/04.2-metadata-extraction-large-doc.ipynb +20 -30
  19. agentbyte-0.3.0/src/agentbyte/__about__.py +2 -0
  20. {agentbyte-0.2.4 → agentbyte-0.3.0}/src/agentbyte/__init__.py +6 -10
  21. {agentbyte-0.2.4 → agentbyte-0.3.0}/src/agentbyte/agents/agent.py +83 -44
  22. {agentbyte-0.2.4 → agentbyte-0.3.0}/src/agentbyte/agents/agent_as_tool.py +16 -3
  23. {agentbyte-0.2.4 → agentbyte-0.3.0}/src/agentbyte/agents/base.py +29 -24
  24. {agentbyte-0.2.4 → agentbyte-0.3.0}/src/agentbyte/middleware/__init__.py +16 -5
  25. {agentbyte-0.2.4 → agentbyte-0.3.0}/src/agentbyte/middleware/otel.py +44 -6
  26. {agentbyte-0.2.4 → agentbyte-0.3.0}/tests/agents/test_agent_as_tool.py +7 -4
  27. {agentbyte-0.2.4 → agentbyte-0.3.0}/tests/agents/test_agent_basic.py +0 -37
  28. {agentbyte-0.2.4 → agentbyte-0.3.0}/tests/agents/test_tool_approval.py +4 -4
  29. {agentbyte-0.2.4 → agentbyte-0.3.0}/tests/middleware/test_otel.py +139 -6
  30. agentbyte-0.2.4/CHANGELOG.md +0 -57
  31. agentbyte-0.2.4/docs/progress.md +0 -307
  32. agentbyte-0.2.4/docs/study/topic_agents.md +0 -319
  33. agentbyte-0.2.4/src/agentbyte/__about__.py +0 -2
  34. {agentbyte-0.2.4 → agentbyte-0.3.0}/.gitignore +0 -0
  35. {agentbyte-0.2.4 → agentbyte-0.3.0}/.gitlab-ci.yml +0 -0
  36. {agentbyte-0.2.4 → agentbyte-0.3.0}/.gitmodules +0 -0
  37. {agentbyte-0.2.4 → agentbyte-0.3.0}/.python-version +0 -0
  38. {agentbyte-0.2.4 → agentbyte-0.3.0}/LICENSE +0 -0
  39. {agentbyte-0.2.4 → agentbyte-0.3.0}/docs/book-designing-multi-agent-system.md +0 -0
  40. {agentbyte-0.2.4 → agentbyte-0.3.0}/docs/implementation_plan.md +0 -0
  41. {agentbyte-0.2.4 → agentbyte-0.3.0}/docs/study/topic_memory.md +0 -0
  42. {agentbyte-0.2.4 → agentbyte-0.3.0}/docs/study/topic_middleware.md +0 -0
  43. {agentbyte-0.2.4 → agentbyte-0.3.0}/docs/study/topic_model_client.md +0 -0
  44. {agentbyte-0.2.4 → agentbyte-0.3.0}/docs/study/topic_otel.md +0 -0
  45. {agentbyte-0.2.4 → agentbyte-0.3.0}/docs/study/topic_tools.md +0 -0
  46. {agentbyte-0.2.4 → agentbyte-0.3.0}/docs/study_plan.md +0 -0
  47. {agentbyte-0.2.4 → agentbyte-0.3.0}/examples/azure_openai_usage_example.py +0 -0
  48. {agentbyte-0.2.4 → agentbyte-0.3.0}/examples/function_tool_example.py +0 -0
  49. {agentbyte-0.2.4 → agentbyte-0.3.0}/examples/llm_client_dependency_injection.py +0 -0
  50. {agentbyte-0.2.4 → agentbyte-0.3.0}/examples/memory/memory_usage_example.py +0 -0
  51. {agentbyte-0.2.4 → agentbyte-0.3.0}/examples/message_types_example.py +0 -0
  52. {agentbyte-0.2.4 → agentbyte-0.3.0}/examples/openai_client_example.py +0 -0
  53. {agentbyte-0.2.4 → agentbyte-0.3.0}/logo/agent-byte-avatar-low.png +0 -0
  54. {agentbyte-0.2.4 → agentbyte-0.3.0}/notebooks/agent-knowledge-building.ipynb +0 -0
  55. {agentbyte-0.2.4 → agentbyte-0.3.0}/notebooks/auth/00-Authentication-and-Identity-of-AI-clients.ipynb +0 -0
  56. {agentbyte-0.2.4 → agentbyte-0.3.0}/notebooks/concepts/agent/01-tools-example.ipynb +0 -0
  57. {agentbyte-0.2.4 → agentbyte-0.3.0}/notebooks/concepts/agent/02a-azure-openai-wrapper.ipynb +0 -0
  58. {agentbyte-0.2.4 → agentbyte-0.3.0}/notebooks/concepts/agent/02b-openai-wrapper.ipynb +0 -0
  59. {agentbyte-0.2.4 → agentbyte-0.3.0}/notebooks/concepts/agent/03a-simple-agent-no-tool.ipynb +0 -0
  60. {agentbyte-0.2.4 → agentbyte-0.3.0}/notebooks/concepts/agent/03b-agent-with-tool.ipynb +0 -0
  61. {agentbyte-0.2.4 → agentbyte-0.3.0}/notebooks/concepts/agent/03c-multi-tool-agent.ipynb +0 -0
  62. {agentbyte-0.2.4 → agentbyte-0.3.0}/notebooks/concepts/agent/05a-agent-with-middleware.ipynb +0 -0
  63. {agentbyte-0.2.4 → agentbyte-0.3.0}/notebooks/concepts/agent/06-agent-with-memory.ipynb +0 -0
  64. {agentbyte-0.2.4 → agentbyte-0.3.0}/notebooks/concepts/agent/sample-data/contracts_asmd_seed_rows.json +0 -0
  65. {agentbyte-0.2.4 → agentbyte-0.3.0}/notebooks/concepts/agent/sample-data/contracts_esmd_seed_rows.json +0 -0
  66. {agentbyte-0.2.4 → agentbyte-0.3.0}/notebooks/usecases/04.1-multi-turn-agent.ipynb +0 -0
  67. {agentbyte-0.2.4 → agentbyte-0.3.0}/pyproject.toml +0 -0
  68. {agentbyte-0.2.4 → agentbyte-0.3.0}/src/agentbyte/agents/__init__.py +0 -0
  69. {agentbyte-0.2.4 → agentbyte-0.3.0}/src/agentbyte/agents/types.py +0 -0
  70. {agentbyte-0.2.4 → agentbyte-0.3.0}/src/agentbyte/cancellation_token.py +0 -0
  71. {agentbyte-0.2.4 → agentbyte-0.3.0}/src/agentbyte/context.py +0 -0
  72. {agentbyte-0.2.4 → agentbyte-0.3.0}/src/agentbyte/entity.py +0 -0
  73. {agentbyte-0.2.4 → agentbyte-0.3.0}/src/agentbyte/llm/__init__.py +0 -0
  74. {agentbyte-0.2.4 → agentbyte-0.3.0}/src/agentbyte/llm/auth.py +0 -0
  75. {agentbyte-0.2.4 → agentbyte-0.3.0}/src/agentbyte/llm/azure_openai.py +0 -0
  76. {agentbyte-0.2.4 → agentbyte-0.3.0}/src/agentbyte/llm/base.py +0 -0
  77. {agentbyte-0.2.4 → agentbyte-0.3.0}/src/agentbyte/llm/openai.py +0 -0
  78. {agentbyte-0.2.4 → agentbyte-0.3.0}/src/agentbyte/llm/settings.py +0 -0
  79. {agentbyte-0.2.4 → agentbyte-0.3.0}/src/agentbyte/llm/types.py +0 -0
  80. {agentbyte-0.2.4 → agentbyte-0.3.0}/src/agentbyte/memory/__init__.py +0 -0
  81. {agentbyte-0.2.4 → agentbyte-0.3.0}/src/agentbyte/memory/base.py +0 -0
  82. {agentbyte-0.2.4 → agentbyte-0.3.0}/src/agentbyte/messages.py +0 -0
  83. {agentbyte-0.2.4 → agentbyte-0.3.0}/src/agentbyte/middleware/base.py +0 -0
  84. {agentbyte-0.2.4 → agentbyte-0.3.0}/src/agentbyte/session.py +0 -0
  85. {agentbyte-0.2.4 → agentbyte-0.3.0}/src/agentbyte/tools/__init__.py +0 -0
  86. {agentbyte-0.2.4 → agentbyte-0.3.0}/src/agentbyte/tools/base.py +0 -0
  87. {agentbyte-0.2.4 → agentbyte-0.3.0}/src/agentbyte/tools/core_tools.py +0 -0
  88. {agentbyte-0.2.4 → agentbyte-0.3.0}/src/agentbyte/tools/decorator.py +0 -0
  89. {agentbyte-0.2.4 → agentbyte-0.3.0}/src/agentbyte/tools/memory_tool.py +0 -0
  90. {agentbyte-0.2.4 → agentbyte-0.3.0}/src/agentbyte/types.py +0 -0
  91. {agentbyte-0.2.4 → agentbyte-0.3.0}/tests/agents/test_agent_event_types.py +0 -0
  92. {agentbyte-0.2.4 → agentbyte-0.3.0}/tests/agents/test_agent_memory_integration.py +0 -0
  93. {agentbyte-0.2.4 → agentbyte-0.3.0}/tests/agents/test_agent_middleware_integration.py +0 -0
  94. {agentbyte-0.2.4 → agentbyte-0.3.0}/tests/agents/test_agent_stream_events.py +0 -0
  95. {agentbyte-0.2.4 → agentbyte-0.3.0}/tests/llm/test_azure_client.py +0 -0
  96. {agentbyte-0.2.4 → agentbyte-0.3.0}/tests/llm/test_llm_types.py +0 -0
  97. {agentbyte-0.2.4 → agentbyte-0.3.0}/tests/llm/test_openai_client.py +0 -0
  98. {agentbyte-0.2.4 → agentbyte-0.3.0}/tests/memory/test_memory.py +0 -0
  99. {agentbyte-0.2.4 → agentbyte-0.3.0}/tests/middleware/test_middleware_chain.py +0 -0
  100. {agentbyte-0.2.4 → agentbyte-0.3.0}/tests/test_cancellation_token.py +0 -0
  101. {agentbyte-0.2.4 → agentbyte-0.3.0}/tests/test_context.py +0 -0
  102. {agentbyte-0.2.4 → agentbyte-0.3.0}/tests/test_messages.py +0 -0
  103. {agentbyte-0.2.4 → agentbyte-0.3.0}/tests/test_package_api.py +0 -0
  104. {agentbyte-0.2.4 → agentbyte-0.3.0}/tests/test_session.py +0 -0
  105. {agentbyte-0.2.4 → agentbyte-0.3.0}/tests/test_types.py +0 -0
  106. {agentbyte-0.2.4 → agentbyte-0.3.0}/tests/tools/test_memory_tool.py +0 -0
  107. {agentbyte-0.2.4 → agentbyte-0.3.0}/tests/tools/test_tools.py +0 -0
  108. {agentbyte-0.2.4 → agentbyte-0.3.0}/uv.lock +0 -0
@@ -503,6 +503,72 @@ src/agentbyte/
503
503
  ## Conding Tips and Tricks
504
504
  - When picking certain topics from certain sections of the book, first only focus on that section and not the whole chapter if not relevant to the current implementation phase
505
505
 
506
+ ## Local Jaeger Trace Inspection
507
+
508
+ Agentbyte ships a trace inspector script at `examples/otel/inspect_trace.py` that fetches a trace from local Jaeger and pretty-prints every span with its full AI messages (input, tool calls, tool results, output).
509
+
510
+ ### Setup
511
+
512
+ 1. **Start Jaeger** (clears all old traces):
513
+ ```bash
514
+ docker compose -f docker/jaeger-compose.yml down && docker compose -f docker/jaeger-compose.yml up -d
515
+ ```
516
+
517
+ 2. **Run an OTel example** to generate traces (service names: `agentbyte-example`, `agentbyte-stream`, `agentbyte-debug`):
518
+ ```bash
519
+ uv run python examples/otel/agent_with_stream_telemetry.py
520
+ ```
521
+
522
+ 3. **List all traces** for a service and see their span structure:
523
+ ```bash
524
+ curl -s "http://localhost:16686/api/traces?service=agentbyte-stream&limit=10&lookback=1h" | python3 -c "
525
+ import json, sys
526
+ data = json.load(sys.stdin)
527
+ for t in data.get('data', []):
528
+ print(t['traceID'], 'spans=', len(t['spans']))
529
+ for s in sorted(t['spans'], key=lambda x: x['startTime']):
530
+ print(' ', s['operationName'], f'({s[\"duration\"]//1000}ms)')
531
+ "
532
+ ```
533
+
534
+ 4. **Inspect a specific trace** (full messages per span):
535
+ ```bash
536
+ uv run python examples/otel/inspect_trace.py <trace_id>
537
+ ```
538
+
539
+ ### What the inspector shows per span
540
+ - **`agent <name>`** — root span, total duration
541
+ - **`chat <model>`** — `INPUT MESSAGES` (full context sent to LLM), `OUTPUT MESSAGES` (model reply), tokens/cost/finish_reason
542
+ - **`tool <name>`** — `TOOL PARAMETERS` (args), `TOOL RESULT` (return value), success flag
543
+
544
+ ### OTel environment variables
545
+ | Variable | Default | Purpose |
546
+ |---|---|---|
547
+ | `AGENTBYTE_ENABLE_OTEL` | `false` | Enable OTel instrumentation |
548
+ | `AGENTBYTE_OTEL_CAPTURE_CONTENT` | `false` | Capture full message content in spans (needed for inspector to show messages) |
549
+ | `OTEL_SERVICE_NAME` | — | Service label shown in Jaeger |
550
+ | `OTEL_EXPORTER_OTLP_ENDPOINT` | — | OTLP endpoint (e.g. `http://localhost:4318`) |
551
+
552
+ ### Trace structure
553
+ ```
554
+ agent city_assistant ← root span (one per run_stream/run call)
555
+ └─ chat gpt-4.1-mini ← LLM call: tokens, cost, finish_reason, messages
556
+ └─ tool get_weather ← tool execution: params, result
557
+ └─ tool get_population ← tool execution: params, result
558
+ └─ chat gpt-4.1-mini ← final LLM call with all tool results
559
+ ```
560
+
561
+ ### Jaeger UI
562
+ View at **http://localhost:16686** — use service dropdown to select `agentbyte-stream`, `agentbyte-example`, or `agentbyte-debug`.
563
+
564
+ ### Message format note
565
+ Agentbyte serializes messages with a `parts` array (not OpenAI-style `content` string). The inspector handles both formats automatically.
566
+
567
+ ---
568
+
569
+ ## Script Execution Rule
570
+ - Assume Python scripts are run from the repository root. Use `.envs/local.env` with a root-relative path (e.g., `Path(".envs") / "local.env"`) instead of traversing parents.
571
+
506
572
  ## Coding Rules:
507
573
  - Try to create minimal tests with pytest and pytest async for testing any code. **AVOID heredoc blocks** (`uv run python3 << 'EOF'`) as they tend to hang/freeze in terminal output:
508
574
  - ✅ Good: `uv run python3 -c "from agentbyte.llm import X; print(X)"`
@@ -523,6 +589,7 @@ src/agentbyte/
523
589
  - Run full checks: `uv run ruff check <file_or_dir>`
524
590
  - Auto-fix fixable issues: `uv run ruff check <file_or_dir> --fix`
525
591
  - This catches unused imports, style issues, and other code quality concerns early
592
+ - **Release/tag rule (mandatory):** whenever preparing a new version tag/release, always update both `README.md` and `CHANGELOG.md` in the same change set before commit/tag/push.
526
593
  ## Success Criteria
527
594
 
528
595
  ✓ **Deep Understanding:** Can explain the "why" behind each pattern and design decision
@@ -0,0 +1,131 @@
1
+ # Changelog
2
+
3
+ All notable changes to Agentbyte are documented in this file.
4
+
5
+ The format follows Keep a Changelog principles and semantic versioning.
6
+
7
+ ## [0.3.0] - 2026-03-06
8
+
9
+ ### Breaking Changes
10
+ - `BaseAgent` no longer stores a context instance. `self.context`, `reset_context()`, `clear_messages()`, `window_messages()`, and `reset()` are removed. `Agent.__init__` no longer accepts a `context=` keyword argument.
11
+ - Multi-turn sessions must now be managed by the caller: pass `context=` to each `run()`/`run_stream()` call and capture the returned context from `AgentResponse.context`.
12
+
13
+ ### Changed
14
+ - `Agent.run(task=None, context=None, ...)` and `Agent.run_stream(task=None, context=None, ...)` accept a per-call `AgentContext`. When `None`, a fresh context is created automatically.
15
+ - `AgentResponse.context` returns the fully-populated working context to the caller after every run.
16
+ - `AgentAsTool.execute(parameters, context=None)` and `execute_stream(parameters, context=None, ...)` thread the caller-supplied context through to the underlying agent.
17
+ - `AgentToolCompatible` protocol updated to include `context=None` on both `execute` and `execute_stream`.
18
+
19
+ ### Documentation
20
+ - `topic_agents.md`: Parts 2.5 (lock-free context threading) and 2.6 (agent-as-tool context) added.
21
+ - `topic_approval.md`: Tool approval resume pattern updated to `agent.run(context=first_response.context)`.
22
+ - `topic_otel_spans.md`: Dummy trace ID notes added; `args: {}` vs `TOOL PARAMETERS` discrepancy explained; known limitation section for parsed args not captured in chat span attributes.
23
+ - Notebooks `04-agent-with-context`, `07-agent-as-tool-coordinator`, `04.2-metadata-extraction-large-doc` updated to caller-owned context pattern.
24
+
25
+ ## [0.2.7] - 2026-03-03
26
+
27
+ ### Added
28
+ - `run_stream()` is now fully instrumented with an OTel root span via the native `_root_span()` context manager — every streaming task gets a correctly nested `agent <name>` root span identical to `run()`.
29
+ - New OTel example `examples/otel/agent_with_stream_telemetry.py` — streaming agent with 3 queries of increasing tool complexity (service: `agentbyte-stream`).
30
+ - New `examples/otel/inspect_traces.py` — CLI utility to inspect Jaeger traces without opening the UI; requires a traceID positional argument.
31
+
32
+ ### Changed
33
+ - `auto_instrument()` now patches **only** `Agent.__init__` (OTelMiddleware injection); root span creation is handled natively in `Agent.run_stream()` — no monkey-patching of `run` or `run_stream`.
34
+ - `Agent.run_stream` execution logic renamed internally to `_run_stream_impl`; public `run_stream` is a thin span-wrapping delegate.
35
+ - `_annotate_root_span()` is a module-level function in `otel.py` — all OTel instrumentation logic is now centralized in one file.
36
+
37
+ ## [0.2.6] - 2026-03-03
38
+
39
+ ### Added
40
+ - OpenTelemetry model-call usage enrichment:
41
+ - `gen_ai.usage.total_tokens`
42
+ - `gen_ai.usage.cost_estimate_usd`
43
+ - `gen_ai.response.finish_reason`
44
+ - Root agent span usage enrichment (opt-in via `AGENTBYTE_OTEL_CAPTURE_USAGE=true`):
45
+ - `gen_ai.agent.finish_reason`
46
+ - `gen_ai.agent.llm_calls`
47
+ - `gen_ai.usage.duration_ms`
48
+ - `gen_ai.usage.input_tokens`
49
+ - `gen_ai.usage.output_tokens`
50
+ - `gen_ai.usage.total_tokens`
51
+ - `gen_ai.usage.cost_estimate_usd`
52
+
53
+ ### Changed
54
+ - OTel examples now set `AGENTBYTE_OTEL_CAPTURE_USAGE=true` to demonstrate final task-level usage aggregation on root spans.
55
+ - OTel middleware now uses `Usage.total_tokens` directly for span attribute emission.
56
+
57
+ ### Documentation
58
+ - Updated README to position Agentbyte as an observability-first agentic AI framework.
59
+ - Added no-UI Jaeger debugging workflow (API-based trace inspection with `curl`).
60
+
61
+ ## [0.2.5] - 2026-03-02
62
+
63
+ ### Changed
64
+ - Synced release documentation with code version and updated release-facing project docs.
65
+ - Updated release process guidance in repository instructions to require `README.md` and `CHANGELOG.md` updates for every tag.
66
+
67
+ ### Documentation
68
+ - Updated README release section to reflect the new version and current highlights.
69
+
70
+ ## [0.2.4] - 2026-03-02
71
+
72
+ ### Added
73
+ - New use-case notebook: `04.2-metadata-extraction-large-doc.ipynb` for progressive chunked metadata extraction with memory and aggregation.
74
+ - New concept sample-data JSON files for ASMD/ESMD synthetic contract metadata.
75
+ - Project logo asset at `logo/agent-byte-avatar-low.png`.
76
+
77
+ ### Changed
78
+ - Reorganized notebooks into `notebooks/concepts/agent/` and `notebooks/usecases/` with updated naming.
79
+ - Refreshed multiple concept notebooks for agent, middleware, memory, OTel, and agent-as-tool flows.
80
+
81
+ ## [0.2.3] - 2026-03-02
82
+
83
+ ### Changed
84
+ - Unified `Conversation` and `Workspace` into a single `Session` model. Both were structurally identical; domain semantics now live in `Session.metadata` (e.g. `{"name": "Blog Post"}`).
85
+ - `session.py` now contains `Session(Entity)`, `BaseSession(ABC)`, and `InMemorySession` — flat pattern mirroring `memory/base.py`.
86
+ - `AgentContext.conversation_id` field removed. `session_id: Optional[str]` (already present) is the sole context-level session link.
87
+
88
+ ### Removed
89
+ - `src/agentbyte/conversation/` module and all exports (`Conversation`, `BaseConversation`, `InMemoryConversation`).
90
+ - `src/agentbyte/workspace/` module and all exports (`Workspace`, `BaseWorkspace`, `InMemoryWorkspace`).
91
+ - `tests/test_conversation.py`, `tests/test_workspace.py`, `tests/agents/test_agent_conversation_integration.py`.
92
+
93
+ ### Added
94
+ - `tests/test_session.py` — 19 tests covering `Session` identity/equality, `to_context()`/`from_context()`, `InMemorySession` CRUD, copy-safety, and ABC contract.
95
+
96
+ ### Reorganized
97
+ - Notebooks moved from flat layout into `notebooks/agent/`, `notebooks/auth/`, and `notebooks/usecase/` subdirectories.
98
+
99
+ ## [0.2.1] - 2026-02-27
100
+
101
+ ### Changed
102
+ - Updated package metadata for project URLs (Homepage, Repository, Issues, Changelog).
103
+ - Updated README installation guidance for `pip`/`uv add` extras usage.
104
+
105
+ ### Added
106
+ - Added root `LICENSE` file (MIT) for distribution compliance and clarity.
107
+
108
+ ## [0.2.0] - 2026-02-27
109
+
110
+ ### Added
111
+ - Memory serialization parity (`ListMemoryConfig`, `FileMemoryConfig`, `_to_config`, `_from_config`).
112
+ - Agent-managed memory tooling via `MemoryTool` and `MemoryBackend`.
113
+ - Middleware-driven memory access routing (`operation="memory_access"`).
114
+ - `ApprovalMiddleware` for centralized tool-approval policy.
115
+ - OpenTelemetry middleware and auto-instrumentation support.
116
+ - Notebook examples for middleware patterns and real-client logging middleware.
117
+ - New/expanded tests for middleware, memory, package API, and OTel integration.
118
+
119
+ ### Changed
120
+ - Middleware execution and event pipeline now support richer parity behavior with request/response/error fan-out semantics.
121
+ - Agent run paths now integrate improved middleware handling and instrumentation.
122
+ - Package API now exposes `Agent` at package root and supports opt-in auto-instrumentation via environment variable.
123
+
124
+ ### Fixed
125
+ - Token usage mapping alignment in telemetry paths (`tokens_input`, `tokens_output`).
126
+ - Auto-instrumentation idempotency for repeated setup calls.
127
+
128
+ ## [0.1.2] - 2026-02-25
129
+
130
+ ### Added
131
+ - Initial middleware and memory completion pass (streaming middleware baseline, approval pause integration, memory tooling foundations).
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: agentbyte
3
- Version: 0.2.4
3
+ Version: 0.3.0
4
4
  Summary: A toolkit for designing multiagent systems
5
5
  Project-URL: Homepage, https://gitlab.com/pyninja/aiengineering/agentbyte
6
6
  Project-URL: Repository, https://gitlab.com/pyninja/aiengineering/agentbyte
@@ -30,22 +30,24 @@ Requires-Dist: opentelemetry-sdk>=1.39.1; extra == 'otel'
30
30
  Description-Content-Type: text/markdown
31
31
 
32
32
  <p align="center">
33
- <img src="logo/agent-byte-avatar-low.png" alt="Agentbyte" width="200"/>
33
+ <img src="https://gitlab.com/pyninja/aiengineering/agentbyte/-/raw/v0.3.0/logo/agent-byte-avatar-low.png" alt="Agentbyte" width="200"/>
34
34
  </p>
35
35
 
36
36
  # Agentbyte
37
37
 
38
- Agentbyte is a Python toolkit for building and studying multiagent systems with a learning-first, implementation-oriented workflow.
38
+ Agentbyte is an observability-first agentic AI framework for building and studying multiagent systems with a learning-first, implementation-oriented workflow.
39
39
 
40
- Current release: **0.2.1**
40
+ Current release: **0.3.0**
41
41
 
42
42
  Repository: [gitlab.com/pyninja/aiengineering/agentbyte](https://gitlab.com/pyninja/aiengineering/agentbyte)
43
43
 
44
- ## Whats New in 0.2.1
44
+ ## What's New in 0.3.0
45
45
 
46
- - Added explicit project URLs in package metadata (Homepage, Repository, Issues, Changelog).
47
- - Added MIT `LICENSE` file at repository root.
48
- - Expanded README install guidance for extras using `pip install` and `uv add`.
46
+ - **Breaking:** `BaseAgent` no longer stores context. `self.context`, `reset_context()`, `clear_messages()`, `window_messages()`, and `reset()` are removed. `Agent.__init__` no longer accepts a `context=` kwarg.
47
+ - `Agent.run(task=None, context=None, ...)` and `Agent.run_stream(task=None, context=None, ...)` accept a per-call `AgentContext`. A fresh context is created automatically when `None`.
48
+ - `AgentResponse.context` returns the fully-populated working context to the caller enables clean multi-turn patterns without agent-side state.
49
+ - `AgentAsTool.execute()` and `execute_stream()` thread the caller-supplied context through to the underlying agent.
50
+ - Notebooks, study docs (`topic_agents.md`, `topic_approval.md`), and OTel span guide (`topic_otel_spans.md`) updated to the caller-owned context pattern.
49
51
 
50
52
  See [CHANGELOG.md](CHANGELOG.md) for the complete release history.
51
53
 
@@ -57,6 +59,36 @@ See [CHANGELOG.md](CHANGELOG.md) for the complete release history.
57
59
  - Built-in middleware: logging, security, rate limiting, approval, telemetry.
58
60
  - Memory abstractions: list memory, file memory, context injection.
59
61
  - OpenAI and Azure OpenAI model client support.
62
+ - OpenTelemetry-first tracing with model-call and task-level usage telemetry.
63
+
64
+ ## Observability-First Telemetry
65
+
66
+ Agentbyte exposes two complementary telemetry layers:
67
+
68
+ - **Per-call middleware spans** (`chat ...`, `tool ...`) for model/tool-level diagnostics.
69
+ - **Task-level root span attributes** (`agent ...`) for final aggregated usage and outcome.
70
+
71
+ Enable telemetry:
72
+
73
+ ```bash
74
+ export AGENTBYTE_ENABLE_OTEL=true
75
+ ```
76
+
77
+ Per-call span attributes emitted by `OTelMiddleware`:
78
+
79
+ - `gen_ai.usage.input_tokens`, `gen_ai.usage.output_tokens`, `gen_ai.usage.total_tokens`
80
+ - `gen_ai.usage.cost_estimate_usd`
81
+ - `gen_ai.response.finish_reason`
82
+ - `gen_ai.request.model`
83
+ - `gen_ai.tool.name`, `gen_ai.tool.success`
84
+
85
+ ## Degugging Traces without UI
86
+ details can be found in the [OTel spans guide](docs/study/topic_otel_spans.md#debugging-traces-without-ui).
87
+
88
+ Practical interpretation:
89
+
90
+ - `chat gpt-4.1-mini` spans show **per-call** usage/cost/finish reason.
91
+ - `agent <name>` span shows **final accumulated** usage and final task outcome.
60
92
 
61
93
  ## Installation
62
94
 
@@ -148,5 +180,4 @@ MIT — see [LICENSE](LICENSE).
148
180
 
149
181
  - [Designing Multi-Agent Systems](https://github.com/victordibia/designing-multiagent-systems/tree/main)
150
182
  - [Microsoft Agent Framework](https://github.com/microsoft/agent-framework)
151
- - [Pydantic AI](https://ai.pydantic.dev/)
152
183
 
@@ -1,20 +1,22 @@
1
1
  <p align="center">
2
- <img src="logo/agent-byte-avatar-low.png" alt="Agentbyte" width="200"/>
2
+ <img src="https://gitlab.com/pyninja/aiengineering/agentbyte/-/raw/v0.3.0/logo/agent-byte-avatar-low.png" alt="Agentbyte" width="200"/>
3
3
  </p>
4
4
 
5
5
  # Agentbyte
6
6
 
7
- Agentbyte is a Python toolkit for building and studying multiagent systems with a learning-first, implementation-oriented workflow.
7
+ Agentbyte is an observability-first agentic AI framework for building and studying multiagent systems with a learning-first, implementation-oriented workflow.
8
8
 
9
- Current release: **0.2.1**
9
+ Current release: **0.3.0**
10
10
 
11
11
  Repository: [gitlab.com/pyninja/aiengineering/agentbyte](https://gitlab.com/pyninja/aiengineering/agentbyte)
12
12
 
13
- ## Whats New in 0.2.1
13
+ ## What's New in 0.3.0
14
14
 
15
- - Added explicit project URLs in package metadata (Homepage, Repository, Issues, Changelog).
16
- - Added MIT `LICENSE` file at repository root.
17
- - Expanded README install guidance for extras using `pip install` and `uv add`.
15
+ - **Breaking:** `BaseAgent` no longer stores context. `self.context`, `reset_context()`, `clear_messages()`, `window_messages()`, and `reset()` are removed. `Agent.__init__` no longer accepts a `context=` kwarg.
16
+ - `Agent.run(task=None, context=None, ...)` and `Agent.run_stream(task=None, context=None, ...)` accept a per-call `AgentContext`. A fresh context is created automatically when `None`.
17
+ - `AgentResponse.context` returns the fully-populated working context to the caller enables clean multi-turn patterns without agent-side state.
18
+ - `AgentAsTool.execute()` and `execute_stream()` thread the caller-supplied context through to the underlying agent.
19
+ - Notebooks, study docs (`topic_agents.md`, `topic_approval.md`), and OTel span guide (`topic_otel_spans.md`) updated to the caller-owned context pattern.
18
20
 
19
21
  See [CHANGELOG.md](CHANGELOG.md) for the complete release history.
20
22
 
@@ -26,6 +28,36 @@ See [CHANGELOG.md](CHANGELOG.md) for the complete release history.
26
28
  - Built-in middleware: logging, security, rate limiting, approval, telemetry.
27
29
  - Memory abstractions: list memory, file memory, context injection.
28
30
  - OpenAI and Azure OpenAI model client support.
31
+ - OpenTelemetry-first tracing with model-call and task-level usage telemetry.
32
+
33
+ ## Observability-First Telemetry
34
+
35
+ Agentbyte exposes two complementary telemetry layers:
36
+
37
+ - **Per-call middleware spans** (`chat ...`, `tool ...`) for model/tool-level diagnostics.
38
+ - **Task-level root span attributes** (`agent ...`) for final aggregated usage and outcome.
39
+
40
+ Enable telemetry:
41
+
42
+ ```bash
43
+ export AGENTBYTE_ENABLE_OTEL=true
44
+ ```
45
+
46
+ Per-call span attributes emitted by `OTelMiddleware`:
47
+
48
+ - `gen_ai.usage.input_tokens`, `gen_ai.usage.output_tokens`, `gen_ai.usage.total_tokens`
49
+ - `gen_ai.usage.cost_estimate_usd`
50
+ - `gen_ai.response.finish_reason`
51
+ - `gen_ai.request.model`
52
+ - `gen_ai.tool.name`, `gen_ai.tool.success`
53
+
54
+ ## Degugging Traces without UI
55
+ details can be found in the [OTel spans guide](docs/study/topic_otel_spans.md#debugging-traces-without-ui).
56
+
57
+ Practical interpretation:
58
+
59
+ - `chat gpt-4.1-mini` spans show **per-call** usage/cost/finish reason.
60
+ - `agent <name>` span shows **final accumulated** usage and final task outcome.
29
61
 
30
62
  ## Installation
31
63
 
@@ -117,5 +149,4 @@ MIT — see [LICENSE](LICENSE).
117
149
 
118
150
  - [Designing Multi-Agent Systems](https://github.com/victordibia/designing-multiagent-systems/tree/main)
119
151
  - [Microsoft Agent Framework](https://github.com/microsoft/agent-framework)
120
- - [Pydantic AI](https://ai.pydantic.dev/)
121
152
 
@@ -1,5 +1,3 @@
1
- version: "3.9"
2
-
3
1
  services:
4
2
  jaeger:
5
3
  image: jaegertracing/all-in-one:latest
@@ -0,0 +1,81 @@
1
+ # Progress Log (Compact)
2
+
3
+ This file keeps a concise, high-signal history of major milestones only.
4
+
5
+ ## 2026-03-06 — v0.3.0 (Breaking) Lock-Free Context Threading
6
+
7
+ ### Scope
8
+ - Refactored agent execution to caller-owned context.
9
+ - Removed agent-held mutable session state.
10
+ - Updated docs/notebooks to match the new usage pattern.
11
+
12
+ ### Design Decision
13
+ - `AgentContext` is passed per call and returned via `AgentResponse.context`.
14
+ - This removes shared mutable state from agents and enables safe concurrent reuse.
15
+
16
+ ### Breaking Changes
17
+ - Removed agent-owned context API:
18
+ - `self.context`
19
+ - `reset_context()`
20
+ - `clear_messages()`
21
+ - `window_messages()`
22
+ - `reset()`
23
+ - `Agent.__init__(context=...)` no longer supported.
24
+
25
+ ### New Usage Pattern
26
+ - `run(task=None, context=None, ...)`
27
+ - `run_stream(task=None, context=None, ...)`
28
+ - Continue multi-turn sessions by reusing `response.context`.
29
+
30
+ ### Related Updates
31
+ - Agent-as-tool context threading updated.
32
+ - Study docs and notebooks aligned with caller-owned context.
33
+ - OTel trace guide clarified `args: {}` vs tool-parameter spans.
34
+
35
+ ### Validation
36
+ - Ruff: passed.
37
+ - Pytest: 256 passed.
38
+
39
+ ---
40
+
41
+ ## 2026-03-05 — OTel Simplification + Trace Inspector
42
+
43
+ ### Scope
44
+ - Simplified OTel architecture and removed unnecessary root-span usage aggregation.
45
+ - Added local Jaeger trace inspection utility.
46
+
47
+ ### Outcomes
48
+ - Per-call `chat` and `tool` spans remain the primary observability surface.
49
+ - Added `examples/otel/inspect_trace.py` for full trace/message inspection.
50
+ - Updated tests and docs; suite remained green.
51
+
52
+ ---
53
+
54
+ ## 2026-03-02 — Session Model Unification
55
+
56
+ ### Scope
57
+ - Unified conversation/workspace into a single session model.
58
+
59
+ ### Outcomes
60
+ - Consolidated to `Session`, `BaseSession`, and `InMemorySession`.
61
+ - Removed redundant conversation/workspace modules.
62
+ - Updated context and package exports accordingly.
63
+
64
+ ---
65
+
66
+ ## 2026-02-26 to 2026-02-27 — Middleware/Memory/OTel Foundation
67
+
68
+ ### Scope
69
+ - Completed Chapter 4.9/4.10-aligned foundations for middleware, memory operations, and telemetry.
70
+
71
+ ### Outcomes
72
+ - Middleware streaming and approval flow integrated.
73
+ - Memory tool and memory middleware routing added.
74
+ - OTel middleware + auto instrumentation introduced and hardened.
75
+
76
+ ---
77
+
78
+ ## Current Status
79
+ - Current release target in repository: **0.3.0**.
80
+ - Primary branch is release-ready with validated tests.
81
+ - Next: create release commit, tag `v0.3.0`, and push branch/tag.