songjongdevsecops/dsh-lembrar ↗★ 0
dsh-lembrar
DeepSeek Harness plugin: semantic recall of what you already said in earlier sessions of the same workspace, appended to the conversation and available as an on-demand tool. 适合需要Agent在对话中自动参考、召回同工作区历史记忆的用户。
インストール
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:songjongdevsecops/dsh-lembrarドキュメント
README 全文を読む ↗Configuration
Every path is configurable and the defaults derive from your home directory, so
nothing is tied to a specific machine. Override by environment variable, or by
the config of the lembrar line in your profile patch. A patch replaces the
whole config of the line, so restate every key you want to keep.
| Config key | Environment variable | Default | Meaning |
|---|---|---|---|
colecao | — | sessoes-bgem3-v1 | memsearch collection |
injetar | — | true | append memories to each turn via agent/pre-step |
maxTokens | — | 800 | token cap for the appended block (~4 characters per token) |
k | — | 8 | events returned by one search, before the token cut |
scoreMinimo | — | 0.55 | similarity floor; below it the hook stays silent |
buscarHabilitado | — | true | register the on-demand lembrar tool |
buscarTimeoutMs | — | 30000 | engine timeout per search |
exigirMesmoCwd | — | true | only sessions with the caller's exact cwd are authorized |
estadoDir | LEMBRAR_ESTADO_DIR | $XDG_STATE_HOME/dsh-lembrar/.estado, or ` | |
/.lembrar/.estadofor a locallink:` install | where the index marker lives | ||
banco | LEMBRAR_BANCO | ~/.dsh/storages/session-search.db | session database |
memsearch | LEMBRAR_MEMSEARCH | memsearch on PATH | search engine binary |
Profile patch example (~/.dsh/profiles/web/cordis.patch.yml):
- id: lembrar
config:
colecao: sessoes-bgem3-v1
estadoDir: '/home/you/.local/state/dsh-lembrar/.estado'
Usage
You do not call anything. On the first step of each turn the hook searches your current message against the index, keeps the hits above the floor, and appends a short block at the end of the message list. Appending (never rewriting an earlier message) is what preserves the prompt prefix cache: only the new suffix is paid for. When nothing matches, the decision comes back untouched and the turn costs zero extra tokens.
The agent can also search on demand with the lembrar tool:
lembrar { "consulta": "what did we decide about the backup schedule" }
Each hit returns session_id, seq and the excerpt. The lembrar-recall skill
describes the follow-up: open the original event with session_event_read when
the excerpt is not enough.