Loading...
Loading...
Compare original and translation side by side
undefinedundefined
Verify:
```bash
llmem --help
llmem stats
验证:
```bash
llmem --help
llmem statsllmem init # Interactive — detects providers
llmem init --non-interactive # Script-friendly — uses defaults~/.config/llmem/config.yaml~/.config/llmem/memory.dbllmem init # 交互式模式——自动检测提供商
llmem init --non-interactive # 脚本友好模式——使用默认配置~/.config/llmem/config.yaml~/.config/llmem/memory.dbcurl -fsSL https://ollama.com/install.sh | sh
ollama pull nomic-embed-text
ollama pull qwen2.5:1.5bcurl -fsSL https://ollama.com/install.sh | sh
ollama pull nomic-embed-text
ollama pull qwen2.5:1.5b
**OpenAI (cloud, needs API key):**
```bash
export OPENAI_API_KEY=sk-...
llmem init --non-interactivepip install ".[local]"
**OpenAI(云端,需要API密钥):**
```bash
export OPENAI_API_KEY=sk-...
llmem init --non-interactivepip install ".[local]"
**None (FTS5-only mode):** Works without any provider. Semantic search disabled.
**无提供商(仅FTS5模式):** 无需任何提供商即可运行。语义搜索功能将被禁用。cd LLMem && npm installinstall.js~/.agents/skills/.opencode/tools/| Platform | Plugin file | Target |
|---|---|---|
| OpenCode | | |
| Claude Code | Entire | |
| Copilot CLI | Entire | |
node install.js --platform opencode # OpenCode only
node install.js --platform claude-code # Claude Code only
node install.js --platform copilot # Copilot CLI only
node install.js --platform all # All platforms
node install.js --platform none # Skills only, no pluginscd LLMem && npm installinstall.js~/.agents/skills/.opencode/tools/| 平台 | 插件文件 | 目标位置 |
|---|---|---|
| OpenCode | | |
| Claude Code | 整个 | |
| Copilot CLI | 整个 | |
node install.js --platform opencode # 仅OpenCode
node install.js --platform claude-code # 仅Claude Code
node install.js --platform copilot # 仅Copilot CLI
node install.js --platform all # 所有平台
node install.js --platform none # 仅安装Skill,不安装插件opencode.json{
"plugin": ["llmem"]
}~/.config/opencode/plugins/.opencode/tools/.opencode/tools/OPENCODE_CONFIG_DIRllmemundefinedopencode.json{
"plugin": ["llmem"]
}~/.config/opencode/plugins/.opencode/tools/.opencode/tools/OPENCODE_CONFIG_DIRllmemundefinedllmem search "topic"llmem add --type fact --content "..."undefinedllmem search "主题"llmem add --type fact --content "..."undefined~/.claude/plugins/llmem/claude plugin install ~/.claude/plugins/llmem~/.claude/plugins/llmem/claude plugin install ~/.claude/plugins/llmem
The plugin provides:
- **`SessionStart` hook**: Injects `llmem stats` + behavioral patterns + proposed procedures at session start
- **`SessionEnd` hook**: Runs `llmem hook ending` for memory extraction + introspection
- **`PreCompact` hook**: Injects key memories before compaction
- **Skills**: `llmem`, `llmem-setup`, `introspection`, `introspection-review-tracker` — loaded on-demand
**Instructions in CLAUDE.md — optional.** The `SessionStart` hook injects context. If you want a persistent reminder:
```markdown
插件提供以下功能:
- **`SessionStart`钩子**:在会话启动时注入`llmem stats` + 行为模式 + 建议流程
- **`SessionEnd`钩子**:运行`llmem hook ending`进行内存提取与自省
- **`PreCompact`钩子**:在压缩前注入关键记忆
- **Skill**:`llmem`、`llmem-setup`、`introspection`、`introspection-review-tracker`——按需加载
**CLAUDE.md中的指引——可选。** `SessionStart`钩子会注入上下文。若需要持久化提示:
```markdownllmem search "topic"llmem add --type fact --content "..."undefinedllmem search "主题"llmem add --type fact --content "..."undefined~/.copilot/installed-plugins/_direct/llmem/copilot plugin install ~/.copilot/installed-plugins/_direct/llmem~/.copilot/installed-plugins/_direct/llmem/copilot plugin install ~/.copilot/installed-plugins/_direct/llmem
Copilot CLI uses the same plugin format as Claude Code (`.claude-plugin/plugin.json`) but installs to `~/.copilot/` instead of `~/.claude/`. The hooks and skills are identical.
**Instructions in COPILOT.md — optional.** If you want a persistent reminder:
```markdown
Copilot CLI使用与Claude Code相同的插件格式(`.claude-plugin/plugin.json`),但安装到`~/.copilot/`而非`~/.claude/`。钩子和Skill完全相同。
**COPILOT.md中的指引——可选。** 若需要持久化提示:
```markdownllmem search "topic"llmem add --type fact --content "..."undefinedllmem search "主题"llmem add --type fact --content "..."undefinedundefinedundefinedundefinedundefinedundefinedundefined
Runs nightly at 3am by default. Configure in `~/.config/llmem/config.yaml` under `dream:`.
默认在每日凌晨3点运行。可在`~/.config/llmem/config.yaml`的`dream:`部分进行配置。Agent Session
│
├── Plugin (auto, no instructions needed)
│ ├── session.created/start → llmem stats + search behavioral/proposed → inject context
│ ├── session.idle/end → llmem hook idle/ending → extract + introspect
│ └── session.compacting → llmem context --compacting → preserve key memories
│
├── Skills (on-demand, loaded by trigger)
│ ├── llmem → CLI reference, memory types, commands
│ ├── llmem-setup → This file
│ ├── introspection → Self-assessment framework, error taxonomy
│ └── introspection-review-tracker → Review outcome tracking
│
└── Custom Tools (structural, zero-instruction)
├── llmem-search → Search memories
├── llmem-add → Add a memory
├── llmem-context → Get context for a topic
├── llmem-invalidate → Soft-delete a memory
├── llmem-stats → Show memory statistics
└── llmem-hook → Run extraction hookAgent Session
│
├── Plugin(自动运行,无需指令)
│ ├── session.created/start → llmem stats + 搜索行为/建议流程 → 注入上下文
│ ├── session.idle/end → llmem hook idle/ending → 提取记忆 + 自省
│ └── session.compacting → llmem context --compacting → 保留关键记忆
│
├── Skills(按需加载,触发时启动)
│ ├── llmem → CLI参考、记忆类型、命令
│ ├── llmem-setup → 本文件
│ ├── introspection → 自我评估框架、错误分类
│ └── introspection-review-tracker → 评审结果追踪
│
└── Custom Tools(结构化,零指令)
├── llmem-search → 搜索记忆
├── llmem-add → 添加记忆
├── llmem-context → 获取主题上下文
├── llmem-invalidate → 软删除记忆
├── llmem-stats → 显示记忆统计信息
└── llmem-hook → 运行提取钩子llmem: command not foundwhich llmemls ~/.local/bin/llmemln -s ~/.local/bin/llmem /usr/local/bin/llmemOllama not reachableollama serveollama pull nomic-embed-text~/.config/opencode/plugins/llmem.js~/.claude/plugins/llmem/ls ~/.agents/skills/llmem/node install.jsllmem statsllmem search behavioral --type self_assessment --limit 5llmem: command not foundwhich llmemls ~/.local/bin/llmemln -s ~/.local/bin/llmem /usr/local/bin/llmemOllama not reachableollama serveollama pull nomic-embed-text~/.config/opencode/plugins/llmem.js~/.claude/plugins/llmem/ls ~/.agents/skills/llmem/node install.jsllmem statsllmem search behavioral --type self_assessment --limit 5