Reusable ADK-based agent infrastructure — plugin loader, background workflow engine, FastAPI server, memory service.
Project description
kaze-agent-base
Reusable ADK-based agent infrastructure — plugin loader, background workflow engine, FastAPI server, memory service, LLM wrapper with trace propagation.
Extracted from kaze-agent-ops so other agents can be built on the same framework.
Install
pip install kaze-agent-base
# Optional extras:
pip install "kaze-agent-base[memory]" # Mem0 + pgvector
pip install "kaze-agent-base[tracing]" # Langfuse callbacks
Build your own agent
Your agent package owns:
plugin.yaml+tools.pyfiles undermy_agent/plugins/<name>/config.yamllisting models and specialists- A package
__init__.pythat builds the workflow - An entrypoint script that calls
create_app(...)
Directory layout
my_agent/
pyproject.toml # depends on kaze-agent-base
config.yaml # model tiers, specialists
my_agent/
__init__.py # builds workflow, exposes _workflow_*
serve.py # calls create_app(...)
plugins/
root/plugin.yaml + prompt.md
<specialist>/plugin.yaml + tools.py [+ workflows/]
my_agent/__init__.py
from pathlib import Path
from kaze.agent_base.workflow.graph import build_workflow
_PKG_ROOT = Path(__file__).parent
_workflow, _agents = build_workflow(
config_path=_PKG_ROOT.parent / "config.yaml",
plugins_root=_PKG_ROOT / "plugins",
plugins_package="my_agent.plugins",
workflow_name="my_agent",
workflow_description="My agent — short tagline",
)
_workflow_agents = _agents
_workflow_config = _workflow._kaze_config
_workflow_mcp_toolsets = _workflow._kaze_mcp_toolsets
root_agent = _workflow
__all__ = ["root_agent"]
my_agent/serve.py
from pathlib import Path
from kaze.agent_base import create_app
from kaze.agent_base.server import run
def main():
app, host, port = create_app(
app_module="my_agent",
agents_dir=Path(__file__).resolve().parents[1],
title="My Agent API",
description="…",
version="0.1.0",
)
run(app, host, port)
if __name__ == "__main__":
main()
Wire up a [project.scripts] entry (e.g., my-agent-serve = "my_agent.serve:main")
and you have a deployable agent.
Environment variables
| Var | Purpose | Default |
|---|---|---|
KAZE_GATEWAY_URL / _API_KEY |
LLM gateway endpoint | http://localhost:4200 |
KAZE_CONFIG_PATH |
Path to config.yaml |
./config.yaml |
KAZE_PLUGINS_ROOT / KAZE_PLUGINS_PACKAGE |
Plugin location | (required; pass args or env) |
KAZE_APP_NAME |
ADK app name | kaze_app |
KAZE_DATA_DIR |
SQLite location | .adk/ |
KAZE_A2A_HOST / KAZE_A2A_PORT |
Server bind | 0.0.0.0:8080 |
KAZE_MEM0_* |
Mem0 config (see state/memory.py) |
— |
LANGFUSE_* |
Tracing (optional) | — |
AGENT_API_KEY |
Bearer token for /api/v1/* |
— |
The KAZE_ prefix is historical; downstream agents can use the same prefix
or layer on their own env vars.
Public API
from kaze.agent_base import (
acompletion, # LLM call with trace linkage
set_trace_id,
reset_trace_id,
ToolAgent, # ADK BaseAgent that runs a tool in a thread
get_engine, # background WorkflowEngine singleton
spill, # persist large outputs to disk
discover_plugins,
get_workflow_templates,
get_tool_registry,
resolve_tools,
create_app, # FastAPI factory
)
Layout
src/kaze/agent_base/
config.py load_config(path)
models.py LiteLlm factory (gateway-routed)
llm.py acompletion + trace propagation
plugin.py discover_plugins(plugins_root, plugins_package)
tool_registry.py framework:* + <plugin>:* namespaces
tools/ background, memory, notify, system, code, bash, fs, artifacts
jobs/ engine, store, tool_agent (background workflows)
state/ memory (mem0), config_store, sessions, services
server/ app (create_app, run), routes, schemas
workflow/ graph, agents, callbacks, mcp
License
Apache-2.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kaze_agent_base-0.1.0.tar.gz.
File metadata
- Download URL: kaze_agent_base-0.1.0.tar.gz
- Upload date:
- Size: 46.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
90e55d0abc3d1336f612d1db2b8d10c8a8aad66d23ff69826c65262881c338f8
|
|
| MD5 |
a699c5ccc35b80d4c10116ef1bc9621c
|
|
| BLAKE2b-256 |
6c9c9b91acbae6612f33e0de1c107dd253661e579de409e18de13827aef4a336
|
Provenance
The following attestation bundles were made for kaze_agent_base-0.1.0.tar.gz:
Publisher:
publish.yml on speedrun-labs/kaze-agent-base
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kaze_agent_base-0.1.0.tar.gz -
Subject digest:
90e55d0abc3d1336f612d1db2b8d10c8a8aad66d23ff69826c65262881c338f8 - Sigstore transparency entry: 1338934803
- Sigstore integration time:
-
Permalink:
speedrun-labs/kaze-agent-base@d95b70074ba06d2d0c2abf763929c316e7835068 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/speedrun-labs
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
self-hosted -
Publication workflow:
publish.yml@d95b70074ba06d2d0c2abf763929c316e7835068 -
Trigger Event:
push
-
Statement type:
File details
Details for the file kaze_agent_base-0.1.0-py3-none-any.whl.
File metadata
- Download URL: kaze_agent_base-0.1.0-py3-none-any.whl
- Upload date:
- Size: 51.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7e05d10108d2467dbe3fff7a2151317ea708092a1cf6a9b13713303628436875
|
|
| MD5 |
a3edc0affde2b355afd68d3d6256cd40
|
|
| BLAKE2b-256 |
07765e80ac995e65f25ff42ef59efdbc0c2db53ead234613473facbcc5d850bb
|
Provenance
The following attestation bundles were made for kaze_agent_base-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on speedrun-labs/kaze-agent-base
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kaze_agent_base-0.1.0-py3-none-any.whl -
Subject digest:
7e05d10108d2467dbe3fff7a2151317ea708092a1cf6a9b13713303628436875 - Sigstore transparency entry: 1338934807
- Sigstore integration time:
-
Permalink:
speedrun-labs/kaze-agent-base@d95b70074ba06d2d0c2abf763929c316e7835068 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/speedrun-labs
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
self-hosted -
Publication workflow:
publish.yml@d95b70074ba06d2d0c2abf763929c316e7835068 -
Trigger Event:
push
-
Statement type: