runfali/dsh-mem0-plugins0

dsh-mem0-plugins

Mem0 persistent memory for the DeepSeek Harness web profile — automatic recall injection, tidal-coalesced memory writes, and mem0_search/add/update/delete tools against a self-hosted Mem0 server (X-API-Key). Zero-intrusion bundle plugin; no dsh source changes.

包名
dsh-mem0-plugins
版本
0.1.0
许可证
MIT
最近更新
2026年8月24日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:runfali/dsh-mem0-plugins

Configuration

All settings live in the dsh settings page under the mem0 namespace. Values saved there override profile-layer defaults.

Connection & identity

KeyDefaultDescription
enabledtrueMaster switch. When off: no recall, no writes, tools report "plugin disabled".
hosthttp://127.0.0.1:8888Base URL of the self-hosted mem0-graph server.
apiKey(empty)Sent as the X-API-Key header. Leave empty for AUTH_DISABLED deployments.
userIddsh-userOwner of the memories; shared across sessions.
agentIddshAttached as agent_id on writes.

Connection and identity settings

Automatic recall & query distillation

KeyDefaultDescription
forceRecallSteptrueForce-recall step (Plan B): inject a "must call mem0_search first" notice every turn (trivial turns skipped). Off = rely on usage guidance only.
topK10Max results per search (1–50).
rerankfalseRequest full-depth reranking (server needs a reranker configured).
distillEnabledtrueMaster switch for query distillation (see below).
distillMinChars500Queries up to this length go straight to /search unchanged — zero loss, zero extra calls.
distillInputMaxChars8000Truncation cap for text sent to the distillation model.
distillBaseUrlauthor's private endpointOpenAI-compatible endpoint used to distill long queries. Empty = skip distillation. The shipped default points at the author's internal deployment — override it with your own endpoint.
distillApiKeyauthor's private keyBearer token for the distillation endpoint.
distillModelQwen3.5-9BDistillation model id (a small local model is plenty).
distillTimeoutMs90000Per-request distillation timeout.
distillRetryAfterMs20000Hedged-request threshold: if the first request is still silent after this delay, fire a second concurrent one; first response wins.

Recall settings: top-k, rerank, distillation

Distillation model, timeout and hedging

Automatic write-back (tidal coalescing)

KeyDefaultDescription
syncEnabledtrueEnd-of-turn write-back master switch.
coalesceEnabledtrueBucket short turns and flush merged writes; off = one request per turn.
coalesceIdleMs5000Flush a bucket after this much inactivity.
coalesceWindowMs15000Flush a bucket after this much wall time.
coalesceMaxTurns5Max turns per bucket.
coalesceMaxChars4000Max characters per bucket.
fastpathChars2000Turns longer than this skip the bucket and write immediately.
feedbackEnabledtrueReport evolve feedback after successful update/delete.

Write-back settings: coalescing thresholds, fast path, evolve feedback

Reliability & timeouts

KeyDefaultDescription
queueMaxLen50Pending-write queue cap; oldest entry dropped when full.
breakerThreshold5Consecutive failures that open the circuit breaker.
breakerCooldownMs120000Breaker cooldown before half-open retry.
requestTimeoutMs300000Hard per-request cap shared by search/add (mirrors hermes httpx timeout=300.0; worst-case server-side LLM fallback is ~180 s). There is deliberately no second tool-level timeout.

Reliability settings: queue, breaker, request timeout

To change profile-layer defaults (applies to all users of the machine), append to ~/.dsh/profiles/web/cordis.patch.yml:

- id: mem0
  config:
    enabled: true
    host: http://mem0.internal:8888
    apiKey: your-admin-api-key