Skip to main content

Add your description here

Project description

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

Architecture

Quick Start

Installation

Prerequisites:

  • Python 3.12 or higher
  • uv (recommended) or pip
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-phoenix via trace observability, auto-mcp via trajectory saving tools, or manual).
  • 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

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kaizen-1.0.3.tar.gz (52.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kaizen-1.0.3-py3-none-any.whl (65.0 kB view details)

Uploaded Python 3

File details

Details for the file kaizen-1.0.3.tar.gz.

File metadata

  • Download URL: kaizen-1.0.3.tar.gz
  • Upload date:
  • Size: 52.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for kaizen-1.0.3.tar.gz
Algorithm Hash digest
SHA256 081c601d1cd31a5cbb198a5180200e7290e7c86ada659fc9ae52e70b59fffa94
MD5 65203e05a591bc3e28013bf0fc3e9290
BLAKE2b-256 520e9220d96ebcec6d1441eb46161e4cf45348a5eea64d6098a1307b64348804

See more details on using hashes here.

Provenance

The following attestation bundles were made for kaizen-1.0.3.tar.gz:

Publisher: python-publish.yml on AgentToolkit/kaizen

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file kaizen-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: kaizen-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 65.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for kaizen-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8f63c20d9b0810d01f56a9fd854693df9841233a626dde923f4e7499b1bf05d0
MD5 4a45184d1f159181712c9d7b87e1f7f4
BLAKE2b-256 474dbd4bad7bfbb4914345f061261707811fbbfc475f0305afd7ba033955906a

See more details on using hashes here.

Provenance

The following attestation bundles were made for kaizen-1.0.3-py3-none-any.whl:

Publisher: python-publish.yml on AgentToolkit/kaizen

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page