OpenViking
volcengine
Self-evolving Context Database for AI Agents. Unify Agent Memory, Knowledge RAG and Skills.
lesliechowsh/dsh-memo
Memo — session memory search for DeepSeek Harness agents (memo_search / memo_remember / memo_stats on the official sessionQuery service). Every benchmark number is the shipped product's own, with the experiment trail published.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:lesliechowsh/dsh-memo
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
Your agent remembers everything you've done together — one plugin command, nothing else to run.
You: "Did we ever discuss Dieter Rams?" Agent calls
memo_search("Dieter Rams")→
{
"sessions": [
{
"sessionId": "session-49924467-9cd1-414a-9998-f207782c72ad",
"title": "Weniger theme design",
"snippet": "…'DESIGN DIETER RAMS' is a registered trademark, and the Rams Foundation actively manages the name and estate…",
"time": 1787078839061,
"mode": "phrase"
}
],
"notes": [],
"limit": 10
}
Agent: "Yes — we researched it in the Weniger theme project: 'DESIGN DIETER RAMS' is a registered trademark, so the product was renamed Weniger…"
dsh plugin --profile web add dsh-memo@latest
Restart dsh web — the three memo_* tools appear in your agent's tool list. That's the whole setup. (Uninstall: dsh plugin --profile web remove dsh-memo; manual profile-edit steps for CLI-less deployments are in CONTRIBUTING.md.)
sessionQuery backend.Memo deliberately does not re-index your history into its own store. If you need cross-app memory outside DSH with embedding-based search, projects like Mem0 or Letta are built for that.
memo_search(query, limit?, sessionId?, since?, tags?)Search every past session in the workspace plus your memo notes. limit defaults to 10 (cap 50); sessionId restricts to one session; since filters by epoch-ms; tags filters notes by tag. Returns { sessions, notes, limit }:
sessions: { sessionId, title (null when untitled), snippet, time, mode } — ordered phrase-first, then by weighted token/pair score; mode is "phrase" (verbatim question hit) or "terms".notes: most recent matches, newest last.error string instead of fabricated hits. Chinese queries get run-level recall (contiguous Han runs as weighted phrases) plus a cjkWarning describing the remaining limit — see Requirements.memo_remember(text, tags?)Write one durable note — facts, decisions, preferences that survive across sessions and appear in memo_search results. Returns { ok, note, path }; identical text returns the existing note as { ok: true, duplicate: true, note } instead of appending. Notes are one JSONL record per line at $DSH_HOME/memo/notes.jsonl.
memo_stats()Corpus overview, no parameters: { sessions: 19, recent: […], notes: 4 }.
memo_search(query)
1. phrase step whole query as one FTS5 phrase → top 10 sessions
2. weighted step ≤8 tokens (content words + CJK runs) +
merged by df-proxy IDF weights (term idf×4,
pair length × max idf; df estimated per query
with capped-50 counts, length fallback),
time-desc tiebreak — content words fill the
window first, stopwords only leftovers
3. phrase first, then weighted, dedup, top 10
── official sessionQuery (FTS5) ──
DSH session corpus (live + persisted events) + notes.jsonl
Memo re-indexes nothing: DSH's sessionQuery service is the single source of truth. A search costs up to 26 backend calls (8 extra for the df estimates, 3 for the multi-snippet evidence below).
After installing, ask your agent these three things in one conversation. Each one needs memory of the previous exchange, so each exercises the search:
memo_search finds the note)You just experienced the whole product: write, recall, write, recall — no setup beyond the install, no external service involved.
The agent reaches for memo_search by itself when the answer depends on history ("Did we ever discuss SSH-based coding agents?"). Filter when you know the neighborhood: memo_search(query: "benchmark", since: 1787000000000). Write distilled facts with memo_remember(text: …, tags: "naming,convention"), find them later with memo_search(query: "naming", tags: "convention"). Every session hit carries a snippet (the best-matching event); the top 3 hits also carry events — up to 3 matching events each — so the agent can read the actual passage instead of a one-line match.
Memo maps onto the memory taxonomy of Memory for Large Language Models (Zhoubian, Zhang, Kharlamov & Tang — THUNLP · Tsinghua / NUS): explicit representation (independently addressable JSONL), online updates (DSH appends as it happens), long-term persistence.
Measured under the exact pipeline memo_search ships — reproduced in harnesses over the same FTS5 engine class the backend uses. Full protocol, environment, and the variant-selection experiment log: bench/.
LongMemEval-S (arXiv:2410.10813, 500 questions, 54-session haystacks per question):
hit@1 78.2% · hit@5 92.4% · hit@10 97.4% · MRR 0.847
| Question type | n | hit@1 | hit@5 | MRR |
|---|---|---|---|---|
| multi-session | 133 | 78.2% | 96.2% | 0.863 |
| temporal-reasoning | 133 | 75.9% | 90.2% | 0.821 |
| knowledge-update | 78 | 96.2% | 98.7% | 0.972 |
| single-session-user | 70 | 88.6% | 97.1% | 0.933 |
| single-session-assistant | 56 | 64.3% | 87.5% | 0.745 |
| single-session-preference | 30 | 43.3% | 66.7% | 0.556 |
LoCoMo10 (1986 questions, cross-dataset check): hit@1 60.2% · hit@5 87.2% · MRR 0.718 — read hit@1 there, not hit@10 (see below).
LongMemEval-M (500 new questions, ~500-session pools — the scale / anti-overfitting check):
hit@1 54.6% · hit@5 78.6% · hit@10 83.8% · MRR 0.645 (random hit@1 on this pool ≈ 0.2% → ≈ 273× random)
The S → M drop (hit@1 78.2% → 54.6%) tracks the ~10× larger pool; the per-type rank order was verified identical across S and M under the 0.6.0 pipeline (the same pipeline structure 0.8.0 extends). The 0.8.0 weighting was selected on S and confirmed positive on ALL five 100-question M segments (measured segment by segment, not once after the fact).
LongMemEval-CN cross-lingual (Chinese questions over the original English haystacks): hit@1 44.6% (up from 33.6% before the 0.7.0 CJK tokenization — CJK runs unblock the weighted step for mixed queries, so single untranslated Latin tokens are now actually queried). Every gain still comes from those Latin tokens: pure-Chinese queries over English sessions cannot match, and the gap is translation, not tokenization. A Chinese-session evaluation corpus does not exist publicly yet.
Scope — read these numbers for what they are:
I started Memo because I kept getting burned by memory tools whose benchmark numbers I couldn't reproduce. So this project runs on one rule: publish only what the shipped product measures, and publish the trail that produced it.
If you find a number here that doesn't reproduce, that is the highest-value bug report this project can receive — please open an issue.
sessionQuery service (shipped in the standard web profile); the deployment's session-query index must be open — memo_search reports a closed index honestly instead of guessing.memo_search says so via cjkWarning (details in bench/).$DSH_HOME resolvable at tool-execution time. No other services, no API keys, no network calls.bench/zh.cjs, self-built, NOT a benchmark)MIT — see LICENSE.
project: dsh-memo
domain: agent memory / session retrieval
audience: DSH (DeepSeek Harness) users who want their agent to remember
interfaces: three model tools — memo_search / memo_remember / memo_stats
runtime: DSH host plugin (Node), no extra services, no vector DB
storage: the official DSH session corpus + one plain JSONL notes file
status: beta — no breaking API changes inside the 0.x line; see CHANGELOG
support: GitHub Issues CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: agent-memory、memory。