agentbyte 0.2.7__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 (107) hide show
  1. {agentbyte-0.2.7 → agentbyte-0.3.0}/.github/copilot-instructions.md +63 -0
  2. {agentbyte-0.2.7 → agentbyte-0.3.0}/CHANGELOG.md +18 -0
  3. {agentbyte-0.2.7 → agentbyte-0.3.0}/PKG-INFO +17 -33
  4. {agentbyte-0.2.7 → agentbyte-0.3.0}/README.md +16 -32
  5. agentbyte-0.3.0/docs/progress.md +81 -0
  6. agentbyte-0.3.0/docs/study/topic_agents.md +454 -0
  7. {agentbyte-0.2.7 → agentbyte-0.3.0}/docs/study/topic_approval.md +54 -15
  8. agentbyte-0.3.0/docs/study/topic_otel_spans.md +752 -0
  9. {agentbyte-0.2.7 → agentbyte-0.3.0}/examples/otel/agent_with_content_capture.py +0 -1
  10. {agentbyte-0.2.7 → agentbyte-0.3.0}/examples/otel/agent_with_stream_telemetry.py +3 -11
  11. {agentbyte-0.2.7 → agentbyte-0.3.0}/examples/otel/agent_with_telemetry.py +0 -1
  12. agentbyte-0.3.0/examples/otel/inspect_trace.py +254 -0
  13. {agentbyte-0.2.7 → agentbyte-0.3.0}/notebooks/concepts/agent/04-agent-with-context.ipynb +85 -51
  14. {agentbyte-0.2.7 → agentbyte-0.3.0}/notebooks/concepts/agent/07-agent-as-tool-coordinator.ipynb +86 -68
  15. {agentbyte-0.2.7 → agentbyte-0.3.0}/notebooks/usecases/04.2-metadata-extraction-large-doc.ipynb +20 -30
  16. agentbyte-0.3.0/src/agentbyte/__about__.py +2 -0
  17. {agentbyte-0.2.7 → agentbyte-0.3.0}/src/agentbyte/agents/agent.py +83 -75
  18. {agentbyte-0.2.7 → agentbyte-0.3.0}/src/agentbyte/agents/agent_as_tool.py +16 -3
  19. {agentbyte-0.2.7 → agentbyte-0.3.0}/src/agentbyte/agents/base.py +29 -24
  20. {agentbyte-0.2.7 → agentbyte-0.3.0}/src/agentbyte/middleware/otel.py +22 -44
  21. {agentbyte-0.2.7 → agentbyte-0.3.0}/tests/agents/test_agent_as_tool.py +7 -4
  22. {agentbyte-0.2.7 → agentbyte-0.3.0}/tests/agents/test_agent_basic.py +0 -48
  23. {agentbyte-0.2.7 → agentbyte-0.3.0}/tests/agents/test_tool_approval.py +4 -4
  24. {agentbyte-0.2.7 → agentbyte-0.3.0}/tests/middleware/test_otel.py +1 -40
  25. agentbyte-0.2.7/docs/progress.md +0 -307
  26. agentbyte-0.2.7/docs/study/topic_agents.md +0 -319
  27. agentbyte-0.2.7/src/agentbyte/__about__.py +0 -2
  28. {agentbyte-0.2.7 → agentbyte-0.3.0}/.gitignore +0 -0
  29. {agentbyte-0.2.7 → agentbyte-0.3.0}/.gitlab-ci.yml +0 -0
  30. {agentbyte-0.2.7 → agentbyte-0.3.0}/.gitmodules +0 -0
  31. {agentbyte-0.2.7 → agentbyte-0.3.0}/.python-version +0 -0
  32. {agentbyte-0.2.7 → agentbyte-0.3.0}/LICENSE +0 -0
  33. {agentbyte-0.2.7 → agentbyte-0.3.0}/docker/jaeger-compose.yml +0 -0
  34. {agentbyte-0.2.7 → agentbyte-0.3.0}/docs/book-designing-multi-agent-system.md +0 -0
  35. {agentbyte-0.2.7 → agentbyte-0.3.0}/docs/implementation_plan.md +0 -0
  36. {agentbyte-0.2.7 → agentbyte-0.3.0}/docs/study/topic_memory.md +0 -0
  37. {agentbyte-0.2.7 → agentbyte-0.3.0}/docs/study/topic_middleware.md +0 -0
  38. {agentbyte-0.2.7 → agentbyte-0.3.0}/docs/study/topic_model_client.md +0 -0
  39. {agentbyte-0.2.7 → agentbyte-0.3.0}/docs/study/topic_otel.md +0 -0
  40. {agentbyte-0.2.7 → agentbyte-0.3.0}/docs/study/topic_tools.md +0 -0
  41. {agentbyte-0.2.7 → agentbyte-0.3.0}/docs/study_plan.md +0 -0
  42. {agentbyte-0.2.7 → agentbyte-0.3.0}/examples/azure_openai_usage_example.py +0 -0
  43. {agentbyte-0.2.7 → agentbyte-0.3.0}/examples/function_tool_example.py +0 -0
  44. {agentbyte-0.2.7 → agentbyte-0.3.0}/examples/llm_client_dependency_injection.py +0 -0
  45. {agentbyte-0.2.7 → agentbyte-0.3.0}/examples/memory/memory_usage_example.py +0 -0
  46. {agentbyte-0.2.7 → agentbyte-0.3.0}/examples/message_types_example.py +0 -0
  47. {agentbyte-0.2.7 → agentbyte-0.3.0}/examples/openai_client_example.py +0 -0
  48. {agentbyte-0.2.7 → agentbyte-0.3.0}/examples/otel/inspect_traces.py +0 -0
  49. {agentbyte-0.2.7 → agentbyte-0.3.0}/logo/agent-byte-avatar-low.png +0 -0
  50. {agentbyte-0.2.7 → agentbyte-0.3.0}/notebooks/agent-knowledge-building.ipynb +0 -0
  51. {agentbyte-0.2.7 → agentbyte-0.3.0}/notebooks/auth/00-Authentication-and-Identity-of-AI-clients.ipynb +0 -0
  52. {agentbyte-0.2.7 → agentbyte-0.3.0}/notebooks/concepts/agent/01-tools-example.ipynb +0 -0
  53. {agentbyte-0.2.7 → agentbyte-0.3.0}/notebooks/concepts/agent/02a-azure-openai-wrapper.ipynb +0 -0
  54. {agentbyte-0.2.7 → agentbyte-0.3.0}/notebooks/concepts/agent/02b-openai-wrapper.ipynb +0 -0
  55. {agentbyte-0.2.7 → agentbyte-0.3.0}/notebooks/concepts/agent/03a-simple-agent-no-tool.ipynb +0 -0
  56. {agentbyte-0.2.7 → agentbyte-0.3.0}/notebooks/concepts/agent/03b-agent-with-tool.ipynb +0 -0
  57. {agentbyte-0.2.7 → agentbyte-0.3.0}/notebooks/concepts/agent/03c-multi-tool-agent.ipynb +0 -0
  58. {agentbyte-0.2.7 → agentbyte-0.3.0}/notebooks/concepts/agent/05a-agent-with-middleware.ipynb +0 -0
  59. {agentbyte-0.2.7 → agentbyte-0.3.0}/notebooks/concepts/agent/05b-agent-with-otel-middleware.ipynb +0 -0
  60. {agentbyte-0.2.7 → agentbyte-0.3.0}/notebooks/concepts/agent/06-agent-with-memory.ipynb +0 -0
  61. {agentbyte-0.2.7 → agentbyte-0.3.0}/notebooks/concepts/agent/sample-data/contracts_asmd_seed_rows.json +0 -0
  62. {agentbyte-0.2.7 → agentbyte-0.3.0}/notebooks/concepts/agent/sample-data/contracts_esmd_seed_rows.json +0 -0
  63. {agentbyte-0.2.7 → agentbyte-0.3.0}/notebooks/usecases/04.1-multi-turn-agent.ipynb +0 -0
  64. {agentbyte-0.2.7 → agentbyte-0.3.0}/pyproject.toml +0 -0
  65. {agentbyte-0.2.7 → agentbyte-0.3.0}/src/agentbyte/__init__.py +0 -0
  66. {agentbyte-0.2.7 → agentbyte-0.3.0}/src/agentbyte/agents/__init__.py +0 -0
  67. {agentbyte-0.2.7 → agentbyte-0.3.0}/src/agentbyte/agents/types.py +0 -0
  68. {agentbyte-0.2.7 → agentbyte-0.3.0}/src/agentbyte/cancellation_token.py +0 -0
  69. {agentbyte-0.2.7 → agentbyte-0.3.0}/src/agentbyte/context.py +0 -0
  70. {agentbyte-0.2.7 → agentbyte-0.3.0}/src/agentbyte/entity.py +0 -0
  71. {agentbyte-0.2.7 → agentbyte-0.3.0}/src/agentbyte/llm/__init__.py +0 -0
  72. {agentbyte-0.2.7 → agentbyte-0.3.0}/src/agentbyte/llm/auth.py +0 -0
  73. {agentbyte-0.2.7 → agentbyte-0.3.0}/src/agentbyte/llm/azure_openai.py +0 -0
  74. {agentbyte-0.2.7 → agentbyte-0.3.0}/src/agentbyte/llm/base.py +0 -0
  75. {agentbyte-0.2.7 → agentbyte-0.3.0}/src/agentbyte/llm/openai.py +0 -0
  76. {agentbyte-0.2.7 → agentbyte-0.3.0}/src/agentbyte/llm/settings.py +0 -0
  77. {agentbyte-0.2.7 → agentbyte-0.3.0}/src/agentbyte/llm/types.py +0 -0
  78. {agentbyte-0.2.7 → agentbyte-0.3.0}/src/agentbyte/memory/__init__.py +0 -0
  79. {agentbyte-0.2.7 → agentbyte-0.3.0}/src/agentbyte/memory/base.py +0 -0
  80. {agentbyte-0.2.7 → agentbyte-0.3.0}/src/agentbyte/messages.py +0 -0
  81. {agentbyte-0.2.7 → agentbyte-0.3.0}/src/agentbyte/middleware/__init__.py +0 -0
  82. {agentbyte-0.2.7 → agentbyte-0.3.0}/src/agentbyte/middleware/base.py +0 -0
  83. {agentbyte-0.2.7 → agentbyte-0.3.0}/src/agentbyte/session.py +0 -0
  84. {agentbyte-0.2.7 → agentbyte-0.3.0}/src/agentbyte/tools/__init__.py +0 -0
  85. {agentbyte-0.2.7 → agentbyte-0.3.0}/src/agentbyte/tools/base.py +0 -0
  86. {agentbyte-0.2.7 → agentbyte-0.3.0}/src/agentbyte/tools/core_tools.py +0 -0
  87. {agentbyte-0.2.7 → agentbyte-0.3.0}/src/agentbyte/tools/decorator.py +0 -0
  88. {agentbyte-0.2.7 → agentbyte-0.3.0}/src/agentbyte/tools/memory_tool.py +0 -0
  89. {agentbyte-0.2.7 → agentbyte-0.3.0}/src/agentbyte/types.py +0 -0
  90. {agentbyte-0.2.7 → agentbyte-0.3.0}/tests/agents/test_agent_event_types.py +0 -0
  91. {agentbyte-0.2.7 → agentbyte-0.3.0}/tests/agents/test_agent_memory_integration.py +0 -0
  92. {agentbyte-0.2.7 → agentbyte-0.3.0}/tests/agents/test_agent_middleware_integration.py +0 -0
  93. {agentbyte-0.2.7 → agentbyte-0.3.0}/tests/agents/test_agent_stream_events.py +0 -0
  94. {agentbyte-0.2.7 → agentbyte-0.3.0}/tests/llm/test_azure_client.py +0 -0
  95. {agentbyte-0.2.7 → agentbyte-0.3.0}/tests/llm/test_llm_types.py +0 -0
  96. {agentbyte-0.2.7 → agentbyte-0.3.0}/tests/llm/test_openai_client.py +0 -0
  97. {agentbyte-0.2.7 → agentbyte-0.3.0}/tests/memory/test_memory.py +0 -0
  98. {agentbyte-0.2.7 → agentbyte-0.3.0}/tests/middleware/test_middleware_chain.py +0 -0
  99. {agentbyte-0.2.7 → agentbyte-0.3.0}/tests/test_cancellation_token.py +0 -0
  100. {agentbyte-0.2.7 → agentbyte-0.3.0}/tests/test_context.py +0 -0
  101. {agentbyte-0.2.7 → agentbyte-0.3.0}/tests/test_messages.py +0 -0
  102. {agentbyte-0.2.7 → agentbyte-0.3.0}/tests/test_package_api.py +0 -0
  103. {agentbyte-0.2.7 → agentbyte-0.3.0}/tests/test_session.py +0 -0
  104. {agentbyte-0.2.7 → agentbyte-0.3.0}/tests/test_types.py +0 -0
  105. {agentbyte-0.2.7 → agentbyte-0.3.0}/tests/tools/test_memory_tool.py +0 -0
  106. {agentbyte-0.2.7 → agentbyte-0.3.0}/tests/tools/test_tools.py +0 -0
  107. {agentbyte-0.2.7 → agentbyte-0.3.0}/uv.lock +0 -0
@@ -503,6 +503,69 @@ 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
+
506
569
  ## Script Execution Rule
507
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.
508
571
 
@@ -4,6 +4,24 @@ All notable changes to Agentbyte are documented in this file.
4
4
 
5
5
  The format follows Keep a Changelog principles and semantic versioning.
6
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
+
7
25
  ## [0.2.7] - 2026-03-03
8
26
 
9
27
  ### Added
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: agentbyte
3
- Version: 0.2.7
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,24 +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="https://gitlab.com/pyninja/aiengineering/agentbyte/-/raw/v0.2.7/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
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.7**
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
- ## What's New in 0.2.7
44
+ ## What's New in 0.3.0
45
45
 
46
- - `run_stream()` is now fully instrumented with an OTel root span every streaming task gets a correctly nested `agent <name>` root span identical to `run()`.
47
- - Root span is created via a native `_root_span()` context manager in `Agent`; `auto_instrument()` no longer monkey-patches `run` or `run_stream`.
48
- - New streaming example `examples/otel/agent_with_stream_telemetry.py` (service: `agentbyte-stream`).
49
- - New `examples/otel/inspect_traces.py` CLI utility inspect Jaeger traces by traceID without opening the UI.
50
- - All OTel instrumentation logic centralized in `otel.py`; `_annotate_root_span()` is now a module-level function.
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.
51
51
 
52
52
  See [CHANGELOG.md](CHANGELOG.md) for the complete release history.
53
53
 
@@ -68,37 +68,22 @@ Agentbyte exposes two complementary telemetry layers:
68
68
  - **Per-call middleware spans** (`chat ...`, `tool ...`) for model/tool-level diagnostics.
69
69
  - **Task-level root span attributes** (`agent ...`) for final aggregated usage and outcome.
70
70
 
71
- Enable root-level usage aggregation:
71
+ Enable telemetry:
72
72
 
73
73
  ```bash
74
74
  export AGENTBYTE_ENABLE_OTEL=true
75
- export AGENTBYTE_OTEL_CAPTURE_USAGE=true
76
75
  ```
77
76
 
78
- Then inspect attributes such as:
77
+ Per-call span attributes emitted by `OTelMiddleware`:
79
78
 
80
- - `gen_ai.agent.finish_reason`
81
- - `gen_ai.agent.llm_calls`
82
- - `gen_ai.usage.duration_ms`
83
- - `gen_ai.usage.input_tokens`
84
- - `gen_ai.usage.output_tokens`
85
- - `gen_ai.usage.total_tokens`
79
+ - `gen_ai.usage.input_tokens`, `gen_ai.usage.output_tokens`, `gen_ai.usage.total_tokens`
86
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`
87
84
 
88
- ## Debug Traces Without Jaeger UI
89
-
90
- If the Jaeger UI search page is slow or stuck, debug directly via APIs:
91
-
92
- ```bash
93
- # List services
94
- curl -sS http://localhost:16686/api/services
95
-
96
- # Find traces for a service
97
- curl -sS 'http://localhost:16686/api/traces?service=agentbyte-example&lookback=1h&limit=20'
98
-
99
- # Fetch a specific trace
100
- curl -sS http://localhost:16686/api/traces/<trace_id>
101
- ```
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).
102
87
 
103
88
  Practical interpretation:
104
89
 
@@ -195,5 +180,4 @@ MIT — see [LICENSE](LICENSE).
195
180
 
196
181
  - [Designing Multi-Agent Systems](https://github.com/victordibia/designing-multiagent-systems/tree/main)
197
182
  - [Microsoft Agent Framework](https://github.com/microsoft/agent-framework)
198
- - [Pydantic AI](https://ai.pydantic.dev/)
199
183
 
@@ -1,22 +1,22 @@
1
1
  <p align="center">
2
- <img src="https://gitlab.com/pyninja/aiengineering/agentbyte/-/raw/v0.2.7/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
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.7**
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
- ## What's New in 0.2.7
13
+ ## What's New in 0.3.0
14
14
 
15
- - `run_stream()` is now fully instrumented with an OTel root span every streaming task gets a correctly nested `agent <name>` root span identical to `run()`.
16
- - Root span is created via a native `_root_span()` context manager in `Agent`; `auto_instrument()` no longer monkey-patches `run` or `run_stream`.
17
- - New streaming example `examples/otel/agent_with_stream_telemetry.py` (service: `agentbyte-stream`).
18
- - New `examples/otel/inspect_traces.py` CLI utility inspect Jaeger traces by traceID without opening the UI.
19
- - All OTel instrumentation logic centralized in `otel.py`; `_annotate_root_span()` is now a module-level function.
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.
20
20
 
21
21
  See [CHANGELOG.md](CHANGELOG.md) for the complete release history.
22
22
 
@@ -37,37 +37,22 @@ Agentbyte exposes two complementary telemetry layers:
37
37
  - **Per-call middleware spans** (`chat ...`, `tool ...`) for model/tool-level diagnostics.
38
38
  - **Task-level root span attributes** (`agent ...`) for final aggregated usage and outcome.
39
39
 
40
- Enable root-level usage aggregation:
40
+ Enable telemetry:
41
41
 
42
42
  ```bash
43
43
  export AGENTBYTE_ENABLE_OTEL=true
44
- export AGENTBYTE_OTEL_CAPTURE_USAGE=true
45
44
  ```
46
45
 
47
- Then inspect attributes such as:
46
+ Per-call span attributes emitted by `OTelMiddleware`:
48
47
 
49
- - `gen_ai.agent.finish_reason`
50
- - `gen_ai.agent.llm_calls`
51
- - `gen_ai.usage.duration_ms`
52
- - `gen_ai.usage.input_tokens`
53
- - `gen_ai.usage.output_tokens`
54
- - `gen_ai.usage.total_tokens`
48
+ - `gen_ai.usage.input_tokens`, `gen_ai.usage.output_tokens`, `gen_ai.usage.total_tokens`
55
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`
56
53
 
57
- ## Debug Traces Without Jaeger UI
58
-
59
- If the Jaeger UI search page is slow or stuck, debug directly via APIs:
60
-
61
- ```bash
62
- # List services
63
- curl -sS http://localhost:16686/api/services
64
-
65
- # Find traces for a service
66
- curl -sS 'http://localhost:16686/api/traces?service=agentbyte-example&lookback=1h&limit=20'
67
-
68
- # Fetch a specific trace
69
- curl -sS http://localhost:16686/api/traces/<trace_id>
70
- ```
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).
71
56
 
72
57
  Practical interpretation:
73
58
 
@@ -164,5 +149,4 @@ MIT — see [LICENSE](LICENSE).
164
149
 
165
150
  - [Designing Multi-Agent Systems](https://github.com/victordibia/designing-multiagent-systems/tree/main)
166
151
  - [Microsoft Agent Framework](https://github.com/microsoft/agent-framework)
167
- - [Pydantic AI](https://ai.pydantic.dev/)
168
152
 
@@ -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.