The Library and Reading
2 min read · 510 words
The Library is the first surface most people see when they open a Sovereign. It shows the books, documents, reports, and collections stored in the corpus, arranged in shelves and rows. You can browse by title, search by phrase, or switch between a timeline strip and a constellation view. Everything the Library displays comes from files on your disk.
Each book is a folder with an index.mdx file at the top and a chapters folder inside. The index carries the title, author, cover image, and a table of contents. The Library reads this folder once and builds a shelf entry from it. There is no hidden database of books that must be maintained separately; the folders are the catalogue.
The Folio reader
When you open a book, you enter the Folio reader. Folio turns the chapter MDX into a reading surface with clean typography, section breaks, pullquotes, tables, and verse. It also drives narration: you can listen to a chapter because the same MDX files carry TTS cues and a narrative prompt.
The reader keeps your place, lets you select passages, and can send a selection to the chat surface as a doorway. Reading and talking are not separate apps here. They are two ways of moving through the same corpus. A question about a paragraph becomes a conversation about the paragraph.
Bringing your own books
You can add a book by placing a folder under sovereign-corpus/files/. The folder name should be content-id__slug, and the folder must contain at least an index.mdx. If you also add chapters/chapter-slug.mdx files, they will appear in the table of contents.
The fastest way to start is to copy the shape of the books already in the corpus. Look at the Free & Safe folder or this manual: each has an index.mdx with front matter, a toc.json listing the chapters, a chapters directory, a prompts directory for narration, and an assets directory for cover images.
Create a folder under sovereign-corpus/files/ with a unique id and a slug.
Write an index.mdx with title, kind, coverImageUrl, and an IndexTOC list.
Add chapters/chapter-slug.mdx files, each with YAML front matter.
Add a toc.json matching the chapter files.
Drop cover images into assets/ and restart the Library surface.
You do not need anyone's permission to add a book. The Library surface discovers it because the corpus is the source of truth. The same folder can be read by the Folio surface, searched by the passage engine, and narrated by the TTS pipeline.
Finding passages
The Library has two ways of answering the question, "Where does this word live?" The browse view filters titles and metadata quickly. The passages view searches the full text of every book, using the local embedder and a reranker. A hit takes you straight to the chapter where the sentence lives, not just to the cover.
Search stays local unless you have joined a community node and the local node is unreachable. Even then, the query and the results are scoped to you. The search index is built from your corpus, and it returns your sentences.
