Kaizen
Self-improving agents through iterations.
Kaizen is a system designed to help agents improve over time by learning from their trajectories. It uses a combination of an MCP server for tool integration, vector storage for memory, and LLM-based conflict resolution to refine its knowledge base.
Features
- MCP Server: Exposes tools to get guidelines and save trajectories.
- Conflict Resolution: Intelligently merges new insights with existing guidelines using LLMs.
- Trajectory Analysis: Automatically analyzes agent trajectories to generate tips and best practices.
- Milvus Integration: Uses Milvus (or Milvus Lite) for efficient vector storage and retrieval.
Architecture
Quick Start
Installation
Prerequisites:
- Python 3.12 or higher
uv(recommended) orpip
git clone <repository_url>
cd kaizen
uv sync && source .venv/bin/activate
Configuration
For direct OpenAI usage:
export OPENAI_API_KEY=sk-...
For LiteLLM proxy usage and model selection (including global fallback via KAIZEN_MODEL_NAME), see CONFIGURATION.md.
Running the MCP Server
uv run fastmcp run kaizen/frontend/mcp/mcp_server.py --transport sse --port 8201
Verify it's running:
npx @modelcontextprotocol/inspector@latest http://127.0.0.1:8201/sse --cli --method tools/list
Available tools:
get_entities(task: str, entity_type: str): Get relevant entities for a specific task, filtered by type (e.g., 'guideline', 'policy').get_guidelines(task: str): Get relevant guidelines for a specific task (backward compatibility alias).save_trajectory(trajectory_data: str, task_id: str | None): Save a conversation trajectory and generate new tips.create_entity(content: str, entity_type: str, metadata: str | None, enable_conflict_resolution: bool): Create a single entity in the namespace.delete_entity(entity_id: str): Delete a specific entity by its ID.
Tip Provenance
Kaizen automatically tracks the origin of every guideline it generates or stores. Every tip entity contains metadata identifying its source:
creation_mode: Identifies how the tip was created (auto-phoenixvia trace observability,auto-mcpvia trajectory saving tools, ormanual).source_task_id: The ID of the original trace or task that inspired the tip, providing full audibility.
See the Low-Code Tracing Guide for more details.
Documentation
- KAIZEN_LITE.md - Lightweight mode via Claude Code plugin (no infra required)
- CONFIGURATION.md - Detailed configuration options
- POLICIES.md - Policy support and schema
- CLI.md - Command-line interface documentation
- CLAUDE_CODE_DEMO.md - Claude Code demo walkthrough
Development
Running Tests
uv run pytest
Phoenix Sync Tests
Tests for the Phoenix trajectory sync functionality are skipped by default since they require familiarity with the Phoenix integration. To include them:
# Run all tests including Phoenix tests
uv run pytest --run-phoenix
# Run only Phoenix tests
uv run pytest -m phoenix
End-to-End (E2E) Low-Code Verification
To run the full end-to-end verification pipeline (Agent -> Trace -> Tip):
KAIZEN_E2E=true uv run pytest tests/e2e/test_e2e_pipeline.py -s
See docs/LOW_CODE_TRACING.md for more details.
Release files for kaizen 1.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| kaizen-1.0.5.tar.gz | 52.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| kaizen-1.0.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 117.1 kB
Release files / kaizen-1.0.5.tar.gz
| Download URL | kaizen-1.0.5.tar.gz |
|---|---|
| Size | 52.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cc9f88feedd2382fff73f0ab9460258789610d2507138a60812d30d08e68fa21
|
|
BLAKE2b-256 checksum How to use checksums |
d7687ded90c8793eaf5670a4dfaf087c23a5ad52febdbb1cd725a0424cceecd9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 12, 2026.
Transparency logRelease files / kaizen-1.0.5-py3-none-any.whl
| Download URL | kaizen-1.0.5-py3-none-any.whl |
|---|---|
| Size | 65.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b76383810c26b8b42a7b3a087180776edcb3fcb603186b2b8b1a30df16ee8d4f
|
|
BLAKE2b-256 checksum How to use checksums |
c3c1329af9787de82296e42fb77623d61a412e171e62c182a5efb63b44c3c39e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 12, 2026.
Transparency log