# SCHEMA — mdfy Demo's hub

> 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.

This file describes the public surface of `memory.wiki/hub/demo`. Every URL
below returns plain markdown unless noted; cacheable; no auth required.

## Manifest files

- [`/hub/demo/index.md`](https://memory.wiki/hub/demo/index.md) — concept-grouped table of contents.
- [`/hub/demo/log.md`](https://memory.wiki/hub/demo/log.md) — append-only activity log (public events only).
- [`/hub/demo/SCHEMA.md`](https://memory.wiki/hub/demo/SCHEMA.md) — this file.
- [`/hub/demo/llms.txt`](https://memory.wiki/hub/demo/llms.txt) — llmstxt.org manifest with token estimates per doc.
- [`/hub/demo/llms-full.txt`](https://memory.wiki/hub/demo/llms-full.txt) — every public doc concatenated, capped to fit a context window. Override the cap with `?cap=200000`.

## Content URLs

- [`/raw/hub/demo`](https://memory.wiki/raw/hub/demo) — whole-hub markdown listing.
- [`/raw/hub/demo?digest=1`](https://memory.wiki/raw/hub/demo?digest=1) — concept-clustered summary (fewer tokens).
- [`/raw/hub/demo/c/<concept>`](https://memory.wiki/raw/hub/demo/c/example) — per-concept passages across docs.
- [`/raw/hub/demo/lint.md`](https://memory.wiki/raw/hub/demo/lint.md) — orphan docs + likely-duplicate pairs (the wiki's health snapshot).
- [`/raw/<doc-id>`](https://memory.wiki/raw/abc123) — plain markdown for a single document.
- [`/raw/b/<bundle-id>`](https://memory.wiki/raw/b/abc123) — concatenated markdown for a bundle.

Every `/raw/` URL accepts `?compact=1` to strip whitespace + emojis + redundant
headings for a token-economical fetch (typically 30-50% savings, same answer).

## Query API

- `POST https://memory.wiki/api/hub/demo/recall` — semantic + keyword search across this hub's public docs.
  Body: `{ "query": string, "k"?: number, "rerank"?: boolean }`.
  Returns top-k matches with snippet, score, and source doc URL.
  Setting `rerank: true` runs a Haiku-based cross-encoder pass for higher precision (one extra Anthropic call).

## Page criteria (when to create vs. update)

When the owner ingests a new source, it lands as a new page if it satisfies any of:
- introduces a **central concept** not already covered;
- the concept **recurs** across two or more sources;
- the topic is **independent** — gluing it onto an existing page would dilute that page's focus.

Otherwise the new content merges into an existing page and the concept index updates.

## Provenance

Documents tagged with `source: github:<owner>/<repo>` or `source: obsidian` carry their
origin in the `compile_from.external` field. Use that to round-trip a doc back to its
original surface or to detect imported (vs. authored) content.
