Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
710f68d
Fact extraction support
gaodan-fang Feb 19, 2026
0f827b8
Change to enable settings from outside
gaodan-fang Feb 20, 2026
9a478b3
Refactor
gaodan-fang Feb 24, 2026
89cc296
Merge remote-tracking branch 'origin/main' into cuga-compatiable
gaodan-fang Feb 24, 2026
3c70e38
Refactor
gaodan-fang Feb 24, 2026
cbb385b
Fix tests
gaodan-fang Feb 25, 2026
c8a12d6
Fix more tests
gaodan-fang Feb 25, 2026
04c934d
feat(config): support LiteLLM proxy env mapping and document model pr…
gaodan-fang Feb 25, 2026
75c358f
Merge remote-tracking branch 'origin/main' into cuga-compatiable
gaodan-fang Feb 25, 2026
8bb116a
docs: move LiteLLM proxy details to configuration guide
gaodan-fang Feb 25, 2026
94bc6ce
Fix mypy return type in default model name
gaodan-fang Feb 25, 2026
63ebdbe
Harden Kaizen memory and fact extraction config flows
gaodan-fang Feb 25, 2026
f0ecfbe
Update README to use KAIZEN_MODEL_NAME wording
gaodan-fang Feb 25, 2026
5ea27d2
Change baseline for secret detection
gaodan-fang Feb 26, 2026
7b1f2bc
fix: harden milvus filters and fact extraction input handling
gaodan-fang Feb 26, 2026
2717ac3
fix: narrow created_at type handling for mypy
gaodan-fang Feb 26, 2026
4588078
test: assert ensure_namespace is exercised in memory store flow
gaodan-fang Feb 26, 2026
c6dba7c
Trigger tests as there's no error when running locally
gaodan-fang Feb 26, 2026
c2efefd
Merge remote-tracking branch 'origin/main' into cuga-compatiable
gaodan-fang Feb 27, 2026
a9dca52
Rename user memory APIs to user facts
gaodan-fang Feb 27, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .secrets.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"files": "^.secrets.baseline$",
"lines": null
},
"generated_at": "2026-02-24T16:20:06Z",
"generated_at": "2026-02-26T16:00:29Z",
"plugins_used": [
{
"name": "AWSKeyDetector"
Expand Down Expand Up @@ -87,7 +87,7 @@
"verified_result": null
},
{
"hashed_secret": "1ed5b7962b3d8356ccb9f4ccbbb0f17e5fc39724",
"hashed_secret": "11fa7c37d697f30e6aee828b4426a10f83ab2380",
"is_secret": false,
"is_verified": false,
"line_number": 18,
Expand Down
32 changes: 21 additions & 11 deletions CONFIGURATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,28 @@ export OPENAI_API_KEY=sk-...

### Custom LLM Configuration

Kaizen uses [LiteLLM](https://docs.litellm.ai/) and supports using a LiteLLM proxy server for centralized LLM access:
Kaizen uses [LiteLLM](https://docs.litellm.ai/) and supports OpenAI-compatible proxy endpoints (including LiteLLM) via standard OpenAI environment variables:

```bash
# LiteLLM Proxy Configuration
LITELLM_PROXY_API_KEY="your-proxy-token"
LITELLM_PROXY_API_BASE="https://your-litellm-proxy.com"
# OpenAI-compatible endpoint configuration (works with LiteLLM)
export OPENAI_API_KEY="your-api-key"
export OPENAI_BASE_URL="https://your-litellm-proxy.com/v1"

# Kaizen Model Configuration
KAIZEN_TIPS_MODEL="your-model-name"
KAIZEN_CONFLICT_RESOLUTION_MODEL="your-model-name"
KAIZEN_CUSTOM_LLM_PROVIDER="your-custom-llm-provider"
export KAIZEN_TIPS_MODEL="openai/gpt-4o-mini"
export KAIZEN_CONFLICT_RESOLUTION_MODEL="openai/gpt-4o-mini"
export KAIZEN_FACT_EXTRACTION_MODEL="openai/gpt-4o-mini"
export KAIZEN_MODEL_NAME="openai/gpt-4o-mini"
export KAIZEN_CUSTOM_LLM_PROVIDER="openai"
```

Model selection precedence:
1. Task-specific models: `KAIZEN_TIPS_MODEL`, `KAIZEN_CONFLICT_RESOLUTION_MODEL`, `KAIZEN_FACT_EXTRACTION_MODEL`
2. Global Kaizen fallback: `KAIZEN_MODEL_NAME`
3. Built-in default: `gpt-4o`

If `KAIZEN_*_MODEL` are unset, set `KAIZEN_MODEL_NAME` to control all Kaizen LLM calls.

## Environment Variables

All configuration variables are prefixed with `KAIZEN_`.
Comment thread
gaodan-fang marked this conversation as resolved.
Expand All @@ -34,9 +43,11 @@ All configuration variables are prefixed with `KAIZEN_`.
|----------|-------------------------------------------------------------------------------|------------------------------------------|
| `KAIZEN_BACKEND` | Backend provider (`milvus` or `filesystem`) | `milvus` |
| `KAIZEN_NAMESPACE_ID` | Namespace ID for isolation | `kaizen` |
| `KAIZEN_TIPS_MODEL` | Model for generating tips (e.g. `openai/gpt-4o` for proxy with custom models) | `gpt-4o` |
| `KAIZEN_CONFLICT_RESOLUTION_MODEL` | Model for resolving conflicts (e.g. `openai/gpt-4o` for proxy with custom models) | `gpt-4o` |
| `KAIZEN_CUSTOM_LLM_PROVIDER` | LiteLLM provider (use `openai` for proxy with custom models) | `None` |
| `KAIZEN_TIPS_MODEL` | Model for tip generation only | `KAIZEN_MODEL_NAME` -> `gpt-4o` |
| `KAIZEN_CONFLICT_RESOLUTION_MODEL` | Model for conflict resolution only | `KAIZEN_MODEL_NAME` -> `gpt-4o` |
| `KAIZEN_FACT_EXTRACTION_MODEL` | Model for fact extraction only | `KAIZEN_MODEL_NAME` -> `gpt-4o` |
| `KAIZEN_MODEL_NAME` | Global fallback model for all Kaizen LLM calls | `gpt-4o` |
| `KAIZEN_CUSTOM_LLM_PROVIDER` | LiteLLM provider (use `openai` for OpenAI-compatible endpoints) | `None` |
| `KAIZEN_EMBEDDING_MODEL` | Embedding model | `sentence-transformers/all-MiniLM-L6-v2` |

### Milvus Backend Settings
Expand Down Expand Up @@ -146,4 +157,3 @@ except ImportError:
| `KAIZEN_TRACING_ENDPOINT` | Phoenix collector endpoint | `http://localhost:6006/v1/traces` |

> **Note**: Auto-patching skips if existing tracing is detected. Use `enable_tracing(force=True)` to override.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ uv sync && source .venv/bin/activate

### Configuration

Set your OpenAI API key:
For direct OpenAI usage:
```bash
export OPENAI_API_KEY=sk-...
```

For detailed configuration options (custom LLM providers, backends, etc.), see [CONFIGURATION.md](CONFIGURATION.md).
For LiteLLM proxy usage and model selection (including global fallback via `KAIZEN_MODEL_NAME`), see [CONFIGURATION.md](CONFIGURATION.md).

### Running the MCP Server

Expand Down
12 changes: 8 additions & 4 deletions kaizen/backend/filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,14 @@ def _search_entities_internal(
for ent in entities:
match = True
for key, value in filters.items():
# Check top-level field first, then metadata
ent_value = ent.get(key)
if ent_value is None and ent.get("metadata"):
ent_value = ent["metadata"].get(key)
if key.startswith("metadata."):
metadata_key = key.split(".", 1)[1]
ent_value = (ent.get("metadata") or {}).get(metadata_key)
else:
# Check top-level field first, then metadata
ent_value = ent.get(key)
if ent_value is None and ent.get("metadata"):
ent_value = ent["metadata"].get(key)
if ent_value != value:
match = False
break
Expand Down
Loading