Agent Skills › elstongun/leviathan › leviathan-memory

leviathan-memory

GitHub

提供跨会话长期记忆能力,用于记录用户偏好、项目决策及经验教训。支持在会话开始时回忆上下文,或在行动中查询特定信息;同时允许持久化存储新学到的关键事实,确保后续会话能复用这些知识,提升协作效率与上下文连贯性。

skills/leviathan-memory/SKILL.md elstongun/leviathan

触发场景

会话开始时回顾用户或项目背景 行动前查询特定人员、项目或服务的当前状态 用户要求记住偏好、决策或纠正事实 学习需跨会话保留的持久性知识

安装

npx skills add elstongun/leviathan --skill leviathan-memory -g -y
更多选项

不安装直接使用

npx skills use elstongun/leviathan@leviathan-memory

指定 Agent (Claude Code)

npx skills add elstongun/leviathan --skill leviathan-memory -a claude-code -g -y

安装 repo 全部 skill

npx skills add elstongun/leviathan --all -g -y

预览 repo 内 skill

npx skills add elstongun/leviathan --list

SKILL.md

Frontmatter
{
    "name": "leviathan-memory",
    "description": "Long-term memory across sessions with the Leviathan memory store. Use at the start of a session to recall what is known about the user, the project and past decisions; before acting on anything you may have learned before (preferences, conventions, owners, deploy steps, past failures); and whenever you learn something durable that a later session should know, or the user says \"remember\", \"from now on\", \"I prefer\", \"we decided\", or corrects an earlier fact."
}

Leviathan memory: remember once, recall in a few tokens

The leviathan memory CLI is a small database of claims, one per row. A recall returns only what fits a token budget, current values first, so it stays cheap however much has been remembered. If the recall and remember MCP tools are available, use them instead; they take the same arguments.

Start of a session

leviathan memory recall                     # the briefing: pinned and important memories across subjects

Before acting

leviathan memory recall <words as the user said them>
leviathan memory recall -s <subject>        # everything current about a person, project or service
leviathan memory recall --kind decision,lesson deploy

An empty answer means not remembered, not untrue. Try other words or a subject, or ask the user.

Remember

leviathan memory remember "Prefers pnpm over npm" --kind preference -s sam -k package_manager
leviathan memory remember "Deploys go through staging first, after the March outage" --kind decision -s deploys -k path -i 4
leviathan memory remember "The flaky auth test fails when run before the cache warms" --kind lesson -s auth-tests
  • One claim per call, in one sentence, in words a later question would use.
  • Anything that can change gets a subject (-s) and a key (-k). Writing the same subject and key again replaces the old value; that is how corrections work. Don't write a second, contradicting memory without the key.
  • Decisions carry their reason. Lessons say what to do differently.
  • Remember durable things: preferences, conventions, decisions, owners, environments, recurring failures. Not the conversation, not things the code or git history already shows, not one-off details of the current task.
  • --importance 5 or --pin only for what every session must know.
  • Never store secrets. They are refused (exit 2). Remember where a secret lives, not its value.

The reply says whether the memory was new, merged with a restatement, or replaced an older value, and lists related memories. If a related one is now wrong, forget it or overwrite its key.

Correct and forget

leviathan memory forget <id> --reason "moved to yarn"
leviathan memory forget -s sam -k package_manager
leviathan memory history -s sam -k package_manager    # every value the slot has had
leviathan memory recall --as-of 2025-06 deploy          # what was true then

Store

The default store is ~/.leviathan/memory.db; --memory=PATH or LEVIATHAN_MEMORY picks another, and --ns separates projects. Add --json for structured output. Exit codes: 0 ok, 1 error, 2 refused or bad request.

版本历史

  • 2156369 当前 2026-11-02 09:05

    将示例中的用户名从 josh 更新为更中性的名称,以改善测试和示例的通用性。

  • f1070fe 2026-10-18 15:26

同 Skill 集合

skills/leviathan/SKILL.md

元信息

文件数
0
版本
2156369
Hash
3192a3e0
收录时间
2026-10-18 15:26

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-11-03 18:45
浙ICP备14020137号-1