Back to home@moreWax

dsh-prime-agent

Closed learning loop for DeepSeek Harness: Prime Agent memory/skills bridge + OKF/OpenWiki provenance-aware knowledge serving

Stars
0
Language
TypeScript
Created
Aug 24, 2026
Updated
Aug 25, 2026
GitHub repo

Introduction

dsh-prime-agent

Make your DeepSeek Harness agents learn. A closed learning loop connecting Prime Agent's continual memory system and an OKF/OpenWiki knowledge registry to DeepSeek Harness — implemented entirely as native plugins on documented seams. No forks, no patches to core.

┌─────────────── dsh session ───────────────┐      ┌────────── Prime Agent ──────────┐
│ skill catalog ◄── okf-knowledge ───────────┼──────│  skills + OKF bundle pages      │
│ durable context ◄── prime-memory ────────┼──────│  memories / prompt notes        │
│ turn transcript ── prime-memory ─────────┼──────► inbox (refine.run)             │
└───────────────────────────────────────────┘      │        ▲                        │
                                                   │        │ DSPy / MIPROv2         │
                                                   └────────┴── OKF draft pages ─────┘
                                                        (accepted candidates flow back
                                                         through the catalog above)

Packages

PackageWhat it doesWorks standalone
@morewax/dsh-prime-memoryServes Prime skills into ctx.skills, injects Prime memories as durable context (session-reference contract: escaped, budgeted, fail-loud), exports turns to Prime's inbox for refine
@morewax/dsh-okf-knowledgeServes OKF/OpenWiki bundle pages as skills with provenance — trust tiers (verified/unverified) surface in metadata, with a verifiedOnly trust gate
prime-agent-testkitReusable fixtures + suites verifying every contract above (16 tests)dev only

New here? Start with the 5-minute quick start, then browse the cookbook.

Install

dsh plugin --profile default add @morewax/dsh-prime-memory
dsh plugin --profile default add @morewax/dsh-okf-knowledge
# or straight from GitHub:
dsh plugin --profile default add github:moreWax/dsh-prime-agent

Quick start

# ~/.dsh/profiles/default/cordis.patch.yml
- id: prime-memory
  name: '@morewax/dsh-prime-memory'
  config:
    primeHome: ~/.prime/agent       # any Prime Agent install
    sessionId: <prime-session-uuid> # whose memories to surface
    exportTurns: true               # write turns back for refine

- id: okf-knowledge
  name: '@morewax/dsh-okf-knowledge'
  config:
    bundles: [/srv/wiki/core]       # one or more OKF bundles
    verifiedOnly: false

The offline optimizer ships too — see refine/.

See the cookbook for complete recipes:

  1. Serve your knowledge base as agent skills
  2. Inject durable memories safely
  3. Close the learning loop with DSPy
  4. Trust-gated serving for team wikis

Why this is different

Memory-injection and transcript-export plugins already exist. This project is not either of those in isolation — it is the loop between them, plus:

  • Provenance-first knowledge: pages carry machine-readable trust tiers; the model catalog distinguishes verified from unverified content.
  • Injection safety by contract: untrusted memory text cannot forge framing tags (lossless escaping), budgets fail with explicit codes.
  • Crash-safe export: append-only records via ctx.storageDomain, never corrupt state, never break the agent loop.
  • Real interop: drives an actual Prime Agent install — not a reimplementation.

Compatibility

Built against DeepSeek Harness 0.1.1-rc.x (developer preview). The harness makes no stability promises pre-release; we re-verify against every upstream bump and pin tested versions here.

Development

pnpm install
pnpm test          # 16 tests: store readers, provider wiring, export, injection safety
pnpm build

Framework packages come from npm — no harness checkout needed. See docs/dev-setup.md for testing inside a live harness.

License

MIT