# mdfy Demo's knowledge hub — full text > A hand-curated example hub showing what mdfy makes possible — captured AI conversations, research notes, project decisions, and the bundles that synthesise them. Paste any URL into Claude, ChatGPT, or Cursor to see the full payload. Canonical hub URL: https://memory.wiki/hub/demo Index-only manifest: https://memory.wiki/hub/demo/llms.txt Concept digest: https://memory.wiki/raw/hub/demo?digest=1&compact=1 # Knowledge graph _Pre-computed structure across this hub: 40 concepts, 30 relations, 0 bundles with AI analysis. Use this as navigation; the doc bodies below contain the prose._ ## Concepts - **mdfy** _(entity • weight 123 • 21 docs)_ A tool that stores project context and decision history, integrated into Cursor via custom rules. - **Supabase** _(entity • weight 62 • 13 docs)_ Backend-as-a-service providing authentication, database, and row-level security without separate auth overhead. - **Vendor consolidation** _(concept • weight 61 • 12 docs)_ The operational principle of reducing authentication surfaces, SDKs, and control planes by keeping vector search within the existing Postgres infrastructure. - **Structural moat** _(concept • weight 53 • 8 docs)_ The defensible advantage created by mdfy's vendor-neutral positioning, which competitors cannot replicate due to inherent conflicts of interest. - **Claude** _(entity • weight 46 • 14 docs)_ Anthropic's AI model cited as an example of vendor lock-in through projects and memory features. - **pgvector** _(entity • weight 45 • 13 docs)_ PostgreSQL extension providing vector data type and HNSW indexing for efficient similarity search. - **mdfy.app** _(entity • weight 37 • 5 docs)_ The platform hosting this hub with a hierarchical document structure and permission system. - **Authentication** _(tag • weight 36 • 7 docs)_ Core security domain covering user identity, session management, and authorization patterns. - **bundle URL** _(entity • weight 35 • 5 docs)_ The delivery mechanism for markdown digests that now carries embedded graph analysis instead of doc list only - **AI tool integration** _(concept • weight 33 • 5 docs)_ Ability to paste hub URL directly into Claude, ChatGPT, Cursor, or Codex for question-answering against the hub. - **Hacker News** _(entity • weight 31 • 5 docs)_ Primary GTM channel chosen for high ICP overlap with developers and format alignment with technical credibility. - **Database Design** _(tag • weight 30 • 7 docs)_ Data modeling domain including schema design, migrations, and query optimization strategies. - **mdfy Platform** _(entity • weight 30 • 6 docs)_ Knowledge management platform designed for AI-first workflows with URL-based sharing. - **Cursor IDE** _(entity • weight 30 • 6 docs)_ Code editor that can fetch and utilize mdfy bundle URLs for project context. - **Cursor** _(entity • weight 30 • 13 docs)_ Code editor that consumes mdfy bundles as context for chat and composer sessions. - **API Design** _(tag • weight 28 • 7 docs)_ RESTful interface design covering endpoints, error handling, and client-server communication. - **Resend** _(entity • weight 27 • 7 docs)_ Email service provider supporting both transactional and marketing communication channels. - **ChatGPT** _(entity • weight 27 • 13 docs)_ Example of an AI provider whose memory feature is intentionally confined to its own product. - **Next.js App Router** _(entity • weight 26 • 7 docs)_ Chosen routing framework leveraging RSC and Server Actions to match the project's data-heavy, read-mostly workload. - **Vercel AI Gateway** _(entity • weight 26 • 7 docs)_ AI provider abstraction layer offering failover and zero data retention for model access. - **Cross-AI memory** _(concept • weight 26 • 6 docs)_ The core thesis: a memory layer that persists across multiple AI providers simultaneously, structurally unavailable to single-vendor AI companies. - **Anthropic** _(entity • weight 25 • 12 docs)_ Incumbent AI vendor mentioned as competitive threat with integrated memory and user lock-in. - **Next.js 15** _(entity • weight 25 • 7 docs)_ Chosen frontend framework leveraging React Server Components and caching for performance. - **Hub-shaped memory** _(concept • weight 24 • 3 docs)_ The chosen architecture where users author structured notes as URL-addressable resources that the AI reads, preserving human control over memory curation. - **Performance Optimization** _(concept • weight 24 • 5 docs)_ Critical performance considerations driving technical architecture decisions. - **Knowledge Management** _(tag • weight 24 • 7 docs)_ Domain of organizing, storing, and retrieving information for human and AI use. - **Row-level security** _(concept • weight 24 • 7 docs)_ Supabase RLS capability co-locating authentication and authorization with data, justifying single-vendor consolidation. - **React Hook Form** _(entity • weight 23 • 7 docs)_ Primary form handling library paired with Zod schemas for both client and server validation. - **Claude Code** _(entity • weight 23 • 6 docs)_ AI coding feature mentioned as a primary context for AI-native developer adoption. - **AI Integration** _(tag • weight 22 • 10 docs)_ Artificial intelligence features and infrastructure including vector search and multi-provider setup. - **Obsidian** _(entity • weight 22 • 5 docs)_ The primary subject being tested for import functionality and markdown compatibility. - **Vector recall** _(concept • weight 22 • 3 docs)_ Memory pattern using embeddings and cosine similarity retrieval; trades precision for breadth but risks memory drift beyond user control. - **Accessibility** _(tag • weight 22 • 7 docs)_ Non-negotiable requirements including WCAG AA contrast, keyboard navigation, and semantic HTML for interactive elements. - **Codex CLI** _(entity • weight 22 • 4 docs)_ Command-line interface that integrates with AGENTS.md to load project context and caches configuration at session start. - **Vercel** _(entity • weight 22 • 8 docs)_ Early production adopter with comprehensive llms.txt implementation including per-product child files. - **llms.txt** _(concept • weight 22 • 7 docs)_ Plain-text discoverability standard for AI agents at site root, analogous to robots.txt and sitemap.xml. - **Zod** _(entity • weight 21 • 7 docs)_ Schema validation library used identically on client and server to enforce data integrity. - **shadcn/ui** _(entity • weight 21 • 7 docs)_ Source of primitive components re-exported in the project to maintain consistent branding. - **URL-addressable knowledge** _(concept • weight 21 • 3 docs)_ Design principle enabling AI systems to read structured user-authored content from persistent, addressable locations outside the AI interface. - **Component hierarchy** _(concept • weight 21 • 7 docs)_ Atomic structure (atoms → molecules → organisms → pages) establishes reusability rules and prevents circular dependencies in the codebase. ## Concept relations - **Claude** developed by **Anthropic** - **Hub-shaped memory** implemented by **mdfy** - **mdfy** implements pattern **Hub-shaped memory** - **Supabase** enables approach **Vendor consolidation** - **Cross-AI memory** creates advantage **Structural moat** - **Vector recall** implemented by **ChatGPT** - **URL-addressable knowledge** enables approach **Hub-shaped memory** - **Anthropic** supports strategy **Vendor consolidation** - **Supabase** exemplifies approach **Vendor consolidation** - **Supabase** reduces complexity **Vendor consolidation** - **React Hook Form** pairs with **Zod** - **Row-level security** supports **Vendor consolidation** - **Supabase** integrates **pgvector** - **Supabase** exemplifies strategy **Vendor consolidation** - **Zod** integrates validation **React Hook Form** - **Row-level security** supports decision **Vendor consolidation** - **Supabase** provides **Row-level security** - **Vendor consolidation** guides **Supabase** - **React Hook Form** validates with **Zod** - **mdfy.app** provides via **bundle URL** - **Cursor IDE** fetches **bundle URL** - **Supabase** implements **Row-level security** - **Supabase** hosts **pgvector** - **Vercel** supports strategy **Vendor consolidation** - **Structural moat** enables **Cross-AI memory** - **Cursor** positioned to deliver **Cross-AI memory** - **Hub-shaped memory** depends on **URL-addressable knowledge** - **mdfy** integrated into **Cursor** - **mdfy** solves problem for **ChatGPT** - **mdfy** integrates with **Cursor** --- id: LhYW7tc1 title: API conventions url: https://memory.wiki/LhYW7tc1 updated: 2026-05-27T00:41:53.897+00:00 --- # API conventions ## URL shape `/api/v1/` for stable endpoints. Versioned via the path. Sub-resources nest: `/api/v1/pages//blocks`. ## HTTP verbs - `GET` — idempotent read - `POST` — create - `PATCH` — partial update (default for edits) - `PUT` — full replace (rare, use sparingly) - `DELETE` — soft delete (sets `deleted_at`); pass `?permanent=true` for hard delete ## Error shape Every error response: ```json { "error": "human-readable message", "code": "machine_code", "details": {} } ``` Status codes used: 400 (bad input), 401 (no auth), 403 (auth but no permission), 404 (not found), 409 (conflict), 410 (gone — expired), 422 (validation), 429 (rate limit), 500 (us). ## Authentication Two paths, in order of precedence: 1. `Authorization: Bearer ` — for signed-in users (preferred) 2. `x-edit-token: ` — for anonymous edits (per-doc capability) Server middleware (`lib/verify-auth.ts`) returns `{userId, email}`or null. Routes that allow either signed-in or token holders should check both. ## Rate limiting Sliding window, IP-based, 60 req/min default. Override per-route in `middleware.ts`. Returns 429 with `Retry-After` header. ## Pagination Cursor-based, not offset. `?cursor=&limit=20`. Response includes `nextCursor` (or null if last page). ## Things to avoid - Don't put service-role key calls behind the public API. Use server-component reads or the cron path. - Don't return more than 200 rows in one response. Paginate. - Don't emit raw Postgres errors to clients — sanitize via `mapPgError`. --- id: ir0K6-u2 title: Open questions url: https://memory.wiki/ir0K6-u2 updated: 2026-05-16T14:17:17.775341+00:00 --- # Open questions Things we're carrying. Not decisions — placeholders. ## Pricing model Three candidates: 1. Per-seat ($X / user / month) — predictable for buyer, penalises invite-heavy teams 2. Per-page ($Y / published page / month) — usage-aligned, complex to communicate 3. Flat tiers ($Z / month) — simple, but caps usage on plans Need 5 more pricing interviews before deciding. Talk to marketing leads at 10–50 person companies. ## Webhook delivery semantics We emit webhooks on `page.published`, `page.updated`, `form.submitted`. Open: at-least-once or exactly-once? - At-least-once (current) — receivers must dedupe - Exactly-once — requires distributed ledger / message ID tracking - Practical answer is probably at-least-once + a `webhook_id` header for receiver-side dedup ## i18n strategy Currently English-only. Korean is the next likely market based on inbound interest. Options: 1. `next-intl` (heavy, full framework) 2. `next-international` (lighter) 3. Roll-our-own with route segments `/en/...` and `/ko/...` Lean toward option 3 because we only have ~30 strings to translate and we want SEO per locale. ## Per-block vs per-page versioning Currently versioning at the page level. Marketing users edit one block at a time, so the version history is noisy ("v23: changed headline by 2 words"). Consider block-level version log layered on top — pages still version, but `page_block_versions` captures the actual change shape. Trade-off: more storage, more complex restore UI. ## Cron jobs ownership Right now cron lives in `api/cron/*` routes triggered by Vercel crons. Works fine. Open: at scale, do we move heavy cron (re-rank embedding refresh, abandoned-cart sweeps) to durable workflow (Vercel WDK)? Decide when we have one job that takes >2 minutes. --- id: SrgEHFCI title: Decision log url: https://memory.wiki/SrgEHFCI updated: 2026-05-16T14:17:17.748042+00:00 --- # Decision log ADR-style records. Append-only — never edit a decision, append a new one that supersedes. ## ADR-001 — Next.js App Router over Pages Router (2026-03-04) **Context.** Greenfield project. Both routers are stable. **Decision.** App Router. **Why.** RSC + Cache Components match our data-heavy / read-mostly profile. Server Actions reduce API surface. Vercel ships features here first. **Consequence.** Learning curve for hires familiar with Pages. Documented in onboarding. ## ADR-002 — Supabase over Neon + Clerk (2026-03-04) **Context.** Need DB + auth. **Decision.** Supabase for both. **Why.** RLS lets auth and authz live next to data. One vendor. Cheaper at our stage. **Consequence.** Vendor lock-in on auth. Acceptable — we'd rewrite auth before migrating off SB anyway. ## ADR-003 — Resend over SendGrid (2026-03-12) **Context.** Transactional + marketing email. **Decision.** Resend. **Why.** DX, modern API, React Email templates we already use elsewhere. **Consequence.** Less mature deliverability tooling. Revisit at $5k MRR. ## ADR-004 — pgvector over Pinecone (2026-04-02) **Context.** Need vector similarity for AI features. **Decision.** pgvector + HNSW in the existing Supabase Postgres. **Why.** No extra vendor. JOINs with relational data are free. HNSW is fast enough up to ~10M vectors. **Consequence.** When we exceed ~10M vectors we'll need to evaluate dedicated vector DB. Not soon. ## ADR-005 — Tailwind 4 over CSS Modules (2026-04-08) **Context.** Component styling. **Decision.** Tailwind 4 + a thin design-token layer. **Why.** Faster iteration, smaller CSS bundle, shadcn/ui parity. **Consequence.** Class lists get long. Use `clsx` + extracting to constants when a list exceeds 6 utilities. ## ADR-006 — Vercel AI Gateway over direct Anthropic SDK (2026-04-22) **Context.** Multiple AI providers for failover. **Decision.** Route through Vercel AI Gateway. **Why.** Provider failover, zero data retention, observability built-in. Same vendor as hosting. **Consequence.** One more hop in the request path. Latency p95 +30ms — acceptable. ## ADR-007 — Postgres over DynamoDB (2026-05-08) **Context.** Block-level content with complex relationships. **Decision.** Postgres. **Why.** Three customer interviews flagged needs that require joins (cross-page analytics, block-level templates, A/B variant aggregation). Cost model showed PG cheaper up to ~50M rows. **Consequence.** Will feel pain at ~100M rows. Revisit then. --- id: wp12y7sM title: UI patterns url: https://memory.wiki/wp12y7sM updated: 2026-05-16T14:17:17.72319+00:00 --- # UI patterns ## Tailwind 4 conventions - Design tokens live in `globals.css` as CSS variables: `--background`, `--accent`, `--text-primary`, etc. - Use `var(--...)` everywhere. Don't hardcode hex. - Dark mode via `[data-theme="dark"]` on ``. Tokens get re-bound at the document root. ## Component organization ```text components/ ├── atoms/ # Button, Input, Badge — no state, no fetching ├── molecules/ # FormField, Card, Menu — local state OK ├── organisms/ # PageEditor, BlockToolbar — owns fetching └── primitives/ # shadcn/ui exports (rename to mark these as ours) ``` Rule: atoms can be used everywhere. Organisms can't be imported by atoms or molecules — only by pages. ## Form validation Zod schemas live next to the form. `useForm` from React Hook Form. Server validates the SAME schema. Don't trust client validation alone — the API enforces it again. ## Loading states Prefer `` boundaries with skeletons over conditional `isLoading` ternaries. Skeletons match the final layout so the viewport doesn't jump. ## Empty states Every list view has an empty state with: icon + 1-line copy + 1 CTA. Don't ship a blank screen — that's a bug. ## Accessibility - Every `