__ __ _ _ ____ _ _
| \/ | __ _| |_ _ __(_)_ _| _ \| |_ _ __ _(_)_ __
| |\/| |/ _` | __| '__| \ \/ / |_) | | | | |/ _` | | '_ \
| | | | (_| | |_| | | |> <| __/| | |_| | (_| | | | | |
|_| |_|\__,_|\__|_| |_/_/\_\_| |_|\__,_|\__, |_|_| |_|
|___/
Matrix-Plugin-memory — TeamAgent marketplace
Claude Code marketplace + a single working plugin (
teamagent-memory) that captures user corrections into SQLite, blocks repeats via fast-path + semantic (e5-small) + BM25 matching, with effective-Wilson-confidence four-tier interception. Override classification differentiates "rule wrong" from "context-specific" — so good rules survive false alarms.
| Path | Purpose |
|---|---|
plugins/teamagent-memory/ |
The plugin (v0.2.0) |
docs/DESIGN.md |
Full design — 740 lines, M1-M5.a scope |
docs/adr/ |
13 architecture decision records |
docs/plans/ |
M1 / M2 / M3 / M4 implementation plans (TDD task lists) |
docs/notes/ |
M1 / M2 / M3 / M4 / M5.a smoke results |
CHANGELOG.md |
Version history |
.claude-plugin/marketplace.json |
Marketplace manifest |
/plugin marketplace add libz-renlab-ai/Matrix-Plugin-memory
/plugin install teamagent-memory@matrix-plugin-memory
For local development, see INSTALL.md.
session 1 stored session 2
--------- ------ ---------
Alice: npm install moment
user: "use dayjs instead"
|
v Stop hook (4-stage)
analyze → claude -p extract → calibrate → compile
|
v
knowledge.db / global.db
|
v PreToolUse hook
Bob: npm install moment
→ BLOCKED (canonical+, 0.93)
reason: rule-...-moment-dayjs
Three layers of matching:
- Fast-path (regex / literal) — 0ms, highest priority for code-pattern rules
- Semantic (
multilingual-e5-smallONNX) — for paraphrased natural-language matches - BM25-lite — fallback for very short queries
Four-tier interception based on score = sim × effectiveWilson(rule):
| Tier | score | hook output |
|---|---|---|
| block | ≥ 0.85 | deny |
| warn | 0.65–0.85 | deny with retry hint |
| suggest | 0.45–0.65 | ask with alternative |
| passive | 0.25–0.45 | reminder on next prompt |
If a user bypasses a deny/warn, PostToolUse detects it; the next
UserPromptSubmit asks "rule wrong, context-specific, or skip?" and routes
to demote / save exception / no-op accordingly.
Test Files 24 passed (24)
Tests 128 passed (128)
Benchmark 1000 rules: p50=4ms p95=12ms (vs 200ms target)
MIT. See LICENSE.