Skip to content

feat: v3.1.0 — self-improving memory#12

Merged
kevintseng merged 14 commits intomainfrom
develop
Apr 17, 2026
Merged

feat: v3.1.0 — self-improving memory#12
kevintseng merged 14 commits intomainfrom
develop

Conversation

@kevintseng
Copy link
Copy Markdown
Contributor

Summary

  • Self-improving memory: LLM-powered failure analysis automatically creates structured lesson_learned entities from session errors, with proactive warnings at session start
  • learn tool: 7th MCP tool for explicit lesson recording across all 3 transports (MCP, HTTP, CLI)
  • Security fix: mask API key in capabilities response, deep-merge LLM config to preserve apiKey on partial updates
  • 348 tests across 20 test files, all passing

New modules

  • src/core/failure-analyzer.ts — LLM-powered root cause analysis
  • src/core/lesson-engine.ts — Structured lesson CRUD with upsert dedup

Enhanced hooks

  • Stop hook: auto-triggers failure analysis after sessions with errors (Level 1)
  • Session-start hook: proactive warnings from known lesson_learned entities

Test plan

  • 348 tests passing (vitest, forks pool)
  • tsc --noEmit clean
  • npm run build clean
  • Cross-transport schema consistency verified (MCP/HTTP/CLI)
  • Comprehensive code review (Claude) — all dims pass
  • Codex review (gpt-5.4) — 3 P1 issues found and fixed
  • API key masking verified in /v1/config response

Add localized README files for zh-TW, zh-CN, ja, ko, pt, fr, de, vi,
es, and th. Update main README.md with language selector at the top of
each file linking all versions together.
Adds a locale system (en, zh-TW, zh-CN, ja, ko, pt, fr, de, vi, es, th)
to the Preact dashboard. Browser language is auto-detected on first load;
selection persists to localStorage. A language selector is added to the
Settings tab. All UI strings across Header, TabNav, SearchTab, BrowseTab,
AnalyticsTab, and SettingsTab are replaced with t() calls.
Rewrote all translated READMEs to match the new English README structure:
- Added "The Problem" emotional opening section
- Added "Get Started in 60 Seconds" 3-step flow
- Added "Who Is This For?" table
- Added "Works With Everything" 3-column layout
- Replaced old comparison table with focused Mem0/Zep comparison
- Added "What Happens Automatically" hooks table
- Added "Smart Features" section with emoji bullets
- Added "Unlock Smart Mode" tiered table
- Updated "All 6 Memory Tools" table format
- Updated Contributing section to match English
- Updated license footer to match English
- CI: add dashboard build step (cd dashboard && npm ci && npx vite build)
- Smoke test: verify 27 required files (was 10) — core, transports, hooks, skills, dashboard
- Installation test: verify plugin version match, skills exist, bin entries, dashboard build
- Installation test: use execFileSync instead of execSync (security)
- Publish workflow: add dashboard build before npm publish
- 294 tests (was 289)
Introduces analyzeFailure() which deduplicates session errors (max 5),
calls the configured LLM provider, and returns a StructuredLesson with
error/rootCause/fix/prevention/errorPattern/fixPattern/severity.
Exports parseLesson() for direct unit testing; always returns null on
any failure path rather than throwing.
Creates createLesson/createExplicitLesson/findProjectLessons with
lesson-{project}-{errorPattern} naming for upsert dedup. Uses pre-call
recall check for reliable isNew detection (RememberResult.observations
is always the input count, not total stored). 12 tests, all passing.
Query lesson_learned entities tagged to the current project and append
prevention hints to the session context, so Claude sees known pitfalls
at session start before making the same mistakes.
Adds learn() to core operations (wraps createExplicitLesson from lesson-engine),
LearnInput/LearnResult types, and learn tool across all 3 transports (MCP, HTTP, CLI).
Includes 17 new tests covering core, MCP handler, and HTTP transport layers.
When LLM is configured (Level 1), the Stop hook now analyzes session
errors via failure-analyzer and creates structured lesson_learned
entities via lesson-engine. Falls back gracefully to rule-based
extraction when no LLM is available.

Adds 8 tests for session-summary hook covering: entity creation,
bugfix tagging, skip guards, dedup, heavy sessions, and Level 0
fallback.
…ive warnings

- Add failure-analyzer.ts and lesson-engine.ts to ARCHITECTURE.md
- Add learn tool (7th MCP tool) to API_REFERENCE.md
- Bump version to 3.1.0 in package.json and plugin.json
- Add failure-analyzer.js and lesson-engine.js to smoke test required files
schema-export.ts was missing the learn tool definition,
causing memesh export-schema to omit it from the output.
…LM config

- GET /v1/config: detectCapabilities() returned raw API key in
  capabilities.llm.apiKey — now masked before response
- POST /v1/config: updateConfig() shallow-merged top-level only,
  causing partial LLM updates to drop saved apiKey — now deep-merges
  the llm object to preserve existing fields

Found by Codex (gpt-5.4) code review.
@kevintseng kevintseng merged commit b5538a8 into main Apr 17, 2026
13 checks passed
Comment thread src/transports/cli/cli.ts Dismissed
@@ -1,5 +1,5 @@
import { describe, it, expect } from 'vitest';
import { recencyScore, frequencyScore, temporalValidityScore, scoreEntity, rankEntities, DEFAULT_WEIGHTS } from '../../src/core/scoring.js';
import { recencyScore, frequencyScore, temporalValidityScore, scoreEntity, rankEntities } from '../../src/core/scoring.js';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants