Managing books
The book list
The Books tab lists your books. Other users' books are not shown. The list shows one folder at a time, the folders of the current one above its books; at the top level, with no folders made, it is simply all your books.
The list is sorted by Last Modified, newest first. Click a column header to sort by it; with several sorted columns the list is sorted by all of them in order.
The row below the headers filters the list:
-
Name - books whose name starts with the text. Use
*as a wildcard:*dragonfinds every book with "dragon" anywhere in the name. -
Tags - books that have all the selected tags.
The refresh button at the end of the filter row reloads the list.
Each row has buttons: the star makes the book a favorite, the pen opens it, Move to folder puts it
into a folder, the clone button makes a copy of it and the trash button deletes it. The header has New folder,
the Manage menu (Organise, the window to move and copy books and folders, Tag books,
Statistics and the Mass changes sub menu) and Import, which makes a new book of files you have (see
A book is open in one window
A book can be open in one window at a time, also across your browser tabs, other browsers and your phone. When you open a book that is open somewhere else, Marginalia says since when and asks Open here: the book then opens here and its window in the other place closes, saying why (if a part is being generated there, the question says so and Open here stops the generation; what was written so far stays). Cancel leaves it where it is. When you log in and Marginalia opens the book you had open last, it does not take the book from another window: it leaves it closed and tells you where it is. A window in a tab that was closed or a device that went off does not keep the book: Open here takes it at once.
Advanced search
Search (in the header, next to Manage; the magnifier in the header on a phone) opens a window that finds books by more than the filter row can. Fill in what you want to check, leave the rest empty, and press Search (or Enter in a text field):
A book has to pass every check you filled in. The books found are listed below with their tags, the last changed first; a click on a column header sorts them. The folder button opens a book (in its window above the search, so closing the book brings you back to the results). Clear empties the fields.
Cloning a book
The clone button asks for the Name of the new book (the name of the original with (Copy) by default) and has the check box Only current branch, checked by default. The new book is a separate book that gets:
-
the settings of the book (description, language, prompts, point of view, tense, style, backup settings), the data that extensions keep in the book, and the tags;
-
the same Model, Protocol and lorebook. The lorebook is linked, not copied: a change of it shows in both books;
-
the story with its own copy of the parts, their summaries and pictures. With Only current branch only the parts from the beginning to the end of the active branch are copied; without it all the branches are.
The clone starts a version history of its own (one version per part); the history of the original is not copied.
The clone is not published, even if the original is. The original is not changed. It is put into the same folder as the original.
Tagging many books at once
Tag books (in the Manage menu of the header) opens a window that puts one tag on many books, or takes it off them, without opening each. Pick the Tag (or type a new one and press Enter) and the list shows every book with its tags; the books that have the picked tag come first and show it highlighted. Each row has a + button that applies the tag to that book and a - button that removes it. To do the same for several books, tick their check boxes (the box in the header ticks all) and use Apply the tag to the checked or Remove the tag from the checked at the bottom. A book an agent works on is grayed out: it is locked, so it can not be ticked or changed until the run is paused or stopped. The same window tags lorebooks and their entries.
Changing the model and protocol of many books
The Mass changes sub menu of the Manage menu has the item Mass Change Model/Protocol. It opens a window that puts one Model and/or one Protocol on many books without opening each. Leave a box empty (it shows Do not replace) and that part of the books stays as it is: pick only a model to change the models and keep the protocols. The table lists the books of the current folder by name with the model and protocol they have now; Include subfolders adds the books below it. Type in the filter under Name to narrow the list, tick the books to change (the box in the header ticks all the books that are shown) and press Replace and exit. Books that the filter hides are unticked, so only what you see is changed. A book an agent works on is grayed out: it is locked, so it can not be ticked or changed until the run is paused or stopped.
The item Mass Change Language of the same menu works the same way for the Language of the books: pick the language, filter and tick the books, press Replace and exit. The table shows the language each book has now, with what it inherits from its folders (see Language).
Renaming many books
The item Mass Rename renames the checked books at once. Pick how:
The column New name shows what each checked book would get while you type, so check it before you press Rename. A
numbering counts the checked books in the order of the list (by name). Spaces at the start and the end of the new name are
removed. Nothing is renamed, and the window stays open, when a text is missing, when the pattern has no {n}, when no name
would change, or when a name would end up empty. Filtering, Include subfolders and locked books work as in the other mass
changes.
Tag books and the item Tag folders work on the books, or on the folders, of the current folder in the same way.
Creating a book
- Click Add Book.
- Enter the name and confirm.
The new book is put into the folder the list shows, and so are the books you import. It opens right away. It starts with your Default Model and Default Protocol from the Settings tab (see Account & settings), if you have set them; otherwise select them on the About tab before generating.
Importing a book
Import in the header of the list (the file button on a phone) opens one window for everything a new book can be made of. Pick the Source; the text, the accepted files and the options under the name follow it:
Upload the file, give the book a name (it is filled from the file, the title of a document, or the character of a chat; the book is named New book when you leave it empty) and click Import. A progress window with Stop shows the parts being stored; stopping keeps what was stored. A file the source cannot read is refused with a warning, the other uploads stay.
The same window, from the settings menu (⚙) of a book, adds the parts to that book at a place you pick, see Importing into the book.
Importing a finished manuscript
For a draft that already exists, choose Import from a document and upload the file: a .docx (Word), .odt (LibreOffice,
OpenOffice), .rtf (Rich Text, from WordPad, TextEdit and any other program), .md (one Markdown file), .txt (plain text) or .epub (an e-book). The text becomes the parts of a new book, all of it marked as written by you (the import is not counted in the
statistics as writing and the history of a part says Import from a document).
-
Chapters. A paragraph in a Heading style (a
#heading in a Markdown file) starts a chapter, and each chapter starts with its heading (the first heading of a part is its chapter title, as in the export). Chapters start at heading level says which headings those are: the level you choose and the ones above it (the shallowest level the document has is chosen at first); deeper headings stay in the text as smaller headings. A document without headings is one chapter. The Title of the document is not imported as text, it names the book (in a Markdown file thetitle:of a header at the top, or a single#heading in front of##chapters). A plain text file has no headings, so a line of its own that saysChapter 12,Part IV: The Return,Book twoorPrologue(alsoEpilogue,Interlude,Preface,Foreword,Afterword) starts a chapter; the heading level choice is then not needed. -
Words per part. The text is cut between paragraphs into parts of about this many words (1000 at first), at the paragraph boundary nearest to the number. A part never holds the end of one chapter and the beginning of the next, and a chapter is not cut for nothing: what would be left over at the end of a chapter, when it is less than half of the number, stays with the part before it, so a chapter of up to one and a half times the number is one part. A paragraph longer than the number is not cut.
-
A line under the name tells how many chapters, words and parts the import will make; it changes as you change the options.
-
Paragraphs of a text file. Blank lines separate the paragraphs and the lines of a paragraph are joined (text wrapped at a column becomes one paragraph); a file with no blank lines has a paragraph on each line. A Markdown file is kept as it is written, cut at the blank lines, headings and code blocks; text in Windows-1252 instead of UTF-8 is read too.
-
Formatting. Italic and bold are kept (as Markdown
*italic*,**bold**); the rest of the formatting (fonts, sizes, alignment), images, headers and footers, footnotes, comments and deleted text of tracked changes are not imported. Tables are read cell by cell.
An old .doc file has to be saved as .docx, .odt or .rtf first.
An EPUB is read page by page in its reading order. The headings of the pages (h1 to h6) are the chapters; a page without a
heading that the e-book's table of contents names gets that name as its heading. The cover, the table of contents, footnotes and
the readings of ruby text are left out, and the title of the e-book names the book. A book protected by DRM cannot be read.
From an Obsidian vault or a Scrivener project
Both are folders, so zip the folder first (on a Mac Compress in the Finder; the .scriv of Scrivener is a folder too) and upload the .zip. The options are the
same as for a document.
-
Obsidian vault. Every note (
.md) is a chapter named after the note (or thetitle:of its header), in the order of the paths with numbers counted as numbers (Chapter 2beforeChapter 10). A folder is a part above its notes, and the headings inside a note are below the note's own. Links[[Note|text]]become their text; embeds ([[file]]with a!before it), comments%%...%%, block ids and the marker of a callout are removed; a highlight==text==is plain text. Hidden folders (.obsidian,.trash), attachments and notes without text are skipped. If the vault holds notes that are not part of the story, delete them before zipping. -
Scrivener project. The manuscript (the Draft folder of the binder, Scrivener 2 and 3) is imported, not the research, the trash or the documents that are not included in compile. A folder, or a document that has documents under it, is a heading (its depth in the binder is its level, its title the text); the documents that are all a folder holds are its scenes, one after another with a scene break between them (their titles are not used). A document directly in the manuscript or in a folder of other folders is a chapter with its title. The name of the project names the book.
Whatever the source, the new book is opened when the import is done (also when you stopped it), and the window Import finished offers to write the summaries of the parts and to let an agent take the lore notes.
Importing from SillyTavern
To continue a roleplay or story you started in SillyTavern, use
Import → Import from SillyTavern. In SillyTavern, export the chat
(Manage chat files, or take the .jsonl files from data/<user>/chats/<character>/), then:
-
Upload one or more
.jsonlchats. A file that is not a SillyTavern chat is refused, the others stay. -
Give the book a name (it is filled from the character of the first chat).
-
Tick Merge user and assistant messages into one part if you want one part per turn: the message of the user (several messages in a row are joined with an empty line) becomes the instructions of the part and the answer after it its text. Without it every message is a part of its own, with its text as the text of the part, so the book reads like the chat did.
-
Click Import. A progress window with Stop shows the parts being stored; stopping keeps what was stored.
SillyTavern copies the chat when you create a branch or a checkpoint, so the chats of one story share their beginning. Upload them together and Marginalia finds the common messages and stores them once: the chats become the branches of one tree, which you can walk in the tree view. The swipes (alternative answers) of a message become sibling parts, and the book opens at the end of the chat written last (by the date of its last message). Chats that don't begin with the same message become separate first parts. Hidden (system) messages are skipped, and so are swipes that are empty. The reasoning and the model name of an answer are kept with the part.
Importing from LM Studio
To continue a conversation you had in LM Studio, use Import → Import from LM Studio.
LM Studio keeps each conversation in a file <number>.conversation.json in the folder .lmstudio/conversations of your home folder (on Windows
%USERPROFILE%\.lmstudio\conversations). It works like
-
Upload one or more conversations. A file that is not a conversation of LM Studio is refused, the others stay.
-
Give the book a name (it is filled with the name of the conversation, or the name of the file when it has none).
-
Tick Merge user and assistant messages into one part for one part per turn (your message is the instructions of the part), or leave it off so that every message is a part of its own.
-
Click Import.
The versions of a message that LM Studio keeps (the answers you regenerated, the text you edited) become sibling parts and the version that was shown is the one the book opens on; conversations that share their beginning are joined into one tree. The thinking of a reasoning model is kept as the reasoning of the part, together with the model name. The system prompt of the conversation, the calls of tools and attached files are not imported.
To start a book from a backup file, use Import Backup as New Book in the Settings tab, see Book backups.
The About tab
Changes are saved as you type.
Below are read-only counts:
A book needs a model and a protocol to generate. Without them, generating stops with Book is missing model. or Book is missing protocol.
Deleting a book
Click the trash button in the book list and confirm. The book disappears from your list.
A book is not deleted while something works on it: a part being generated, a summary batch, a translation, a redraft or annotation window, or the book open in another window. Marginalia then says what is in the way (This is in use: ...); wait until it is done or stop it, and delete again. The same holds for restoring a backup into the book while another window or a run works on it.
Deleted books are not removed from the database right away. Until an administrator removes them, with all their parts, using Cleanup, you can bring the book back from the Trash tab. Until then the data is still in the database backups. The book's own backups are files and stay where they are.