dgui-hypermem

September 19, 2026 · View on GitHub

DGUI-HyperMem (DeckerGUI HyperMemory) — a self-hosted, hybrid long-term memory MCP server for AI agents, running entirely on Cloudflare Workers. Retrieval fuses vector search with full-text search, then a JEV reasoning layer (Choice / Noul / Score) re-ranks and curates what gets remembered.

A DeckerGUI project.

Deploy MCP Dataset License: MIT

What it does

  • Stores durable memories — an LLM/JEV layer assigns each memory a type, a salience score and a durability judgement; non-durable chatter is dropped.
  • Recalls hybrid — Vectorize ANN + D1 FTS5 BM25 candidates, fused by reciprocal rank, then re-ranked by JEV so the best memory wins even when wording differs.
  • Self-maintains — near-duplicate/contradicting memories are superseded automatically.
  • Gets better with use — every JEV decision is logged and flushed to a HuggingFace dataset, building a training corpus for the reasoning layer.
                 ┌───────────────────────────── Cloudflare Worker ─────────────────────────────┐
   MCP client    │                                                                             │
 (opencode, etc.)│   /mcp  ─ Streamable HTTP MCP      add · search · list · profile · forget    │
      ───────────┼─► /api/* ─ REST mirror              · help · sync_jev_dataset · jev_queue_stats│
                 │                                            │                                │
                 │                          ┌─────────────────┴─────────────────┐              │
                 │                          │            JEV layer              │              │
                 │                          │  Choice · Noul · Score (systemone)│              │
                 │                          └─────────────────┬─────────────────┘              │
                 │            ┌───────────────┬───────────────┴───────────┐                    │
                 │       D1 (SQLite)   Vectorize (768d)            Workers AI               │
                 │   memories + FTS5   embeddings                fallback model            │
                 │            └───────────────┴───────────────┬───────────┘                    │
                 │                                    jev_examples queue                        │
                 │                                            │ hourly cron                    │
                 └────────────────────────────────────────────┼───────────────────────────────┘

                                        🤗 ctaxnagomi/DGUI_HYPERMEM-JEV  (training brain)

Stack

LayerChoice
RuntimeCloudflare Workers (ES modules, nodejs_compat)
ProtocolMCP Streamable HTTP (stateless, JSON responses) via @modelcontextprotocol/sdk
DatabaseCloudflare D1 — memories, external-content FTS5 memories_fts, events, jev_examples
VectorsCloudflare Vectorize — @cf/baai/bge-base-en-v1.5, 768d cosine
ReasoningTypeSafe AI Jev / System One (choice / noul / score), Workers AI fallback

Endpoints

RouteMethodPurpose
/mcpPOSTMCP (Streamable HTTP). Requires auth.
/api/add /api/search /api/list /api/profile /api/forgetPOSTREST mirror of the tools
/api/sync_jevPOSTFlush queued JEV examples to the dataset now
/api/jev_queue_statsGETQueue status (pending / uploaded / error)
/healthGETUnauthenticated status

MCP tools: add, search, list, profile, forget, help, sync_jev_dataset, jev_queue_stats.

Auth accepts Authorization: Bearer <MCP_TOKEN>, x-api-key: <MCP_TOKEN>, or ?token=.

Deploy

npm install

# 1. Create resources (once)
npx wrangler d1 create dgui-hypermem
npx wrangler vectorize create dgui-hypermem --dimensions=768 --metric=cosine

# 2. Point wrangler.jsonc at your D1 id, then apply migrations
npx wrangler d1 migrations apply dgui-hypermem --remote

# 3. Secrets
npx wrangler secret put MCP_TOKEN      # bearer token clients must present
npx wrangler secret put TYPESAFE_API_KEY   # optional: enables the TypeSafe JEV backend
npx wrangler secret put HF_TOKEN       # optional: enables dataset sync

# 4. Ship
npx wrangler deploy

Configuration (wrangler.jsonc vars)

VarDefaultMeaning
JEV_MODEautoauto | typesafe | workers-ai | off
JEV_MODELjev-latestTypeSafe model alias
FALLBACK_MODEL@cf/meta/llama-3.1-8b-fast-v2Workers AI fallback
EMBED_MODEL@cf/baai/bge-base-en-v1.5Embedding model
DEFAULT_SCOPEdefaultDefault memory namespace
HF_DATASETctaxnagomi/DGUI_HYPERMEM-JEVTraining-brain dataset

Wire it into an MCP client

{
  "mcp": {
    "dgui-hypermem": {
      "type": "remote",
      "url": "https://dgui-hypermem.<your-subdomain>.workers.dev/mcp",
      "enabled": true,
      "headers": { "Authorization": "Bearer {env:DGUI_HYPERMEM_TOKEN}" }
    }
  }
}

The training brain

Every JEV decision is recorded as an instruction row — the exact state and typed questions that were sent, and the answers that came back — in the jev_examples table. An hourly cron (17 * * * *) and the sync_jev_dataset tool append pending rows to ctaxnagomi/DGUI_HYPERMEM-JEV, updating train.jsonl and running totals in metadata.json.

use_caseinstruct_typeRecorded when
analyzechoice_noul_scoreA memory is stored/typed
reranknoulRecall re-ranks candidates
supersedenoulA contradiction check runs

Layout

src/
  index.ts      MCP server, REST routes, scheduled handler
  store.ts      add / search / list / profile / forget (hybrid retrieval)
  jev.ts        JEV layer: analyze, rerank, supersede (TypeSafe + Workers AI)
  dataset.ts    jev_examples queue + HuggingFace flush
  types.ts      shared types
  util.ts       ids, hashing, base64, timing-safe compare
migrations/     0001_init.sql, 0002_jev_examples.sql
wrangler.jsonc  bindings, vars, cron

Credits

DGUI-HyperMem is a DeckerGUI project.

WhoContributionLink
TypeSafe AIJev — the first System One model — and the Choice / Noul / Score primitives the reasoning layer is built on.https://typesafe.ai · https://docs.typesafe.ai
DeckerGUIDesign, implementation and operation.https://deckergui.my
KrackedDevsCommunity credit and support.KrackedDevs
CTECXKnowledge / corpus partner.CTECX

Jev, System One, and the Choice / Noul / Score primitives are TypeSafe AI's and are used under their MIT-licensed public documentation (https://docs.typesafe.ai).

Contributing

Contributions are welcome. See CONTRIBUTING.md; contributors are listed in CONTRIBUTORS.md.

License

MIT © 2026 DeckerGUI.