How mengxinsu/dsh-viya-memory works
viya-memory is a DeepSeek Harness plugin that provides seven model-facing tools for managing Markdown memory cards in a user-owned Obsidian vault. The main workflow is to save cards, search and read them, then update or link them; forgetting and stats provide lifecycle and maintenance operations. The plugin also injects the hand-written user.md into the system prompt. The repository is a single-file runtime, so the component paths below share lib/index.js. Some internal wiring is documented in the README but not visible in the sampled excerpts.
Main entry points: index.js Tool registration
Components 17
Host integration
- Plugin apply
lib/index.js - Tool registration
lib/index.js - Prompt injection
lib/index.js
Memory tools
- Save cards
lib/index.js - Search cards
lib/index.js - Read cards
lib/index.js - Update cards
lib/index.js - Link cards
lib/index.js - Forget cards
lib/index.js - Vault stats
lib/index.js
Card handling
- Markdown cards
lib/index.js - Path and content checks
lib/index.js - Image handling
lib/index.js
Vault data
- Obsidian vault
- Trash and assets
- user.md
Other components
- Model / user
Connections 29
- Plugin apply → Tool registration: registers tools
- Model / user → Tool registration: invokes tools
- Plugin apply → Prompt injection: injects prompt
- Prompt injection → user.md: reads
- Tool registration → Save cards: dispatches
- Tool registration → Search cards: dispatches
- Tool registration → Read cards: dispatches
- Tool registration → Update cards: dispatches
- Tool registration → Link cards: dispatches
- Tool registration → Forget cards: dispatches
- Tool registration → Vault stats: dispatches
- Save cards → Path and content checks: validates
- Update cards → Path and content checks: validates
- Link cards → Path and content checks: validates
- Forget cards → Path and content checks: validates
- Save cards → Image handling: moves images
- Save cards → Obsidian vault: writes cards
- Search cards → Obsidian vault: scans cards
- Read cards → Obsidian vault: reads cards
- Update cards → Obsidian vault: updates cards
- Link cards → Obsidian vault: writes both cards
- Forget cards → Obsidian vault: previews or deletes
- Forget cards → Trash and assets: soft-deletes
- Vault stats → Obsidian vault: scans cards
- Vault stats → Trash and assets: counts trash
- Save cards → Markdown cards: serializes
- Update cards → Markdown cards: rewrites
- Link cards → Markdown cards: records links
- Image handling → Trash and assets: stores images