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:opok-ops/dsh-mindforge
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
Encrypted 4-layer lifelong memory for DeepSeek Harness — powered by MindForge
DeepSeek Harness ships with basic session persistence — an append-only log and a simple memory table. That's enough for a single conversation, but agents forget everything across sessions, can't reason over past interactions, and have no way to encrypt sensitive memories.
dsh-mindforge plugs MindForge — a production-grade lifelong memory engine — directly into DSH as a native Cordis plugin. Your agent gets:
| Feature | dsh-mindforge | dsh-mnemon | DSH native |
|---|---|---|---|
| Memory layers | 4 (sensory/short/long/permanent) | 3 | 2 |
| AES-256-GCM encryption | Yes | No | No |
| Full-text search (FTS5 + trigram, Chinese-ready) | Yes | Partial | Partial |
| Vector search (384-dim MiniLM) | Yes | No | No |
| 6-way fusion retrieval | Yes | No | No |
| Knowledge graph | Yes | Yes | No |
| Federated memory + ACL | Yes | No | No |
| Memory evolution (decay/cluster/link/reinforce) | Yes | Partial | No |
| Metacognitive reflection | Yes | No | No |
| Memory lineage & version history | Yes | Partial | No |
| DSH native tools | 10 | ~8 | — |
DSH commands (/mindforge) |
Yes | Yes | — |
Auto context injection (agent.inject) |
Yes | Yes | — |
┌─────────────────────────────────────────────────┐
│ DeepSeek Harness (Cordis) │
│ ctx.tools │ ctx.commands │ agent.inject() │
└──────┬───────┴───────┬───────┴────────┬──────────┘
│ │ │
┌──────▼───────────────▼────────────────▼──────────┐
│ dsh-mindforge (TypeScript) │
│ Tool registration │ Commands │ Pre-step injection │
│ CLI Bridge │
└───────────────────────┬───────────────────────────┘
│ child_process.spawn
┌───────────────────────▼───────────────────────────┐
│ MindForge (Python CLI) │
│ 201 CLI commands │ 150+ API methods │ 32 MCP tools│
│ SQLite + FTS5(trigram) │ Embeddings(384-dim) │
│ Knowledge Graph │ Federated ACL │ AES-256-GCM │
└───────────────────────────────────────────────────┘
This is the same proven pattern used by dsh-mnemon — a TypeScript Cordis plugin wrapping an external CLI. The difference: MindForge brings encryption, 4-layer memory, federated ACL, and 6-way fusion search that no other DSH memory plugin offers.
MindForge CLI — Install Python engine:
pip install MindForge
# Or from source:
git clone https://github.com/opok-ops/MindForge.git
cd MindForge
pip install -e .
Initialize MindForge (creates encrypted database):
MindForge init
# Or non-interactive (CI/CD):
MindForge init --no-encrypt
Node.js 22+ — Required by DSH.
# From local path (development):
dsh plugin --profile web add "link:/absolute/path/to/dsh-mindforge"
# From GitHub (once published):
dsh plugin --profile web add "github:opok-ops/dsh-mindforge"
The cordis.patch.yml in this plugin provides defaults. Override in your DSH config:
mindforge:
cliPath: MindForge # or full path to executable
# dbPath: ~/.MindForge/data/store/memory.db
# keyFile: ~/.MindForge/data/store/key.bin
storageScope: global # global | workspace | custom
injectOnStep: true # auto-inject memories before each model step
maxContextTokens: 2048
tools: # choose which tools to expose to the model
- memory_add
- memory_search
- memory_context
- memory_stats
- memory_recall
- graph_query
ctx.tools)The model can call these tools directly:
| Tool | Description |
|---|---|
memory_add |
Store a memory (4-layer, encrypted) |
memory_search |
6-way fusion search (vector + FTS5 + TF-IDF + fuzzy + expansion + rerank) |
memory_context |
Token-budget-aware context retrieval for prompt injection |
memory_stats |
Memory store statistics |
memory_recall |
Smart recall (search + association + layer-aware) |
memory_reflection |
Metacognitive analysis of memory themes and drift |
memory_reinforce |
Identify high-value decaying memories |
memory_lineage |
Trace version history and audit events |
graph_query |
Query the knowledge graph |
rerank_search |
Query expansion + cross-encoder reranking |
/mindforge status # Memory store statistics
/mindforge recall <query> # Smart recall top 5
/mindforge remember <text> # Store as permanent memory
/mindforge forget <id> # Delete a memory
/mindforge graph # Knowledge graph overview
/mindforge search <query> # Full 6-way fusion search
When injectOnStep: true (default), dsh-mindforge listens to agent/pre-step events and automatically injects relevant memories before each model turn:
MindForge memory-context for token-budget-aware retrievalagent.inject()No configuration needed — works out of the box.
| Layer | Lifetime | Use Case |
|---|---|---|
| Sensory | Seconds–minutes | Raw input buffer, auto-expiring |
| Short-term | Current session | Working memory, conversation context |
| Long-term | Permanent (until decay) | Facts, preferences, learned skills |
| Permanent | Never expires | Core identity, critical knowledge |
Memory evolves automatically: sensory → short-term → long-term → permanent, with decay scoring, clustering, link reasoning, and reinforcement suggestions.
MindForge's retrieval pipeline combines six strategies, merging scores by document ID (highest wins):
All memory content is encrypted with AES-256-GCM at rest. The encryption key is stored separately from the database. Even if an attacker obtains the SQLite file, they cannot read the memories without the key file.
This makes dsh-mindforge suitable for enterprise and compliance-sensitive use cases that no other DSH memory plugin supports.
Multiple agents can share memories through MindForge's federated layer:
# Install dependencies
pnpm install
# Build
pnpm build
# Run tests
pnpm test
# Watch mode
pnpm dev
dsh-mindforge/
├── src/
│ ├── index.ts # Plugin entry — apply(ctx)
│ ├── bridge.ts # MindForge CLI subprocess bridge
│ ├── tools.ts # ctx.tools registration (10 tools)
│ ├── commands.ts # /mindforge command registration
│ ├── inject.ts # agent/pre-step context injection
│ ├── config.ts # Config schema & defaults
│ └── types.ts # TypeScript type definitions
├── tests/
│ └── bridge.test.ts # Unit tests
├── cordis.patch.yml # DSH configuration patch
├── package.json
├── tsconfig.json
├── tsdown.config.ts
└── vitest.config.ts
dsh-mnemon is the other memory plugin in the DSH ecosystem. Both follow the same architecture (TypeScript plugin + external CLI). Key differences:
| dsh-mindforge | dsh-mnemon | |
|---|---|---|
| Engine | MindForge (Python) | mnemon (Go) |
| Memory layers | 4 | 3 |
| Encryption | AES-256-GCM | None |
| Search | 6-way fusion | Semantic recall |
| Knowledge graph | Yes | Yes (4-graph) |
| Federated ACL | Yes | No |
| Memory evolution | Decay + cluster + link + reinforce + reflect | Capacity maintenance |
| CLI commands | 201 | ~10 |
| MCP tools | 32 | 0 |
| Tests | 88 (Python) + vitest | vitest |
Choose dsh-mindforge if you need encryption, federated memory, or the richest search. Choose dsh-mnemon if you prefer a single Go binary with no Python dependency.
/mindforge commands + agent.inject auto-injectionMIT — see LICENSE.
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: agent-memory、knowledge-graph、lifelong-memory、memory、persistent-memory。