Skip to content

feat(web): landing Memory Playground + ?format=markdown API#31

Merged
harrymove-ctrl merged 1 commit into
mainfrom
feat/memory-playground
Jun 20, 2026
Merged

feat(web): landing Memory Playground + ?format=markdown API#31
harrymove-ctrl merged 1 commit into
mainfrom
feat/memory-playground

Conversation

@harrymove-ctrl

Copy link
Copy Markdown
Owner

What

A Firecrawl / context.dev-style Memory Playground on the landing page, plus a small backend addition so the memory API can return Markdown directly.

Frontend — apps/web

  • Instant, zero-auth playground with four agent-native verbs: recall · ask · knowledge · remember, each calling the public Worker live.
  • Markdown ⇄ JSON response tabs; cURL / TS / Python snippet tabs with copy-to-clipboard.
  • Snippets are pinned to the public Worker origin (not the build-time API base), so a copied request runs for any external dev.
  • Honest source labeling: anonymous recall is shown as "Curated facts · keyword-ranked," not "live Walrus semantic," because a no-delegate caller only ever gets the keyword-ranked seeded facts.

Backend — apps/api/src/worker.ts

  • ?format=markdown (alias ?format=md) on POST /api/memwal/recall, POST /api/memwal/chat, and GET /api/memwal/facts/:ns.
  • Lets agents consume recall hits / grounded answers / namespace knowledge as Markdown instead of parsing the JSON envelope. Mirrors the playground's client-side rendering for consistency.
  • Query-param keyed only (no Accept-header Vary), so cached facts responses can't be poisoned across formats. Default JSON behavior is unchanged when the param is absent.

Verification

  • bun run typecheck — clean across all 7 workspaces.
  • Worker wrangler deploy --dry-run — 3.8 MB bundle (no jsdom leak), all new symbols present.
  • Prod web build — no localhost baked into the bundle.
  • Playground verified live in-browser: recall renders Markdown + curated-facts badge; ask does grounded RAG and correctly declines out-of-namespace questions.

Deliberately out of scope

The write path (remember) is gated to a CTA, not wired — recall reads from the MemWal relayer while a write would Seal-encrypt to Harbor (different backends, no round-trip), and the only recallable write needs a 64-char delegate. Left for a follow-up that reconciles the read/write backend split.

Add an instant, zero-auth "memory context API" playground to the landing
page (recall · ask · knowledge · remember) with live calls to the public
Worker, Markdown/JSON response tabs, and copy-as-curl / TS / Python
snippets pinned to the public origin so copied requests run anywhere.

Add ?format=markdown (alias ?format=md) to /api/memwal/recall, /chat, and
/facts/:ns so agents can consume recall hits, grounded answers, and
namespace knowledge as Markdown directly instead of parsing the JSON
envelope. Query-param keyed only (no Accept-header Vary), so cached facts
responses can't be poisoned across formats. Default JSON behavior is
unchanged when the param is absent.
@harrymove-ctrl harrymove-ctrl merged commit dbf0e04 into main Jun 20, 2026
2 checks passed
@harrymove-ctrl harrymove-ctrl deleted the feat/memory-playground branch June 20, 2026 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants