agentbyte 0.1.2__tar.gz → 0.2.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.
- {agentbyte-0.1.2 → agentbyte-0.2.0}/.github/copilot-instructions.md +31 -0
- agentbyte-0.2.0/CHANGELOG.md +30 -0
- agentbyte-0.2.0/PKG-INFO +137 -0
- agentbyte-0.2.0/README.md +113 -0
- agentbyte-0.2.0/docker/jaeger-compose.yml +11 -0
- agentbyte-0.2.0/docs/implementation_plan.md +435 -0
- agentbyte-0.2.0/docs/progress.md +270 -0
- agentbyte-0.2.0/docs/study/topic_agents.md +202 -0
- agentbyte-0.2.0/docs/study/topic_approval.md +189 -0
- agentbyte-0.2.0/docs/study/topic_memory.md +139 -0
- agentbyte-0.2.0/docs/study/topic_middleware.md +104 -0
- {agentbyte-0.1.2 → agentbyte-0.2.0}/docs/study/topic_model_client.md +15 -3
- agentbyte-0.2.0/docs/study/topic_otel.md +377 -0
- {agentbyte-0.1.2 → agentbyte-0.2.0}/docs/study/topic_tools.md +8 -0
- agentbyte-0.2.0/examples/azure_openai_usage_example.py +221 -0
- agentbyte-0.2.0/examples/memory/memory_usage_example.py +239 -0
- agentbyte-0.2.0/examples/otel/agent_with_content_capture.py +88 -0
- agentbyte-0.2.0/examples/otel/agent_with_telemetry.py +105 -0
- {agentbyte-0.1.2 → agentbyte-0.2.0}/notebooks/01-tools-example.ipynb +1 -1
- agentbyte-0.2.0/notebooks/02a-azure-openai-wrapper.ipynb +877 -0
- agentbyte-0.2.0/notebooks/02b-openai-wrapper.ipynb +526 -0
- agentbyte-0.2.0/notebooks/03a-simple-agent-no-tool.ipynb +393 -0
- agentbyte-0.2.0/notebooks/03b-agent-with-tool.ipynb +447 -0
- agentbyte-0.2.0/notebooks/03c-multi-turn-agent.ipynb +649 -0
- agentbyte-0.2.0/notebooks/03d-multi-tool-agent.ipynb +514 -0
- agentbyte-0.2.0/notebooks/03e-agent-with-context.ipynb +602 -0
- agentbyte-0.2.0/notebooks/03f-agent-with-middleware.ipynb +920 -0
- agentbyte-0.2.0/notebooks/03g-agent-with-memory.ipynb +524 -0
- agentbyte-0.2.0/notebooks/03h-agent-with-otel.ipynb +243 -0
- {agentbyte-0.1.2 → agentbyte-0.2.0}/notebooks/agent-knowledge-building.ipynb +1 -1
- {agentbyte-0.1.2 → agentbyte-0.2.0}/pyproject.toml +31 -0
- agentbyte-0.2.0/src/agentbyte/__about__.py +2 -0
- agentbyte-0.2.0/src/agentbyte/__init__.py +36 -0
- agentbyte-0.2.0/src/agentbyte/agents/__init__.py +57 -0
- agentbyte-0.2.0/src/agentbyte/agents/agent.py +577 -0
- agentbyte-0.2.0/src/agentbyte/agents/agent_as_tool.py +172 -0
- agentbyte-0.2.0/src/agentbyte/agents/base.py +228 -0
- agentbyte-0.2.0/src/agentbyte/agents/types.py +288 -0
- agentbyte-0.2.0/src/agentbyte/cancellation_token.py +75 -0
- agentbyte-0.2.0/src/agentbyte/context.py +257 -0
- {agentbyte-0.1.2 → agentbyte-0.2.0}/src/agentbyte/llm/azure_openai.py +157 -33
- {agentbyte-0.1.2 → agentbyte-0.2.0}/src/agentbyte/llm/base.py +48 -2
- {agentbyte-0.1.2 → agentbyte-0.2.0}/src/agentbyte/llm/openai.py +153 -33
- {agentbyte-0.1.2 → agentbyte-0.2.0}/src/agentbyte/llm/types.py +22 -1
- agentbyte-0.2.0/src/agentbyte/memory/__init__.py +26 -0
- agentbyte-0.2.0/src/agentbyte/memory/base.py +353 -0
- {agentbyte-0.1.2 → agentbyte-0.2.0}/src/agentbyte/messages.py +45 -5
- agentbyte-0.2.0/src/agentbyte/middleware/__init__.py +35 -0
- agentbyte-0.2.0/src/agentbyte/middleware/base.py +610 -0
- agentbyte-0.2.0/src/agentbyte/middleware/otel.py +535 -0
- {agentbyte-0.1.2 → agentbyte-0.2.0}/src/agentbyte/tools/__init__.py +3 -0
- agentbyte-0.2.0/src/agentbyte/tools/memory_tool.py +158 -0
- agentbyte-0.2.0/tests/agents/test_agent_as_tool.py +119 -0
- agentbyte-0.2.0/tests/agents/test_agent_basic.py +336 -0
- agentbyte-0.2.0/tests/agents/test_agent_event_types.py +97 -0
- agentbyte-0.2.0/tests/agents/test_agent_memory_integration.py +96 -0
- agentbyte-0.2.0/tests/agents/test_agent_middleware_integration.py +269 -0
- agentbyte-0.2.0/tests/agents/test_agent_stream_events.py +207 -0
- agentbyte-0.2.0/tests/agents/test_tool_approval.py +159 -0
- agentbyte-0.2.0/tests/llm/test_azure_client.py +181 -0
- agentbyte-0.2.0/tests/llm/test_llm_types.py +119 -0
- agentbyte-0.2.0/tests/llm/test_openai_client.py +219 -0
- agentbyte-0.2.0/tests/memory/test_memory.py +413 -0
- agentbyte-0.2.0/tests/middleware/test_middleware_chain.py +506 -0
- agentbyte-0.2.0/tests/middleware/test_otel.py +383 -0
- agentbyte-0.2.0/tests/test_cancellation_token.py +68 -0
- agentbyte-0.2.0/tests/test_context.py +113 -0
- agentbyte-0.1.2/tests/test_llm_types.py → agentbyte-0.2.0/tests/test_messages.py +46 -155
- agentbyte-0.2.0/tests/test_package_api.py +58 -0
- agentbyte-0.2.0/tests/test_types.py +52 -0
- agentbyte-0.2.0/tests/tools/test_memory_tool.py +109 -0
- {agentbyte-0.1.2/tests → agentbyte-0.2.0/tests/tools}/test_tools.py +42 -117
- {agentbyte-0.1.2 → agentbyte-0.2.0}/uv.lock +159 -3
- agentbyte-0.1.2/PKG-INFO +0 -155
- agentbyte-0.1.2/README.md +0 -145
- agentbyte-0.1.2/examples/pico-agent-test.py +0 -39
- agentbyte-0.1.2/examples/round-robin.py +0 -108
- agentbyte-0.1.2/notebooks/02-azure-open-ai-client-wrapper.ipynb +0 -311
- agentbyte-0.1.2/src/agentbyte/__about__.py +0 -2
- agentbyte-0.1.2/src/agentbyte/__init__.py +0 -18
- agentbyte-0.1.2/src/agentbyte/settings/__init__.py +0 -1
- agentbyte-0.1.2/src/agentbyte/settings/core.py +0 -123
- {agentbyte-0.1.2 → agentbyte-0.2.0}/.gitignore +0 -0
- {agentbyte-0.1.2 → agentbyte-0.2.0}/.gitlab-ci.yml +0 -0
- {agentbyte-0.1.2 → agentbyte-0.2.0}/.gitmodules +0 -0
- {agentbyte-0.1.2 → agentbyte-0.2.0}/.python-version +0 -0
- {agentbyte-0.1.2 → agentbyte-0.2.0}/docs/book-designing-multi-agent-system.md +0 -0
- {agentbyte-0.1.2 → agentbyte-0.2.0}/docs/study_plan.md +0 -0
- /agentbyte-0.1.2/examples/function-tool-example.py → /agentbyte-0.2.0/examples/function_tool_example.py +0 -0
- /agentbyte-0.1.2/examples/llm-client-dependency-injection.py → /agentbyte-0.2.0/examples/llm_client_dependency_injection.py +0 -0
- /agentbyte-0.1.2/examples/message-types-example.py → /agentbyte-0.2.0/examples/message_types_example.py +0 -0
- /agentbyte-0.1.2/examples/openai-client-example.py → /agentbyte-0.2.0/examples/openai_client_example.py +0 -0
- /agentbyte-0.1.2/notebooks/01-Authentication-and-Identity-of-AI-clients.ipynb → /agentbyte-0.2.0/notebooks/00-Authentication-and-Identity-of-AI-clients.ipynb +0 -0
- {agentbyte-0.1.2 → agentbyte-0.2.0}/notebooks/pico-init-agent-test.ipynb +0 -0
- {agentbyte-0.1.2 → agentbyte-0.2.0}/src/agentbyte/llm/__init__.py +0 -0
- {agentbyte-0.1.2 → agentbyte-0.2.0}/src/agentbyte/llm/auth.py +0 -0
- {agentbyte-0.1.2 → agentbyte-0.2.0}/src/agentbyte/tools/base.py +0 -0
- {agentbyte-0.1.2 → agentbyte-0.2.0}/src/agentbyte/tools/core_tools.py +0 -0
- {agentbyte-0.1.2 → agentbyte-0.2.0}/src/agentbyte/tools/decorator.py +0 -0
- {agentbyte-0.1.2 → agentbyte-0.2.0}/src/agentbyte/types.py +0 -0
|
@@ -14,6 +14,21 @@ The development approach is iterative and intentional: understand a pattern from
|
|
|
14
14
|
|
|
15
15
|
We will work **chapter-by-chapter** starting from **Chapter 4** in [docs/chapters](../docs/chapters/), studying each chapter, then **implementing the concepts ourselves** in Agentbyte. Chapters may be **skipped when not relevant** to the current implementation phase. Each chapter follows a **learn → implement → validate** loop, with examples used only as references (no direct copying). We will skip certain chapters and comeback to them later when relevant to the current implementation phase. The focus is on **deep understanding** and **intentional design**, not just code replication.
|
|
16
16
|
|
|
17
|
+
**Important: Book Chapters vs. Picoagents Codebase**
|
|
18
|
+
- **Book chapters** [docs/chapters](../docs/chapters/) provide **sequential building concepts** and high-level architecture explanations, but do NOT contain complete implementation code
|
|
19
|
+
- **Picoagents codebase** [external_lib/designing-multiagent-systems/picoagents/src/picoagents/](../external_lib/designing-multiagent-systems/picoagents/src/picoagents/) contains the **complete, production-ready implementation** of all concepts
|
|
20
|
+
- **Our workflow**:
|
|
21
|
+
1. Study the **concept** from book chapter (understand the "why" and architecture)
|
|
22
|
+
2. When ready to implement, **review the actual code** in picoagents codebase (understand the "how")
|
|
23
|
+
3. Implement in Agentbyte with our own design decisions and enhancements
|
|
24
|
+
4. Validate with tests and examples
|
|
25
|
+
|
|
26
|
+
### Chapter Lookup Rule (Mandatory)
|
|
27
|
+
|
|
28
|
+
- When the user mentions the book, a chapter number, or a section title, always read from `docs/chapters/chapter_<n>.md` first.
|
|
29
|
+
- If the user specifies a particular section/range (for example, "4.9.4" or line ranges), focus only on that specific subsection before broader chapter reading.
|
|
30
|
+
- Treat chapter files under `docs/chapters/` as the primary source for conceptual guidance; use picoagents source code afterward for implementation parity details.
|
|
31
|
+
|
|
17
32
|
- Study plan should be created for chapters in [study](../docs/study/)
|
|
18
33
|
- When implementing tools (Chapter 4.6.4), follow the step-by-step guide in [docs/study/topic_tools.md](../docs/study/topic_tools.md). Use its file creation steps, class responsibilities, and parity checklist as the execution plan.
|
|
19
34
|
|
|
@@ -381,6 +396,16 @@ src/agentbyte/
|
|
|
381
396
|
- Hides dependency issues that should be architectural problems
|
|
382
397
|
- Requires runtime model rebuilding as workaround
|
|
383
398
|
|
|
399
|
+
❌ **Don't**: Create mutual concrete imports between collaborating modules
|
|
400
|
+
- Example risk: `agents/base.py` importing `agents/agent_as_tool.py` while `agent_as_tool.py` imports `BaseAgent`
|
|
401
|
+
- This creates fragile import-order coupling and can regress as modules grow
|
|
402
|
+
|
|
403
|
+
✅ **Do**: Break cycles with protocol/contract boundaries
|
|
404
|
+
- Prefer structural interfaces (`Protocol`) for collaborator typing instead of importing concrete classes
|
|
405
|
+
- Keep adapters/wrappers (like Agent-as-Tool) dependent on minimal runtime contracts (`name`, `description`, `run`, `run_stream`)
|
|
406
|
+
- Use local/lazy imports only as a secondary tactic, not as the primary architecture
|
|
407
|
+
- If a cycle appears, refactor shared abstractions into a neutral module or protocol contract first
|
|
408
|
+
|
|
384
409
|
❌ **Don't**: Create `tools/types.py` for single `ToolResult`
|
|
385
410
|
- Too granular; root `types.py` is appropriate for framework fundamentals
|
|
386
411
|
- `ToolResult` is as fundamental as Message types
|
|
@@ -487,6 +512,12 @@ src/agentbyte/
|
|
|
487
512
|
- Use settings classes for all configuration management, never hard-code values
|
|
488
513
|
- Our code is uv to have a packaged applciation which means we do not need to import from src but from agentbyte directly. For example, in our notebooks we should import from agentbyte like `from agentbyte.tools import FunctionTool` instead of `from src.agentbyte.tools import FunctionTool`
|
|
489
514
|
- Notebook already has a async main thread so do not use `asyncio.run()` in the notebooks, just call the async function directly like `await test_example1()`
|
|
515
|
+
- **Pydantic v2 config standard (mandatory):**
|
|
516
|
+
- ✅ Use `model_config = ConfigDict(...)` for model configuration
|
|
517
|
+
- ❌ Do NOT use inner `class Config` in `BaseModel` subclasses (deprecated in Pydantic v2, removed in v3)
|
|
518
|
+
- Example:
|
|
519
|
+
- ✅ `from pydantic import BaseModel, ConfigDict`
|
|
520
|
+
- ✅ `class MyModel(BaseModel): model_config = ConfigDict(frozen=True)`
|
|
490
521
|
- **Run ruff check after creating any code** to ensure code quality:
|
|
491
522
|
- Check for unused imports: `uv run ruff check <file_or_dir> --select F401`
|
|
492
523
|
- Run full checks: `uv run ruff check <file_or_dir>`
|
|
@@ -0,0 +1,30 @@
|
|
|
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.2.0] - 2026-02-27
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
- Memory serialization parity (`ListMemoryConfig`, `FileMemoryConfig`, `_to_config`, `_from_config`).
|
|
11
|
+
- Agent-managed memory tooling via `MemoryTool` and `MemoryBackend`.
|
|
12
|
+
- Middleware-driven memory access routing (`operation="memory_access"`).
|
|
13
|
+
- `ApprovalMiddleware` for centralized tool-approval policy.
|
|
14
|
+
- OpenTelemetry middleware and auto-instrumentation support.
|
|
15
|
+
- Notebook examples for middleware patterns and real-client logging middleware.
|
|
16
|
+
- New/expanded tests for middleware, memory, package API, and OTel integration.
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
- Middleware execution and event pipeline now support richer parity behavior with request/response/error fan-out semantics.
|
|
20
|
+
- Agent run paths now integrate improved middleware handling and instrumentation.
|
|
21
|
+
- Package API now exposes `Agent` at package root and supports opt-in auto-instrumentation via environment variable.
|
|
22
|
+
|
|
23
|
+
### Fixed
|
|
24
|
+
- Token usage mapping alignment in telemetry paths (`tokens_input`, `tokens_output`).
|
|
25
|
+
- Auto-instrumentation idempotency for repeated setup calls.
|
|
26
|
+
|
|
27
|
+
## [0.1.2] - 2026-02-25
|
|
28
|
+
|
|
29
|
+
### Added
|
|
30
|
+
- Initial middleware and memory completion pass (streaming middleware baseline, approval pause integration, memory tooling foundations).
|
agentbyte-0.2.0/PKG-INFO
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: agentbyte
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: A toolkit for designing multiagent systems
|
|
5
|
+
Author-email: MrDataPsycho <mr.data.psycho@gmail.com>
|
|
6
|
+
Requires-Python: >=3.12
|
|
7
|
+
Requires-Dist: pydantic>=2.12.5
|
|
8
|
+
Provides-Extra: all
|
|
9
|
+
Requires-Dist: azure-identity>=1.25.1; extra == 'all'
|
|
10
|
+
Requires-Dist: openai>=1.107.1; extra == 'all'
|
|
11
|
+
Requires-Dist: opentelemetry-api>=1.39.1; extra == 'all'
|
|
12
|
+
Requires-Dist: opentelemetry-exporter-otlp-proto-http>=1.39.1; extra == 'all'
|
|
13
|
+
Requires-Dist: opentelemetry-sdk>=1.39.1; extra == 'all'
|
|
14
|
+
Provides-Extra: azureopenai
|
|
15
|
+
Requires-Dist: azure-identity>=1.25.1; extra == 'azureopenai'
|
|
16
|
+
Requires-Dist: openai>=1.107.1; extra == 'azureopenai'
|
|
17
|
+
Provides-Extra: openai
|
|
18
|
+
Requires-Dist: openai>=1.107.1; extra == 'openai'
|
|
19
|
+
Provides-Extra: otel
|
|
20
|
+
Requires-Dist: opentelemetry-api>=1.39.1; extra == 'otel'
|
|
21
|
+
Requires-Dist: opentelemetry-exporter-otlp-proto-http>=1.39.1; extra == 'otel'
|
|
22
|
+
Requires-Dist: opentelemetry-sdk>=1.39.1; extra == 'otel'
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
|
|
25
|
+
# Agentbyte
|
|
26
|
+
|
|
27
|
+
Agentbyte is a Python toolkit for building and studying multiagent systems with a learning-first, implementation-oriented workflow.
|
|
28
|
+
|
|
29
|
+
Current release: **0.2.0**
|
|
30
|
+
|
|
31
|
+
## What’s New in 0.2.0
|
|
32
|
+
|
|
33
|
+
- Memory parity upgrades (`ListMemory`/`FileMemory` serialization config support).
|
|
34
|
+
- Agent-managed memory tooling (`MemoryTool`, sandboxed `MemoryBackend`).
|
|
35
|
+
- Middleware parity improvements (`ApprovalMiddleware`, `memory_access` routing).
|
|
36
|
+
- OpenTelemetry middleware + opt-in auto-instrumentation support.
|
|
37
|
+
- New notebook coverage for real-client middleware workflows.
|
|
38
|
+
|
|
39
|
+
See [CHANGELOG.md](CHANGELOG.md) for the complete release history.
|
|
40
|
+
|
|
41
|
+
## Current Capabilities
|
|
42
|
+
|
|
43
|
+
- Agent execution loop with `run()` and `run_stream()` APIs.
|
|
44
|
+
- Tooling system (function tools + core tools + memory tool).
|
|
45
|
+
- Middleware chain for request/response/error handling.
|
|
46
|
+
- Built-in middleware: logging, security, rate limiting, approval, telemetry.
|
|
47
|
+
- Memory abstractions: list memory, file memory, context injection.
|
|
48
|
+
- OpenAI and Azure OpenAI model client support.
|
|
49
|
+
|
|
50
|
+
## Installation
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
uv sync --all-groups
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Optional extras:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
uv sync --extra openai
|
|
60
|
+
uv sync --extra azureopenai
|
|
61
|
+
uv sync --extra otel
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Install in another project (pip / uv add)
|
|
65
|
+
|
|
66
|
+
Use extras to enable provider + telemetry support:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
pip install "agentbyte[azureopenai,otel]"
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
uv add "agentbyte[azureopenai,otel]"
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Install all optional features:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
pip install "agentbyte[all]"
|
|
80
|
+
# or
|
|
81
|
+
uv add "agentbyte[all]"
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Note: the Azure extra is `azureopenai`.
|
|
85
|
+
|
|
86
|
+
## Quick Start
|
|
87
|
+
|
|
88
|
+
```python
|
|
89
|
+
from agentbyte.agents import Agent
|
|
90
|
+
from agentbyte.middleware import LoggingMiddleware
|
|
91
|
+
|
|
92
|
+
# model_client = OpenAIChatCompletionClient(...) or AzureOpenAIChatCompletionClient(...)
|
|
93
|
+
|
|
94
|
+
def quick_faq_lookup(topic: str) -> str:
|
|
95
|
+
faq = {
|
|
96
|
+
"middleware": "Middleware handles cross-cutting runtime concerns.",
|
|
97
|
+
"memory": "Memory helps agents keep useful context across interactions.",
|
|
98
|
+
}
|
|
99
|
+
return faq.get(topic.lower(), "No FAQ found.")
|
|
100
|
+
|
|
101
|
+
agent = Agent(
|
|
102
|
+
name="helpful-assistant",
|
|
103
|
+
description="Helpful assistant with middleware",
|
|
104
|
+
instructions="Answer clearly and use tools when needed.",
|
|
105
|
+
model_client=model_client,
|
|
106
|
+
tools=[quick_faq_lookup],
|
|
107
|
+
middlewares=[LoggingMiddleware()],
|
|
108
|
+
)
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## Project Layout
|
|
112
|
+
|
|
113
|
+
```
|
|
114
|
+
src/agentbyte/
|
|
115
|
+
agents/
|
|
116
|
+
llm/
|
|
117
|
+
memory/
|
|
118
|
+
middleware/
|
|
119
|
+
tools/
|
|
120
|
+
messages.py
|
|
121
|
+
context.py
|
|
122
|
+
types.py
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## Development
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
uv run ruff check src tests
|
|
129
|
+
uv run pytest tests -v
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
## References
|
|
133
|
+
|
|
134
|
+
- [Designing Multi-Agent Systems](https://github.com/victordibia/designing-multiagent-systems/tree/main)
|
|
135
|
+
- [Microsoft Agent Framework](https://github.com/microsoft/agent-framework)
|
|
136
|
+
- [Pydantic AI](https://ai.pydantic.dev/)
|
|
137
|
+
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# Agentbyte
|
|
2
|
+
|
|
3
|
+
Agentbyte is a Python toolkit for building and studying multiagent systems with a learning-first, implementation-oriented workflow.
|
|
4
|
+
|
|
5
|
+
Current release: **0.2.0**
|
|
6
|
+
|
|
7
|
+
## What’s New in 0.2.0
|
|
8
|
+
|
|
9
|
+
- Memory parity upgrades (`ListMemory`/`FileMemory` serialization config support).
|
|
10
|
+
- Agent-managed memory tooling (`MemoryTool`, sandboxed `MemoryBackend`).
|
|
11
|
+
- Middleware parity improvements (`ApprovalMiddleware`, `memory_access` routing).
|
|
12
|
+
- OpenTelemetry middleware + opt-in auto-instrumentation support.
|
|
13
|
+
- New notebook coverage for real-client middleware workflows.
|
|
14
|
+
|
|
15
|
+
See [CHANGELOG.md](CHANGELOG.md) for the complete release history.
|
|
16
|
+
|
|
17
|
+
## Current Capabilities
|
|
18
|
+
|
|
19
|
+
- Agent execution loop with `run()` and `run_stream()` APIs.
|
|
20
|
+
- Tooling system (function tools + core tools + memory tool).
|
|
21
|
+
- Middleware chain for request/response/error handling.
|
|
22
|
+
- Built-in middleware: logging, security, rate limiting, approval, telemetry.
|
|
23
|
+
- Memory abstractions: list memory, file memory, context injection.
|
|
24
|
+
- OpenAI and Azure OpenAI model client support.
|
|
25
|
+
|
|
26
|
+
## Installation
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
uv sync --all-groups
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Optional extras:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
uv sync --extra openai
|
|
36
|
+
uv sync --extra azureopenai
|
|
37
|
+
uv sync --extra otel
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Install in another project (pip / uv add)
|
|
41
|
+
|
|
42
|
+
Use extras to enable provider + telemetry support:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
pip install "agentbyte[azureopenai,otel]"
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
uv add "agentbyte[azureopenai,otel]"
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Install all optional features:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
pip install "agentbyte[all]"
|
|
56
|
+
# or
|
|
57
|
+
uv add "agentbyte[all]"
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Note: the Azure extra is `azureopenai`.
|
|
61
|
+
|
|
62
|
+
## Quick Start
|
|
63
|
+
|
|
64
|
+
```python
|
|
65
|
+
from agentbyte.agents import Agent
|
|
66
|
+
from agentbyte.middleware import LoggingMiddleware
|
|
67
|
+
|
|
68
|
+
# model_client = OpenAIChatCompletionClient(...) or AzureOpenAIChatCompletionClient(...)
|
|
69
|
+
|
|
70
|
+
def quick_faq_lookup(topic: str) -> str:
|
|
71
|
+
faq = {
|
|
72
|
+
"middleware": "Middleware handles cross-cutting runtime concerns.",
|
|
73
|
+
"memory": "Memory helps agents keep useful context across interactions.",
|
|
74
|
+
}
|
|
75
|
+
return faq.get(topic.lower(), "No FAQ found.")
|
|
76
|
+
|
|
77
|
+
agent = Agent(
|
|
78
|
+
name="helpful-assistant",
|
|
79
|
+
description="Helpful assistant with middleware",
|
|
80
|
+
instructions="Answer clearly and use tools when needed.",
|
|
81
|
+
model_client=model_client,
|
|
82
|
+
tools=[quick_faq_lookup],
|
|
83
|
+
middlewares=[LoggingMiddleware()],
|
|
84
|
+
)
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Project Layout
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
src/agentbyte/
|
|
91
|
+
agents/
|
|
92
|
+
llm/
|
|
93
|
+
memory/
|
|
94
|
+
middleware/
|
|
95
|
+
tools/
|
|
96
|
+
messages.py
|
|
97
|
+
context.py
|
|
98
|
+
types.py
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## Development
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
uv run ruff check src tests
|
|
105
|
+
uv run pytest tests -v
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## References
|
|
109
|
+
|
|
110
|
+
- [Designing Multi-Agent Systems](https://github.com/victordibia/designing-multiagent-systems/tree/main)
|
|
111
|
+
- [Microsoft Agent Framework](https://github.com/microsoft/agent-framework)
|
|
112
|
+
- [Pydantic AI](https://ai.pydantic.dev/)
|
|
113
|
+
|