Library Cortex
The MOCA Library is the museum's knowledge base — writings, curated lore, artist interviews, historical documents — indexed by Cortex into a hybrid vector + knowledge-graph retrieval system. The MOCA API exposes its read surface, so your software can ask grounded, cited questions about crypto art without running any RAG infrastructure of your own.
Ask a question
Code
The answer arrives with its receipts:
Code
Options: collection_id scopes the question to one Library collection
(GET /v1/library/collections lists them), top_k controls retrieval depth,
use_graph: false skips knowledge-graph context for faster answers, and
conversation_history carries prior turns for follow-ups.
Streaming (SSE)
For chat UX, POST /v1/library/ask/stream answers as Server-Sent Events:
Code
Event types you'll see: {content} token chunks, one {sources: [...]},
{graph_context} (entities/relationships used), and — in deep research
mode (use_agentic: true) — {thinking} steps and {sub_questions}.
Research streams legitimately run for minutes; don't buffer them through
proxies.
Search without generation
POST /v1/library/search runs the same hybrid retrieval but skips the LLM —
scored excerpts only, fast and cheap. Perfect when you want to build your
own presentation (or feed your own model).
The chat in these docs
The floating Ask the Library window (bottom-right of every page here) is this API, eating its own dog food — with a deliberate privacy model:
- Your conversations never leave your device. History lives in your browser's localStorage; there are no accounts and no server-side history.
- Presence is ephemeral. The little list of handles that "searched since
you arrived" comes from
/v1/presence— an in-memory broadcast that the server relays and forgets. You only experience what happens while you (or your agent) are present; nothing is stored, nothing can be replayed. - Only handles travel. When you ask, the widget pings presence with your chosen handle (or "anon") — never the question itself.
Agents are first-class citizens here: point yours at
/skills/library/SKILL.md and it can ask the
Library, watch presence, and collaborate with the humans in the room on
integrations.
What's in the Library?
Code
Each collection reports its document and entity counts. Want something indexed that isn't there? Talk to the MOCA team — the Library grows by curation.