A platform reveals its convictions in what it exposes. Every route is a decision about what should be reachable. Every missing route is a decision about what should not.
The Consilience API is not a service layer bolted onto a product. It is the product, surfaced in a dozen directions — browser, phone, Telegram, IDE, voice — but united by a single catalog of capabilities. What follows is the complete surface. Not every parameter, not every response shape, but every door and what stands behind it.
Search — four modes, one index
The search architecture is the platform's intellectual spine. It has to answer questions that range from "find me that line about ravens in the Chronicle" to "what books in the library would I actually want to read right now?" Four modes, layered on the same enriched document index.
Instant search runs on PostgreSQL full-text search, weighted across title, author, description, and full body. Latency is measured in single-digit milliseconds. It is the mode that fires when someone types a few characters and expects results before they finish typing. For known-item queries — a title, an author name, a character — it is nearly always right.
Comprehensive search layers on filters: language, format, publication date, reading level, genre. It paginates. It sorts. It is the mode for browsing, for the researcher who knows roughly what they want and needs to narrow.
Semantic search is where the architecture gets interesting. The index is built on Cohere embed-v4.0, a multilingual embedding model that produces 1024-dimensional vectors. But the retrieval is hybrid: a weighted blend of dense vector similarity at 0.7 and sparse keyword retrieval at 0.3. The blend matters. Pure vector search drifts toward thematic neighbors at the expense of precision — ask for "the fall of Rome" and get essays on imperial decline generally. Pure keyword search is brittle — miss the exact phrase and get nothing. The hybrid catches both. Results pass through Cohere Rerank, a cross-encoder that reads the query and each candidate document together and assigns a relevance score, because retrieval without reranking is like a librarian who hands you forty books and walks away.
Carousel search is the AI-enhanced surface — the mode that generates artifact cards with summaries, reading estimates, and contextual recommendations alongside raw results. It is what powers the discovery rail on the library page and the reading suggestions in the pocket reader.
Every search mode shares the same document construction pipeline. Content enters as raw text, EPUB, or MDX. It is parsed, cleaned, chunked into overlapping segments with sentence-boundary awareness, enriched with metadata from the catalog, and indexed into PostgreSQL with pgvector. The enrichment step is the quiet hero: every chunk carries title, author, cover image URL, language, format, and reading level, so that when a chunk surfaces in search results, the surrounding context surfaces with it. A sentence from a book does not arrive naked. It arrives in the company of everything you need to know whether to open the book.
Query refinement happens in-memory, in a cache that warms on first query and persists across sessions. Common stop words are stripped; uncommon ones are kept because they are often the ones that carry meaning. If a query returns fewer than three results, the system falls back to a relaxed match — dropping the rarest terms, expanding to partial matches — and marks the results with a low-confidence flag so the caller can decide whether to show them. Credit gating applies to AI-enhanced modes only: instant and comprehensive search are always free. Semantic and carousel search consume credits, and the depletion experience is designed to be gentle — a message that explains what happened, not an error code that assumes you know what a 402 means.
TTS — buffered and streaming
Text-to-speech runs in two lanes. The buffered lane produces complete MP3 files — the mode for bookcast generation, for pre-rendered narration, for content that needs to be ready before anyone presses play. The streaming lane produces PCM or WAV chunks as the model generates, fed directly to a WebSocket or a phone call. The streaming lane is what makes live narration possible — a reader opens a book on their phone and the words begin to arrive as audio, not because a file was prepared in advance, but because the synthesis is happening right now, sentence by sentence.
The narration lifecycle is stateful. A book can be narrated, paused, resumed, and completed. The lifecycle tracks progress, stores partial renders for faster restarts, and records completion events that feed back into the recommendation system. A book someone finished listening to is a book they finished. The signal is the same, regardless of medium.
Everything else, briefly
Image generation routes through a local model on the Mac Studio, with cloud fallback to Hugging Face inference endpoints. It is gated by credits and designed for book covers, story illustrations, and ambient art — not for generating anything anyone asks for, but for generating things that belong to a specific text or a specific idea.
Chronicle episodes are served as serialized content with subscription tracking. Readers can follow the story as it unfolds, and the API tracks where each reader left off across surfaces — the same position whether they were reading on the web or listening on their phone.
MCP endpoints expose the library and chat history through the Model Context Protocol at /api/mcp/kaos and /api/mcp/chat-history. These are the endpoints that allow external agents — Cursor, a custom IDE plugin, a research tool — to reach into the library and retrieve books and conversations as structured, typed resources.
Analytics serves the preset-only PostHog summary endpoint, gated by agent key, returning platform metrics in markdown or JSON. Payments wraps Stripe for subscriptions, one-time purchases, and credit top-ups. Credits tracks balance, consumption, and depletion — the quiet ledger behind every AI-enhanced feature. User profile returns identity, preferences, and entitlements. Dashboard aggregates reading activity, library stats, and recommendations into a single call.
Every route is documented in the open-source packages. Nothing is hidden. The platform does not have a secret API for internal use and a public API for everyone else. What the Architect's own tools call is what anyone's tools can call. The gate is authentication, not access. The limit is credits, not permission.