SuperAPIAI Directory

skillmem

github.com · AI agents

Self-improving skill memory for coding agents: useful skills are reinforced, unused ones fade; local English/Russian hybrid search, tamper-evident history.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)
PlatformsmacOS · Linux

About this tool

skillmem provides a local, persistent skill and memory layer for Claude Code and Codex CLI. Its core idea is: after each non-trivial task, the agent can record how it was completed as a skill; before the next task, recall relevant skills; skills that continue to prove useful are strengthened, while those no one uses decay—similar to human memory. Both writes and reads are zero-cost, do not call an LLM, do not depend on the cloud, require no API key, and use only SQLite on disk.

Main capabilities:

  • Bilingual hybrid retrieval, fully local: FTS5 BM25 + Snowball stemming (English/Russian) matches inflected forms within the same language; a multilingual ONNX embedding model enables Russian queries to find English skills, and cross-language work requires installing the semantic extension. Everything runs offline on CPU.
  • Ebbinghaus strength model: strength rises only based on evidence beyond the agent's own judgment, falls after failure, and decays on a schedule when unused; invalidated skills are swept into a backup archive (never deleted). Naturally rare rules can be pinned via mem_pin to prevent decay.
  • Provenance and trust: each memory records its source (owner / agent / imported / derived), and only the owner can approve it as a rule via skillmem trust <slug>. Unapproved content (imported packages, transcript summaries citing web pages, rules persuaded into being saved) is injected into marked blocks declaring it to be data rather than instructions. The agent cannot change memories written or approved by the owner, and can only write proposals under a new slug.
  • Tamper-evident history: every edit is appended to a SHA256 hash chain; skillmem verify can detect after-the-fact tampering.
  • Deep Claude Code integration: hooks for five events + 9 MCP tools, installed with one command.
  • One memory, multiple agents: Claude Code and Codex share the same database, each record carries the writing agent (from the MCP handshake), and authorship is readable when learning side by side.
  • Cross-platform: macOS (launchd), Windows (schtasks), Linux (systemd user timer, cron fallback).
  • No vendor lock-in: export-all exports everything as plain markdown with YAML frontmatter; re-importing yields the same records. One target per databaserecords, the exporter prunes its own stale files via the manifest and refuses a directory exported by another database to avoid overwriting its backup.

Usage:

  • Install: pip install skillmem (Windows PowerShell or install from checkout).
  • Initialize: skillmem init --claude-code registers the MCP server in ~/.claude.json and registers hooks in ~/.claude/settings.json (idempotent, with backup). --hooks minimal means no hooks (only the owner command's deny rule), --hooks none means MCP only.
  • Codex: append the [mcp_servers.skillmem] table to ~/.codex/config.toml, and set SKILLMEM_AGENT=codex. Files are append-only, not rewritten; invalid TOML is rejected rather than overwritten.
  • Plugins: the repository is also a plugin, in two forms (Agent Plugins and Claude Code), both pointing to the same skillmem-mcp binary. The plugin requires the skillmem Python package to be in PATH and replaces the wiring of skillmem init --claude-code—choose one of the two.
  • Claude Desktop: the MCP server can also be used in the Claude Desktop chat app; add it to claude_desktop_config.json to get all 9 mem_* tools (search, learn, recall, reinforce, etc.). Automatic hooks (auto-recall on every prompt, session summary) are a Claude Code mechanism and do not run in the chat app.
  • Workflow: learn (call mem_learn after a task to record the slug, trigger, steps, result, lesson); recall (before the next task, mem_recall or the automatic hook fuses lexical and semantic signals via Reciprocal Rank Fusion to present the most relevant skill); reinforce (when a recalled skill is confirmed by evidence beyond the agent's own judgment, mem_reinforce raises its strength; an agent's self-report of usefulness is recorded but not rewarded; if the task fails after applying the skill, its strength is lowered); decay (scheduled skillmem decay runs Ebbinghaus-style forgetting in the application, skills untouched for months drift to stale, then are archived, excluded from recall, and can be restored with a single command, first snapshotting to JSONL).
  • Third-party skill packs: packs such as ponytail, unlazy, addyosmani/agent-skills that provide SKILL.md files can be imported into the same database. After import they live by ordinary rules: recalled on match, reinforced only when external confirmation shows they help, and faded out if never useful. Content in the pack is not executed, only SKILL.md files are read; the repository, commit, and license travel with each skill into the provenance block, and every import is marked untrusted-origin.

Use cases:

  • Want a coding agent to accumulate reusable skills across sessions and avoid repeating mistakes.
  • Need a local, cloud-free, API-key-free memory solution.
  • Need to distinguish owner rules from agent-generated content and track provenance.
  • Need a tamper-resistant audit history.
  • Multiple agents share memory while preserving authorship attribution.

Limitations:

  • Retrieval quality is measured on the LongMemEval full oracle set: hit@5 0.871 / MRR 0.622, hybrid retrieval, k=5, CPU-only, reproducible. Median 0.76 seconds per query (laptop CPU), no LLM calls, no network.
  • Hooks are all best-effort: a corrupted database or missing model will not block Claude Code. skillmem hooks-status shows runs, skips, failures, and the last line.
  • Owner commands (trust, rm, skills-archive, skills-restore, skills rm, import-vault, uninstall --purge-db) require a terminal; an agent calling them from Bash gets an error rather than approval. The MCP and HTTP servers never count as owner. The TTY check is an accident guard rather than a wall; init --claude-code also adds deny rules to permissions.deny, but they are command-line glob matching, not a wall.
  • The plugin path has no deny rules for owner commands, only the TTY check.
  • Unapproved content is injected in marked blocks, but marked blocks do not guarantee the model ignores instructions in the data; the guarantee comes from the reader having no tools (the summarizer runs with no tools).
  • Config edits are atomic and come withtimestamped backups; corrupted JSON or TOML never overwrites.
  • docs/INVARIANTS.md is the test specification: sixteen invariants, checked by tests/properties/. See CHANGELOG for known issues.
  • License Apache-2.0. Built by Liza Studio.
Up/Down to navigate · Enter to open · ESC to closeBrowse all tools