OpenViking
volcengine
Self-evolving Context Database for AI Agents. Unify Agent Memory, Knowledge RAG and Skills.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:KLRSL/dsh-biomemory
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
A cross-session memory plugin for DeepSeek Harness (DSH), designed like a human brain: layered memory, graded approval, memory metabolism, fully transparent and editable.
~/.dsh/memory, overridable via the DSH_MEMORY_ROOT env var) — human-readable, edit-and-take-effectmemory tool: add / query / remove / list / pin / unpin / dream / auditaudit.log (legacy, compatible) + structured audit.jsonl (JSON Lines) — every event traceable/memory command: list / query / add / remove / pin / unpin / dream / auditmemory_recall tool: cross-session recall ("do you remember…" scenarios)/memory dream): half-life decay, reference consolidation, conflict arbitration, low-weight archiving — with automatic backup & rollback# As a local bundle in a DSH profile
dsh plugin add dsh-biomemory
# Or pnpm local link
pnpm add link:./dsh-biomemory
Add dsh-biomemory to dsh.profile.bundles in the profile.
~/.dsh/memory/
├── preferences.md # User/project preferences (top priority, frozen-injected)
├── hot/
│ ├── knowledge.md # L1 recent knowledge (facts/decisions)
│ └── behavior.md # L1 recent behavior (lessons/habits/workflows)
├── projects/<name>/ # L2 project archives
├── longterm/ # L3 long-term memory
├── archive/ # Memories archived by metabolism (decayed below threshold, never deleted)
├── backups/ # Automatic backups before dream runs (rollback source)
├── audit.log # Human-readable audit (legacy, kept for compatibility)
└── audit.jsonl # Structured audit (JSON Lines, v0.3)
Each entry is a single line: - [knowledge|auto] [fp:xxx] [w:10] [h:3] [t:2026-08-16 13:00] [pin] text
w = weight (default 10) — decay/consolidation baseh = reference count — consolidation inputt = write time — decay age sourcepin = locked (excluded from decay, always injected)/memory dream (or memory action=dream) manually triggers memory metabolism — the housekeeping a sleeping brain does:
w × 0.5^(age/halfLife)), floored at 1.consolidateThreshold (default 3) times gain +1 weight, capped at weightCap (default 20).CONFLICT audit event is recorded.decayThreshold (default 3) move to archive/ — moved, never deleted.Usage:
/memory dream # run metabolism
/memory dream --dry-run # preview only, no changes
memory action=dream dryRun=true # same via the memory tool
Dry-run example output:
【预览】扫描 120 条:衰减 12 · 巩固 3 · 冲突 0 · 归档 4
备份:(dry-run 不执行备份)
Backup & rollback: before an actual run, the whole memory store is automatically copied to backups/<timestamp>/ (including audit.jsonl). On startup, the self-check restores the latest backup automatically if a primary memory file is found corrupted. Rollbacks are recorded as ROLLBACK audit events.
Lock a memory so it never participates in decay and always enters the snapshot:
/memory pin <fp> # lock
/memory unpin <fp> # unlock
memory action=pin fp="xxx"
memory action=unpin fp="xxx"
Snapshot injection priority: pinned > preferences > knowledge > behavior.
Two audit channels:
audit.log — human-readable one-line summaries, backward compatibleaudit.jsonl — structured, one JSON object per lineEvents: WRITE, DECAY, CONSOLIDATE, CONFLICT, ARCHIVE, PIN, UNPIN, PREVIEW (dry-run), ROLLBACK.
Example line:
{"t":"2026-08-16T05:00:00.000Z","event":"DECAY","fp":"abc123","text":"..."}
Query:
/memory audit # recent events
/memory audit --since 7d # last 7 days
/memory audit --type DECAY # only DECAY events
memory action=audit type="DECAY" sinceDays=7
Keyword matching runs first; when hits are insufficient, results are supplemented with a pure-JS TF-IDF + cosine implementation — no native modules, no external dependencies, fully offline. Semantic hits are marked as "semantic" in query output.
// Plugin config (bundle or profile layer)
{
halfLifeDays: 7, // half-life in days for decay
decayThreshold: 3, // weight below this → archived
consolidateThreshold: 3, // references ≥ this → consolidate (+1 weight)
weightCap: 20, // consolidation weight cap (prevents runaway growth)
hotTokenLimit: 5000, // snapshot hot-section token budget
maxQueryResults: 20, // query result cap
petEndpoint: null // optional: local notification service URL (off by default)
}
@deepseek-ai/dsh-* 0.1.0-rc.5 runtime (implemented against actual lib sources)@deepseek-ai/dsh-* 0.1.0-rc.5 — check the version of the runtime you actually run.DSH_MEMORY_ROOT is set, it must point to an existing, writable directory.projects/<name>/, consolidating (weight grows) as topics are referenced repeatedly.npm test before submitting.npm test (node:test). New behavior should ship with test coverage.MIT
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: agent-memory、approval、audit、long-term-memory、markdown、memory、memory-plugin、persistent-memory。