Project ΣUser guide

The Project Σ guide

Everything Project Σ does, one area per page, with every option it offers. Inside the app, More Options (the ⋮ button at the top right) > User Guide opens it in a new tab.

Start here

Your library

Chatting

Online

Making it yours

Running it

Writing extensionsFor developers: the extension API, from a first window to a server half and an online provider.

Beyond the user manual

How this guide is written

  • Names in bold are exactly what the app shows: a button, a menu item, a tab, a setting. A path such as Settings > General > Library Backup means: open Settings, pick General, find the Library Backup group.
  • More Options is the ⋮ menu at the right end of the top bar. On a phone it is More in the bottom bar.
  • Keys look like Esc. Things you type, such as search prefixes and macros, look like creator:.

Project Σ

A self-hosted home for your AI character cards. Project Σ keeps your characters, their chats, lorebooks, personas and gallery media in one library on your own machine, lets you search it like a database, chat with your characters through your own AI connection, and browse the popular character sites without leaving the app.

Project Σ is the successor to the Character Library extension for SillyTavern: you can see it as a standalone Character Library.

It runs as a small server on your computer or a home server, and you use it from any browser on your network, phones included. Everything lives in one data/ folder. The library is built to stay quick at sizes that would stall a folder of card files: it is designed for libraries of a million characters.

This page is the tour and the common questions; the user guide covers every feature and option. The guide is one page that opens in any browser: online at that link, in the app under More Options > User Guide, or docs/guide.html in the install folder.

What it does

  • A library that scales. A fast grid with eleven sort orders, favorites, playlists with icons and colours, and a Tags Manager that renames, merges and cleans up tags across the whole library. Select one character or every character in the current view and tag, favorite, export or delete them in one go. Find duplicates, and ask an AI connection to recommend characters from your own library.
  • Search that understands cards. Press the key under Esc anywhere for Search everything, one box over your characters, chats, messages, lorebook entries and settings. In the library, search names, tags, creators, notes or card text; narrow with prefixes such as creator:, fav:yes or chub:no; and build Advanced Filters from more than twenty fields (token count, last chat, linked lorebook, alternate greetings and more), saved as presets.
  • Every card detail, editable. Read and edit every field of a card, its embedded and linked lorebooks, and its picture. Each edit can be snapshotted first, so version history shows a field-by-field diff and restores any earlier state.
  • Chats that run here. A full conversation screen: streaming replies, alternates you swipe through, continue, regenerate, "write my next message", branching a chat from any message, hidden messages, thinking shown in a fold, and export to JSONL. Attach pictures to a message when the model sees them, and keep a gallery for each chat beside its character's. Around the conversation sit a prompt manager (it imports SillyTavern chat-completion presets and builds them the way SillyTavern does), regex scripts, a header you arrange yourself, a prompt inspector that shows exactly what is sent, an Author's note, chat backgrounds, and an out-of-character assistant that knows your persona and the Author's note and can propose lorebook, message, card, note and persona edits for you to review. See also chat windows.
  • Your own AI connection. Any endpoint that speaks the OpenAI-compatible chat API, local or hosted, plus Anthropic's API through a bundled extension. Keys stay on the server and are never sent back to the browser.
  • Lorebooks. A manager with every entry option, books linked to characters, bound to one chat, tied to a persona or active everywhere, a chat window that shows which entries fired and why, and AI generation of entries from pasted text, a wiki page or your own characters.
  • Personas with pronouns. Be someone different everywhere or in one chat only, with a picture, bound lorebooks and pronouns that cards can use through {{sub}}, {{obj}} and friends.
  • A creator with a design partner. Write a card from scratch or start from one in your library, with a Studio that talks the whole draft through with you and proposes changes you apply one by one.
  • The character sites in one tab. Browse ChubAI, JanitorAI, JannyAI, CharacterTavern, Pygmalion, Wyvern, Botbooru, DataCat and the RisuAI Realm; see at a glance what you already own; import in the background; keep linked characters up to date with a field-by-field update check.
  • Media that stays put. Each character has a gallery for images, video and audio, a full-screen viewer, and a downloader that pulls the remote images a card links to, including whole albums from common image hosts, so nothing breaks when a host goes away.
  • Make it yours. A theme editor with presets and a live preview, a custom CSS editor, and a CSS assistant.
  • Extensions. A bundled set (memory summaries, trackers, a translator, story beats, ratings and notes, library stats, and more), each off until you switch it on, and installable extensions from a git URL or a zip. The bundled set is vibe-coded: written entirely by AI as a stress test of the extension API, not reviewed line by line, and meant as examples rather than core features. An installed extension runs with full access to your server, every account on it and the computer it runs on, and Project Σ does not review extensions or answer for what they do: read Before you install anything first.
  • Built to be trusted with your library. Optional accounts with a separate library each, scheduled database backups, a consistency checker, and a migration that brings a whole SillyTavern library across and verifies it. See also accounts.
  • An API underneath. Everything the app does goes through a documented HTTP API: power users can automate tasks and script their own library with it (bulk tagging and cleanup, scheduled imports and exports, backups on a timer, reports on the collection), and extension creators build on it.

Quick start

Requires Node.js 22.15 or newer. Get the code with git:

git clone https://github.com/Sillyanonymous/ProjectSigma.git
cd ProjectSigma

or with Code > Download ZIP on GitHub, unpacked. Then, in that folder:

npm install
npm start

Or let a launcher do it: double-click Start Project Sigma.bat on Windows, or run sh start.sh on Linux, macOS and Android (in Termux; the guide has the steps). It checks that Node.js is new enough, installs what Project Σ needs on the first run and again after an update, starts the server and opens your browser on it (openBrowser: false in data/server.yaml keeps it from that). Keep its window open while you use the app; closing it stops the server.

Open http://localhost:7788 and the app loads. All state lives in the data/ folder next to the install. To use it from your phone, open the same address with this computer's network address in place of localhost.

With Docker instead: docker compose -f docker/compose.yaml up -d from the install folder. docker/README.md covers the volumes, updating, and the optional browser for the sites behind Cloudflare.

New to it? Getting started walks through the first ten minutes.

Updating

The app tells you when a new version is out (Settings > Info > Updates, and the notifications). A git install updates itself with Update Now: it backs up every library, brings in the new version and restarts. By hand that is git pull, then starting it again. A ZIP install updates by unpacking the new release and moving data/ across; Docker by git pull and docker compose -f docker/compose.yaml up -d --build. Updating has the details.

Bringing a SillyTavern library

Project Σ can bring a whole SillyTavern user folder across (the folder holding characters/, chats/ and worlds/, usually data/default-user): cards with their tags and favorites, chats, lorebooks and their links, gallery media, version snapshots, playlists, personas, custom CSS, saved prompts and filter presets. The SillyTavern folder is only ever read, never changed.

The easy way is the wizard: Settings > Account > Bring your SillyTavern library. Point it at the folder, press Check to read the plan, run it, and finalize when you are satisfied. Re-running is always safe until you finalize: every character heals in place and nothing duplicates.

From a terminal, the same tool:

npm run migrate -- <path-to-st-user-dir> --user <handle> --dry-run
npm run migrate -- <path-to-st-user-dir> --user <handle>
npm run migrate -- <path-to-st-user-dir> --user <handle> --finalize

The first prints the plan and writes nothing; the second runs the migration and finishes by verifying it against the source, field by field and message by message; the third verifies one last time and makes the migrated characters indistinguishable from ones created here. Group chats, SillyTavern's own settings and its asset folders stay behind. Every flag, the exit codes and the full list of what comes across are in Bringing a SillyTavern library.

FAQ

Is this a SillyTavern extension?

No. It is a standalone app with its own server and database. It can import a SillyTavern data folder, and chats export in SillyTavern's JSONL format, but it does not need SillyTavern installed.

Do I need an AI model to use it?

No. The library, search, editing, lorebooks, online browsing and media all work without one. Chatting, the assistant, the Studio, the Card Recommender, AI lorebook generation, the CSS assistant and some extensions need a connection, which you add under Settings > AI.

Which AI services work?

Any endpoint that offers the OpenAI-compatible chat completions API, which covers most hosted services and local servers; the endpoint you enter includes the API's version path, for example ending in /v1. Anthropic's own API works through the bundled Anthropic extension.

Is my API key safe?

It is stored on the server, in your library's database, and the browser never receives it back: the app only ever shows "Key stored" and its last four characters. Treat your data/ folder and its backups as you would any file holding a key.

Can I use it on my phone?

Yes. The app switches to a phone layout with a bottom bar, swipe gestures and full-screen sheets. Open the server's address from the phone's browser while both are on the same network.

Can several people share one install?

Yes. Turn on accounts (multiUser: true in data/server.yaml) and each person gets a separate library, settings and media. Without accounts there is no sign-in, so anyone who can reach the port can use and change everything. Accounts and server settings

Which card formats does it read?

Card PNGs (V1, V2 and V3) and CHARX files, plus Project Σ's own bundles. It exports card PNGs and full bundles with chats and gallery media. JSON card files are not imported.

Does it do group chats?

No. Every chat has one character; a SillyTavern migration counts group chats and leaves them where they are.

How do I back up?

Settings > General > Library Backup takes a copy of the database on demand or on a daily or weekly schedule. It does not cover images, so copy the whole data/ folder now and then too. Data and backups

Something broke after I turned on an extension

Switch it off under Settings > Extensions. If the app will not open far enough for that, start the server with CL_EXTENSIONS=off: the app runs with every extension dark while you remove the broken one's folder from extensions/installed/. Troubleshooting covers this and the other common snags.

Should I use a theme, Custom CSS or a theme extension?

For colours, corners, spacing and fonts, use the theme editor: it is quick, follows you to every device and keeps working across updates. For anything else (one component, a picture, hiding something), use Custom CSS snippets, which take any CSS but can stop matching when an update changes the app's markup. A theme extension packages a look for every account on a server, and a full one like the bundled Midnight or Σ adds its own settings, palettes and motion. Themes, Custom CSS and theme extensions compares them in full.

Configuration

Server settings live in data/server.yaml, which the first boot writes with a comment on every setting. Where a setting has an environment variable, the variable wins over the file.

server.yaml keyEnvironment variableDefaultWhat it sets
multiUserCL_MULTI_USER (true or false)falseSign-in and a separate home per account
sessionTimeoutDays30How long a sign-in lasts, in days; -1 for no limit (a browser still keeps the sign-in at most 400 days)
portCL_PORT7788The port the server listens on
hostCL_HOST0.0.0.0The address it binds: every interface by default, so a phone on your network can reach it; 127.0.0.1 keeps it to this machine
corsCL_CORS (comma-separated)noneThe other origins whose pages may call the API, such as a dashboard or tool of your own served from another address (* for any)
hostsCL_HOSTS (comma-separated)noneWith multi-user off, the machine names the server answers besides IP addresses and localhost, so a page on another site that points its own name here is refused
openBrowserCL_OPEN_BROWSER (true or false)trueWhether the launchers open the browser once the server answers; false for a server run headless, as a service, or with a tab already open

These are set only in the environment:

Environment variableDefaultWhat it sets
CL_DATA_DIRdata/ in the installWhere every library, account and server.yaml itself live, which is why the file cannot move it
CL_EXTENSIONS_DIRextensions/installed/ in the installWhere installed extensions and their .data/ scratch folders live
CL_EXTENSIONSonoff boots with every extension dark: the way back in when one breaks the app
CL_BROWSERa Playwright Chromium, else Chrome or Edge, found on the machineThe browser the hosted-browser services launch, tried before any found

The server reads server.yaml strictly: a setting it does not know, or a value of the wrong kind (multiUser: yes, a sessionTimeoutDays that is not a number), stops the boot with a message naming the setting, rather than starting a server configured differently from what was meant. The yes-or-no and number variables are read the same way (CL_MULTI_USER=1 stops the boot too).

For power users and extension creators

  • The API: everything the app does goes through the public HTTP API, so you can automate tasks and script your own library: bulk tagging and cleanup, scheduled imports and exports, backups on a timer, reports on the collection, or your library feeding tools of your own. The live spec is at GET /api/openapi.json; a browsable reference is docs/api-docs.html (regenerate it with npm run docs). The API covers signing in, calls from another site and the live change feed.
  • Extensions: the extension API gives extensions the same reach as the app's own code: events, storage, settings, windows, views and providers. The extension authors' guide, the user guide's last part, is the reference.
  • Checking a library: npm run verify reads every library in data/ against the consistency rules the server keeps (foreign keys, the search indexes, the maintained counts, the files behind their rows) and exits non-zero naming any finding. npm run verify -- --user <handle> checks one account; --db-only skips the walk over the files on disk, the one check whose time grows with a large media folder. --repair <check> fixes what a check found, for the checks that have a repair, after taking a backup; run it with the server stopped. It also lists who owns each table of a library (the app, each extension, or nobody), and --drop-leftover <id> drops the tables a removed extension left behind, after asking and taking a backup.
  • No build step: the client is plain JS, CSS and HTML served as is.

Issues are welcome; pull requests are closed. CONTRIBUTING.md says how to report a problem and why an extension is the way to change the app.

Acknowledgements

Big thanks to SillyTavern, the de facto roleplay platform. It taught me a lot, and Character Library would not have been possible without it, since it started as a SillyTavern extension.

Big thanks to Rivelle of Moonlit Echoes: she made SillyTavern bearable to look at for me and taught me a lot of good UX practices.

Acknowledgements to three SillyTavern extensions: nothing was lifted from them, but they served as inspiration.

License

Source available for personal use; see LICENSE for the terms and NOTICE for the bundled third-party components. The license is deliberately narrow for now, to protect the time and work behind the project while it finds its feet; the intent is to loosen it in the future. Forking the repository on GitHub to run and change for yourself is fine; a fork keeps this license, so it stays non-commercial and is not re-hosted or published elsewhere. The extension API is the open door: extensions are your own work, under whatever license you choose, and the bundled extensions are MIT, so any of them can be the start of yours.

Getting started

Installing and starting

Project Σ needs Node.js 22.15 or newer. Get the code with git:

git clone https://github.com/Sillyanonymous/ProjectSigma.git
cd ProjectSigma

or download it from GitHub with Code > Download ZIP and unpack it. Then, in that folder:

npm install
npm start

A launcher does the same for you: double-click Start Project Sigma.bat on Windows, or run sh start.sh on Linux and macOS. It checks that Node.js is new enough, installs what Project Σ needs on the first run and again after an update, starts the server and opens your browser on it, and starts the server again when you update from inside the app. Keep its window open while you use the app; closing it stops the server. To start without opening the browser (a server you run headless, or with a tab already open), set openBrowser: false in data/server.yaml.

The server prints the address it listens on (port 7788 unless you change it). Open http://localhost:7788 in a browser and the app loads. Everything you add is kept in the data/ folder next to the install; nothing is sent anywhere unless you browse an online site, chat through a connection you set up, or install an extension or look for its updates.

To stop it, stop the npm start process. To change the port, the address it listens on, or turn on accounts, see the configuration table in the README.

To run it with Docker instead, docker compose -f docker/compose.yaml up -d in the same folder starts it in a container, with everything you add kept in a Docker volume. The docker folder's own README covers updating, the volumes, and the optional browser for the sites behind Cloudflare.

Updating

Project Σ tells you when a new version is out. Once a day while the app is open it asks GitHub, and a newer version shows in the notifications under Project Σ update, with a link to what is new, Update Now and Skip This Version. You can also ask any time with Check Now in Settings > Info > Updates, where Tell me when Project Σ has an update switches the daily check off. With accounts turned on, only admins hear about updates and can update.

The notifications open on Project Σ update: v1.4.0 is available, You have v1.3.1, a link to what is new, and Skip This Version and Update Now
A new version in the notifications

Updating a git install

If you installed with git clone, Update Now does the whole update for you. First it shows the version you have, the new one, and what is new in every version in between, so nothing you skipped goes unread.

The Update Project Σ dialog: v1.3.1 to v1.4.0, a What is new panel with the release notes, a Full notes on GitHub link, and the Back up every library first switch above Cancel and Update Now
What the update brings, before it starts

Back up every library first is on unless you turn it off, and it remembers your last choice. Leave it on: the backup is your way back if the new version does not suit you, because a new version can upgrade your library in a way the old one cannot read.

Then a progress window follows each step: every library's backup as it copies (with the time left on a big one), bringing in the new version, restarting the server, and reloading the page. A restart can take a minute or two when the new version brings new packages to install; the window says so. Hide leaves the update running, and Show Progress in the notifications brings the window back. Other open tabs offer Reload once the server is back.

The Updating to v1.4.0 window: Back up every library running, with default at 1.20 GB of 3.40 GB and alice waiting, then Bring in v1.4.0, Restart the server and Reload, and a bar under them
The update as it runs

If the server was started with npm start rather than a launcher, the update waits for you to restart it yourself. By hand, the same update is git pull in the install folder, then starting it again with a launcher.

Updating a ZIP or Docker install

  • From a ZIP: How to Update opens the new release. Download it, unpack it beside the old folder, move the data folder (and extensions/installed, if you have one) across, and start the new one as before.
  • With Docker: in the folder you built from, git pull and then docker compose -f docker/compose.yaml up -d --build. Your libraries stay in the Docker volume.

When Update Now says no

Update Now refuses, saying why, when the install has edits of your own to its files or holds changes GitHub does not, and when a backup, a reply being written, an import or another long job would be cut off by the restart. For the edits, set them aside or update by hand; for a job, wait for it to finish and try again.

If the new version does not start

The launcher's window names the version it came from, the command that goes back to it, and the backups taken just before the update. Going back means putting those backups back too (see Restoring a backup), because the new version may already have upgraded the library.

Running it on an Android phone

Project Σ runs on an Android phone inside Termux. Install Termux from F-Droid or GitHub (the Play Store version is not maintained), then in Termux:

pkg update && pkg upgrade
pkg install git nodejs-lts python make clang
git clone https://github.com/Sillyanonymous/ProjectSigma.git
cd ProjectSigma
sh start.sh

Use the launcher rather than npm install: phones have no native build of the image library, and the launcher installs the portable one for you. The first start builds the database driver on the phone, which takes a few minutes (the python make clang line above is what it builds with). If that build stops with "Undefined variable android_ndk_path", run mkdir -p ~/.gyp && echo "{'variables':{'android_ndk_path':''}}" > ~/.gyp/include.gypi and then sh start.sh again.

Near the end of the first start it asks whether to install a browser for JanitorAI and JannyAI, and waits for your answer. If you use neither site, type n and press Enter, and it will not ask again (pressing Enter alone skips it for now, and it asks at the next start); otherwise see JanitorAI and JannyAI on an Android phone.

Once it is running, open http://localhost:7788 in the phone's browser. Android pauses apps in the background, so run termux-wake-lock first if the server should keep running with the screen off.

To start it again later (after closing Termux, or restarting the phone), open Termux and run:

cd ~/ProjectSigma
sh start.sh

JanitorAI and JannyAI on an Android phone

JanitorAI and JannyAI only let a real web browser in, so Project Σ runs one for you: Chromium, hidden inside Termux (the Hosted Browser). The browser app you already use on the phone cannot do this job. If you never use these two sites, skip this whole section; everything else works without it.

You need:

  • Project Σ set up in Termux, as in the section above.
  • Wi-Fi: Chromium is about 230 MB to download and takes about 1 GB of space.
  • For JanitorAI, an account. A spare one is best: recovering a hidden definition briefly changes a few things on the account and then puts them back (see JanitorAI). JannyAI needs no account.
  • For JanitorAI on a phone, Firefox and its free Cookie-Editor add-on (step 4), or a computer where you are signed in to JanitorAI.

On a phone, Settings is in the More sheet at the bottom of the screen.

1. Install Chromium

When Project Σ starts and finds no Chromium, it asks first: "Install it now? Type y and press Enter to install, n to never be asked again, or just press Enter to skip for now".

Type y and press Enter. Termux prints a lot of lines for a few minutes while it installs; keep it open. When it says "Chromium is installed. Starting Project Sigma.", it is done, and Project Σ starts as usual. Go to step 2.

If you skipped the question or answered no, install it by hand. Stop Project Σ (tap CTRL in Termux's row of extra keys, then C), then run these two lines one at a time, answering y when Termux asks whether to continue:

pkg install x11-repo
pkg install chromium

Then start Project Σ again:

cd ~/ProjectSigma
sh start.sh

Project Σ finds Chromium by itself: there is nothing to set.

2. Turn on JanitorAI

JanitorAI is off until you switch it on (JannyAI is on from the start; skip to step 3):

  1. Settings > Online > Provider Order & Defaults: tap the crossed-out eye on the JanitorAI row.
  2. A box explains what JanitorAI needs (the steps here cover it): tap Enable.
  3. Tap Save Settings at the bottom. Until you do, JanitorAI stays off.

3. Check that the browser gets through

In Settings > Online, open the JanitorAI section and tap Check janitorai.com under Step 1: Browser (or Check jannyai.com in the JannyAI section), then wait: the first check starts Chromium, which can take a minute or two on a phone.

It works when the "Cloudflare cleared" row has a green tick and "The browser gets through to janitorai.com" appears. An amber "Hardware accelerated" row saying the browser draws in software is normal on a phone and stops nothing.

For JannyAI that is all: no sign-in is needed. Browse and import (step 5).

4. Sign in to JanitorAI with a session token

The Sign In button (email and password) usually does not work on a phone: JanitorAI's "are you human" check stops it. A session token does the same job and skips that check. Your browser keeps it as a cookie (a small piece of saved login data), and you copy it from a browser where you are already signed in to JanitorAI.

On the phone, with Firefox:

  • Install Firefox from the Play Store, then add the Cookie-Editor add-on: Firefox's menu (the ⋮ button), then "Extensions", find Cookie-Editor and add it.
  • In Firefox, go to janitorai.com and sign in.
  • Still on janitorai.com, open Cookie-Editor from Firefox's menu, under "Extensions".
  • Find the cookie whose name starts with sb- and ends with -auth-token (today it is sb-mcmzxtzommpnxkynddbo-auth-token). Tap it to open it, then copy its whole value: tap in the value, long-press, "Select all", "Copy". It is long and starts with base64-.
  • If you see two, ending in .0 and .1, copy the .0 value, then add the .1 value straight after it, with nothing in between (tap the eye beside Token in Project Σ to see where the first part ends).

On a computer instead: sign in at janitorai.com, press F12, go to Application (in Firefox, Storage) > Cookies > janitorai.com, and copy the same cookie's value. It works like your password, so send it only to yourself.

Then, in Project Σ: Settings > Online > JanitorAI > Step 2: Account Login: paste the value into Token and tap Use Token.

JanitorAI's session token field on a phone: the hint, the Token box with its eye, and Use Token
Signing in with a session token

The badge above the sign-in fields turns to Logged in. The session keeps itself fresh from then on, so you should rarely do this again; signing in to JanitorAI somewhere else can end it, and then you paste a new token.

5. Import

In the Online tab, switch to JanitorAI (More > Switch Provider on a phone), then browse and import as usual. A character whose definition is hidden is recovered as it imports; this takes a little longer, since the browser on the phone does the work.

If something goes wrong

  • You skipped the question at the start, or answered no: install Chromium by hand (step 1).
  • It says "No Chromium found on this phone": Chromium is not installed, or its install did not finish. Stop Project Σ, run the two lines from step 1 again, then start it again.
  • Termux says there is not enough free space: free about 1 GB on the phone, then run the two lines again.
  • Termux was closed during the install and now says "dpkg was interrupted": run dpkg --configure -a, then the two lines again.
  • It says "Could not find a session in that value": only part of the cookie was copied, or its two parts were joined the wrong way round. Copy the whole value again; if it is split into .0 and .1, the .0 value comes first.
  • It says you are logged in but the session "expires in ~3h": what was pasted is a short-lived access token, not the cookie. Paste the cookie's whole value (it starts with base64-) for a session that lasts.
  • Sign In says the human check was not passed: use a session token instead (step 4).
  • Check janitorai.com fails or never finishes: try again on Wi-Fi with any VPN switched off. If it still fails, this phone cannot run the browser well enough; under Hosted Browser, set Browser to Use My Own Browser Endpoint and point it at a browser on a computer.
  • Imports stop when the screen is off: Android pauses Termux in the background. Run termux-wake-lock before starting Project Σ.

Opening it on your phone

The server listens on every network interface by default, so any device on your network can open it: use this computer's network address instead of localhost, for example http://192.168.1.20:7788. Bookmark it, or add it to the home screen, and it behaves like an app.

Without accounts there is no sign-in, so anyone who can reach that address can use the library. If other people share your network, turn accounts on or keep the server to this machine; Accounts and server settings explains both.

The first screen

A new library is empty, and the grid offers three ways in:

  • Import Characters opens Import Characters on its Local Files tab, where you drop card files; its URLs tab takes links. See Importing and exporting.
  • Bring a SillyTavern Library opens the migration wizard. See Bringing a SillyTavern library.
  • Browse Online opens the Online view, where you browse the character sites and import with one click. See Browsing online.
A new, empty library: the top bar above a grid that offers Import Characters, Bring a SillyTavern Library and Browse Online
A new library

Finding your way around

The top bar holds everything:

The top bar on the Characters view, its controls numbered
The top bar
  1. The view switcher: Characters (your library), Chats (every conversation) and Online (the character sites). Extensions can add views of their own, which appear after these, and a narrow window folds the extra ones behind a ⋯ button.
  2. The search box. See Search and filters.
  3. Advanced Filters.
  4. Search Settings: which fields the search reads.
  5. The sort.
  6. Tags: filters by tags.
  7. Playlists: filters by a playlist.
  8. More Options, the menu for everything else, below.

On Chats the view's own filters are the sort, the grouping and the layout (see The Chats view). Whatever does not fit folds behind More filters. A bell appears beside More Options while something is running or needs you; see Notifications.

The More Options menu: Search Everything, Import Characters, Lorebooks, Tags Manager, Card Recommender, Create Character, Find Duplicates, Auto-Link Characters, Refresh, User Guide and Settings
More Options, at the end of the top bar
ItemWhat it opens
Search EverythingOne field for your characters, chats, lorebooks, settings and actions (Search everything)
Import CharactersCard files, links and bundles (Importing and exporting)
LorebooksThe Lorebooks manager (Lorebooks)
Tags ManagerRename, merge and clean up tags (The library)
Card RecommenderAI suggestions from your own library (The library)
Create CharacterThe character creator (Creating characters)
Find DuplicatesCharacters that look like the same card (The library)
Auto-Link CharactersMatch unlinked characters to their online source (Browsing online)
RefreshReload the grid, keeping your filters
User GuideThis guide, in a new tab
SettingsEverything configurable (Settings and themes)

Import Characters, Find Duplicates, Auto-Link Characters and Refresh belong to the Characters view and hide in the others. Extensions can add their own items at the bottom, under Extensions.

The start page and view defaults

Settings > General > Start Page > Open on picks the view the app opens on: Characters, Chats, Online, or a view an extension adds. It follows your account, so every device you sign in from opens there.

Settings > General > View Defaults has a tab per view with what that view starts with:

ViewSettingChoicesDefault
CharactersSortthe eleven sort ordersName (A-Z)
CharactersGroup favorites firston or offoff
CharactersFilter preset(None) or a saved Advanced Filter preset(None)
ChatsSortthe seven chat sort ordersMost Recent
ChatsViewRecent, by time or By characterRecent, by time
OnlineProviderFirst Available or any siteFirst Available

Changes in the top bar (a different sort, a search) last for the session; saving Settings puts every view back on these defaults. The Online tab opens on its default provider only the first time; after that it stays on the one you last browsed.

On a phone

On a small screen or a touch-first device the app switches to its phone layout:

The app on a phone: the card grid with the bottom navigation, and a conversation
On a phone: the library and a chat
  • The top bar gives way to a bottom bar with Characters, Chats, Online, a sliders button for filters and sort, and More for the More Options menu, notifications and any extension views.
  • A round search button floats above the bottom bar on the three main views.
  • Dialogs open as full-screen sheets; drag one down, or use the phone's back button, to close it.
  • Swipe left or right on the main screen to change views; on a character card, swipe right to favorite it and left for its menu.

Settings > General > Theme & Layout > Mobile Layout forces it: Auto (Default) decides by screen and device, Always and Never override. The choice is kept per device. Every gesture is listed in Keyboard shortcuts and gestures.

Getting help

More Options > User Guide opens this guide in a new tab; the search at its top finds any section. Tips and tricks gathers the features that are easy to miss, and Troubleshooting covers the common problems.

Troubleshooting

The server and the page

The server will not start and names a setting

The server reads data/server.yaml strictly. A setting it does not know, or a value of the wrong kind (multiUser: yes instead of true), stops it with a message naming the setting. Fix that line, or the environment variable it names, and start again. The settings are listed in the README.

A page says the server "does not answer" to a name

Without accounts, the server answers only requests addressed to an IP address or localhost. If you reach it by a machine name, add the name to hosts in server.yaml (or CL_HOSTS) and restart. See Accounts and server settings.

My phone cannot reach it

Open the computer's network address with the port (for example http://192.168.1.20:7788), with both devices on the same network. Check that host in server.yaml is not 127.0.0.1, and that the computer's firewall lets the port through.

A library "was written by a newer version of the server"

The library was opened by a newer version of Project Σ, which upgraded it. Update this install to that version or newer. See Upgrading.

I forgot my password

An admin resets it with Issue a temporary password under Settings > Account > Users. See Managing accounts.

Open tabs after an update

A tab keeps the app it loaded. After a server restart it reconnects by itself and reads everything again, but after an update, reload every open tab (a phone's included) to get the new version.

A save did not go through

When saving a character fails, the message says why and your edits stay in the details window, so you can save again. A setting that could not be saved goes back to what the server holds, and a message says so.

The library

The first browse is slow

Thumbnails are made the first time each picture is shown. Settings > Media > Bulk Operations > Generate Missing Thumbnails makes them all ahead of time.

The disk is busy and searches are a little slow

Once a big import, a SillyTavern migration, an update or everyday edits have left it in pieces, Project Σ tidies its search index while the app sits idle, and pauses when you click, type or scroll again. A tidy-up you start yourself with Tidy Now keeps going while you work, from seconds to several minutes on a large library on a hard drive. The bell shows Maintenance while one runs, and everything is back to full speed once it is done. See Keeping it that fast and Search Index.

A search finds nothing I expected

Check Search Settings (the sliders by the search box): plain text only searches the ticked fields, and with none ticked nothing matches. Look for an active tag filter, playlist, Advanced Filter rule or Favorites only too. See Search and filters.

An import says the character is already in my library

Imports never overwrite. An identical card is skipped; a card that differs from yours offers Import as Copy. See Importing and exporting.

A card's images are broken

The images are on a host that removed them or blocks them. If you downloaded them earlier, switch on Replace remote URLs with local files; otherwise press Download Media on the Gallery tab while they still exist. See Media and galleries.

"Changed elsewhere" appeared

Another tab or device saved the same character or chat. Press Reload to see the newer version; your unsaved edits are kept until you confirm.

Chatting

"No connection is configured yet." or "cannot send yet"

Add an AI connection, or finish the one the note names: Add a Connection and Finish Setting It Up open Connections in the chat, and Settings > AI has the same list (see Connections). A connection needs an endpoint (unless its kind brings its own) and a model.

Replies fail or come back empty

The reason shows above the message box:

  • The model spent its whole reply budget reasoning: lower Reasoning effort or raise Max reply tokens on the connection.
  • An empty reply or a timeout: the endpoint did not answer in time. Test in the connection editor checks it.
  • The prompt does not fit: the card, lore and examples alone exceed the context budget. Raise the connection's Context size (or Context budget in Chat settings), or trim the lore budget.

The prompt inspector shows exactly what is being sent.

The character forgets early messages

Messages older than the Context starts here divider do not fit the budget and are not sent. Raise the budget if your model allows it, or use the bundled Memory extension, which keeps a running summary in the prompt.

{{user}} shows up literally

You have no persona yet. Create one under Settings > Chat > Personas. See Personas.

Online sites

A site will not load

Press Retry. If it keeps failing, the site may have changed or be down; Copy Error Report gives a summary to paste into a bug report (your settings appear only as on/off, never your tokens).

JanitorAI or JannyAI say they need a browser

Both sit behind Cloudflare. Set up Settings > Online > Hosted Browser, then press Check janitorai.com or Check jannyai.com. If this machine cannot get through, point the Hosted Browser at a browser on another machine. See The Hosted Browser. On an Android phone, install Chromium in Termux first: JanitorAI and JannyAI on an Android phone.

JanitorAI only shows one page

Sign in under Settings > Online > JanitorAI > Step 2: Account Login.

A JannyAI import came in almost empty

Without the Hosted Browser, JannyAI imports carry only the name, picture, tags and blurb. Set the browser up, then import again.

A character linked to a site the app does not offer, or to one whose extension is off or removed, keeps its link. The link chip in its details shows the site's name with a plug icon, and the update check passes it by. Click the chip to remove the link, or leave it: it reconnects by itself if the site returns, for example through an extension.

Extensions and looks

An extension broke something

Switch it off in Settings > Extensions. If the app will not open far enough, start the server with CL_EXTENSIONS=off. See Extensions.

My custom CSS made the app unusable

Open the browser's developer console and run clResetCSS(). It clears the active custom CSS and keeps your snippets.

Windows open in odd places or sizes

Settings > General > Theme & Layout > Reset Window Layouts.

Keyboard shortcuts and gestures

Keyboard shortcuts

Single-key shortcuts never fire while you are typing in a box.

Settings, Keyboard: each shortcut with its key, grouped by where it works
Changing a shortcut's key

Changing a key

The keys of the app's commands can be changed under Settings > Keyboard: Search everything, the library's selection mode, a conversation's /, End, R, C, I, E and Shift+Esc, the chat Gallery's keys and the gallery viewer's 0. Click a key, then press the new one: Esc cancels, and Backspace leaves the shortcut without a key. A key another shortcut already uses in the same place asks whether to swap them. Each row has its own reset, and Reset Every Key puts them all back. Your keys follow your account to every device; Ctrl and Cmd count as the same key, so a key set on Windows works on a Mac. An extension with shortcuts of its own lists them there under its name.

Esc, Enter, Tab, Backspace and the arrow keys keep their jobs everywhere: none of them can be a shortcut's key on its own, though held with Ctrl, Alt or Shift they can. On a phone, Keyboard appears in Settings once a keyboard is connected and you press a key. The tables below show the keys as they start.

Everywhere

KeyDoes
EscCloses the top window, dialog or menu (asking first if it holds unsaved edits)
The key under EscOpens or closes Search everything

The key under Esc, left of the 1, is found by its place, whatever your keyboard prints on it: ` on a US keyboard, ^ on a German one, ² on a French one, § on a Nordic one.

Search everything

KeyDoes
↑ / ↓Moves through the results
EnterOpens the highlighted result, or runs the highlighted action
TabShows what else you can do with the highlighted result
EscSteps back out of an action, then closes
BackspaceIn an empty field, steps back out of an action

The library

KeyDoes
SpaceStarts or ends selecting characters (see Selecting many characters)
Page Up / Page DownScrolls the grid by a screen
Home / EndJumps to the top or bottom of the grid
EnterIn a tag box, adds the tag; in a playlist or preset name box, creates or saves it

Character details

KeyDoes
← / →The previous or next character in the grid's order
↓ / ↑In Add tag..., lights a suggestion; Enter adds the one lit (the same in Create Character and the Card Recommender's tag boxes)
KeyDoes
← / →The previous or next image
0Resets the zoom
EscCloses the viewer

A conversation

KeyDoes
EnterSends (on a computer; Ctrl+Enter also sends)
Shift+EnterA new line
/Jumps to the message box
EndJumps to the latest message
← / →Pages the last reply's alternates; past the last one, writes another
RRegenerates the last reply
CContinues the last reply
IWrites your next message for you
EEdits the last message
EscLeaves the message box while you type in it; otherwise closes an open menu or the top chat window, then the conversation (stopping a reply being written)
Shift+EscStops a reply being written, from anywhere, the message box included

In the chat's Gallery window: ← / → step, G grid, / search, F full screen, B set as background, A attach to your next message, N creator's notes, + / - zoom, 0 reset.

In the prompt inspector's search, Enter finds the next match and Shift+Enter the previous one. In the swipe combiner, Ctrl+Enter generates.

Lorebooks

KeyDoes
↑ / ↓The previous or next book in the manager
Enter or ,In a keyword box, adds the keyword
BackspaceIn an empty keyword box, removes the last keyword
Ctrl+EnterSaves the book's note (Esc cancels it)

Menus and windows

KeyDoes
↑ / ↓, EnterMove through a dropdown and pick
Home / EndThe first or last choice in a dropdown
TabCloses a dropdown

On a computer, a window's resize edge can be focused with the keyboard: then the arrow keys resize it and Home puts it back.

Touch gestures

On a phone (or with Mobile Layout set to Always):

GestureWhereDoes
Swipe left or rightThe main screenSwitches between Characters, Chats and Online
Pull downThe top of a listRefreshes it
Swipe rightA character cardAdds it to favorites, or removes it
Swipe left, or long-pressA character cardOpens its menu
Swipe left or rightA character's headerThe previous or next character
Swipe left or rightA character's tab contentThe previous or next tab
Swipe left or rightAlternate greetingsCycles through them
TapThe picture in a character's headerShows it full size (or, while editing, picks a new one)
TapA long name in a headerScrolls the whole name into view
SwipeThe gallery viewerThe previous or next image; double-tap zooms
Tap, pinch, double-tapAn image in a chat's Gallery windowLifts it out, zooms it
Drag downA sheetCloses it
The back buttonAnywhereCloses the top window or sheet before leaving the app

Card swipes ignore the outer edges and the bottom of each card, so a swipe meant for the screen is not taken by a card. Settings > General > Card Grid & Browse > Swipe gestures on character cards turns card swipes off, and Haptic feedback controls the small vibrations that confirm them.

Tips and tricks

The features that are easy to miss, each with a link to the section that covers it in full.

Finding and selecting

  • Prefixes and words mix in one search: creator:anon fav:yes elf finds your favorites by that creator with "elf" in the fields you search. Every prefix has to match, so two creator: prefixes find characters whose creator matches both. See Search prefixes.
  • Search for what is missing: linked:no finds characters linked to no site, playlist:none the ones in no playlist, and version:none the ones without a version. See Search prefixes.
  • Select All selects every character the view matches, not just the loaded cards. Click a few cards afterwards to leave them out, and the rest stay selected. See Selecting many characters.
  • A filter preset can open with the grid: pick it as the default under Settings > General > View Defaults. See The start page and view defaults.
  • Settings has its own search: type in the box at the top of the dialog to find a setting in any section. See Using Settings.

Characters and tags

  • In a character's details, ← and → step through the characters in the grid's own order, filters included. See Stepping to the next character.
  • Undo in the version history reverts the last restore whenever you come back to it, a reload later included. Its confirmation shows when the copy was taken, and anything you edited since the restore goes too. See Version history.
  • Import rules take regular expressions: a match written as /^(.+) \(OC\)$/ with the replacement $1 keeps the name and drops the suffix, and an empty replacement drops the tag. Rules run top to bottom and the first match wins; local files are never rewritten. See The Tags Manager.
  • Undo last bulk run also reverses a rename, a merge or a tag deleted everywhere, and the undo can itself be undone. See The Tags Manager.

Chatting

  • / jumps to the message box and End to the newest message; R, C, I and E regenerate, continue, write your next message and edit the last one. See A conversation.
  • Branch from here keeps more than the messages: the chat's own card texts, its Author's note and its persona come along, and with Memory or Trackers on, their state as of that message too. See Messages.
  • Combine alternates into a new one works on the opening message while it is still the last one, so the card's alternate greetings can be merged into a greeting of your own. See Combining alternates.
  • Inspect the prompt is a dry run of the next plain reply: a lorebook entry with a trigger chance is shown as if its roll passed, and what you have typed in the message box is not in it yet. See The prompt inspector.
  • Scrolling up while a reply is written stops the view from following it, so you can read back without fighting the stream. See While a reply is written.
  • On a computer the conversation is a window too: drag its header to move it and its edges to resize it. Double-click a window's title bar, or the conversation's header, to put it back where it started. See How the windows work.
  • On a computer, a dialog's side panel (in the character details, Settings, the Lorebooks manager, the Custom CSS editor and the creator) can be widened: drag its inner edge, and double-click the edge to reset it. Reset Window Layouts puts every window back at once. See Scale, size and layout.
  • In a chat's Gallery window the mouse wheel zooms the picture, dragging moves a zoomed picture, and a click puts it back. See Gallery.
  • A chat can have a picture of its own behind it: Background in the chat's options menu, or Set as background on an image in its Gallery window. See Background.

Lorebooks, personas and the assistant

  • A lorebook bound to a persona follows you into every chat where you play that persona. See Where a lorebook applies.
  • The assistant's message edits can rewrite, replace, hide or delete a whole message, and a lorebook edit goes straight into the book. Applied changes have no undo, so read the side-by-side comparison first. See Proposed edits.
  • With Lore Search on, More Like This on a lorebook entry finds entries like it in every book, and Search Lore in More Options searches all of them at once. See Getting more from the bundled set.

Online and media

  • Auto-Link Characters looks at every unlinked character in your library, not just the view, and asks only the sites you have switched on that can search for a match. See Auto-Link Characters.
  • Download Media for All Characters leaves out the characters it has finished. Clear Processed History under Settings > Media lets the next run go over everything again. To fetch a few again, select them and press Media. See Downloading media for many characters.
  • Auto-Link Characters and Check All for Updates run in the tab that started them: keep it open until they finish. Media downloads run on the queue and pick up again after a reload.

Looks

  • A theme file carries your custom CSS too: Export saves the active CSS with the theme, and importing a theme replaces the active CSS when you save. See Themes, Custom CSS and theme extensions.
  • A token your custom CSS sets beats the same token in the theme; the theme editor marks such a setting Set in CSS. See How they stack.
  • The theme takes no pictures (a url( value is refused); a picture behind the whole app is a job for Custom CSS, and a picture behind one chat for its Background window. See Custom CSS.
  • clDisableCSS() in the browser's console switches custom CSS off for that tab until a reload, which tells you quickly whether your CSS is the cause of a problem. See Custom CSS.

Extensions

  • Chat Timeline opens from a chat's Timeline window, and from Chat Timeline in a character's card menu or a chat's menu in the Chats view. Double-click a point on it to open the chat there. See Getting more from the bundled set.
  • Swipes on the timeline draws each reply's unused swipes, and Take This Road starts a new chat from one of them. See Getting more from the bundled set.
  • On the timeline's map, / jumps to the search, the arrow keys walk from card to card, Enter opens the chat at the card, and Esc steps back (the style editor, the search, the card) before it closes the dialog.
  • Memory with Update after this many new messages at 0, and Trackers with Update after every reply off, update only when you ask, so they cost no model calls until then. See Getting more from the bundled set.
  • Translate into is only the default language: a chat can choose its own in its Translator window. See Getting more from the bundled set.

When something goes wrong

  • Starting the server with CL_EXTENSIONS=off loads the app with every extension switched off, so you can reach the one that broke it. See When an extension misbehaves.
  • After updating the server, reload the tabs you have open: a tab keeps the app it loaded, though it reconnects by itself after a restart. See Open tabs after an update.
  • ?server= with no value after the page's address forgets another server the page was pointed at. See Calling from another site.

The library

The Characters view is your library: every character you own, as a grid of cards. Searching and filtering it has its own page, Search and filters; one character's details are in Character details.

The grid

Each card shows the character's picture, its name, up to three tags, a gold star when it is a favorite, and a small badge when it belongs to a playlist (the playlist's own icon when it is in exactly one, a list icon otherwise; hover it for the names). Extensions can add chips of their own, such as a rating. On a computer, resting the pointer on a card shows a short excerpt of its creator's notes.

Click a card to open the character. The grid is one continuous scroll: it knows the size of the whole result at once and fetches cards as you reach them, so a library of any size scrolls the same way.

Display options, under Settings > General > Card Grid & Browse:

SettingDefaultWhat it does
Animate card info on hoveronHides the name and tags until you point at a card, then slides them up. Computers only.
Always show card nameoffWith the animation on, keeps the name visible and animates only the tags.
Hide playlist badges on cardsoffRemoves the playlist badge.
Prev/Next navigation in character detailsonLets you step through the grid from inside a character's details.

The card size follows the window and UI Scale (see Settings and themes). Which name a card shows follows Display name source (see Display names).

Sorting

The sort menu in the top bar orders the grid:

The sort menu open over the grid, listing the name, date and token count orders
The sort menu
  • Name (A-Z) and Name (Z-A)
  • Last Modified (Newest) and Last Modified (Oldest)
  • Date Added (Newest) and Date Added (Oldest): when the character entered this library
  • Date Created (Newest) and Date Created (Oldest): the card's own creation date
  • Token Count (High to Low) and Token Count (Low to High): the estimated size of the card's text
  • Random: a fresh shuffle every time the grid reloads

Extensions can add sort orders of their own; each appears in a group named after its extension. The sort you pick lasts for the session; the one the library opens with is Settings > General > View Defaults > Characters > Sort, beside Group favorites first, which pins favorites to the top, sorted among themselves.

Favorites

Mark a favorite from the star in a character's details (Add to Favorites / Remove from Favorites), from its card menu, or for a whole selection with the Favorite button. On a phone, swipe a card to the right.

To see only favorites, tick Favorites only under Search Settings (the sliders beside the search box), type fav:yes, or add a Favorite rule in Advanced Filters.

Playlists

Playlists are named lists of characters, each with an optional icon and colour. A character can be in any number of them.

  • Adding: Add to Playlist in a card's menu, or Playlist in the selection toolbar, opens a picker. Type in Search or create... to find a playlist, or press Enter on a new name to create it. Each row's box shows whether all, some or none of the characters are in it; click to add, or to remove when all are already in.
  • Filtering: the Playlists button in the top bar shows All Characters and each playlist with its count; picking one filters the grid and the button takes its name. playlist: in the search box does the same (see Search prefixes).
  • Managing: Manage Playlists at the bottom of that menu, below.
  • In a character's details: on a computer, the sidebar lists the character's playlists. Click one to filter the grid by it, or use Add to playlist and Remove from playlist right there.
Manage Playlists with one playlist, its controls numbered
Manage Playlists
  1. Search or create...: finds a playlist; press Enter on a new name to create it.
  2. Change icon: the playlist's icon and colour.
  3. The playlist's name: click it to rename it.
  4. Delete playlist: the characters stay in your library.

The Tags Manager

More Options > Tags Manager works on tags across the whole library, in three tabs.

The Tags Manager on Library Tags, with one tag's buttons showing, its controls numbered
The Tags Manager
  1. The tabs: Library Tags, Batch Tagging and Import Rules, below.
  2. Search tags....
  3. Sorts the tags by name or by how many characters carry them.
  4. A tag's buttons, shown when you point at its row: Rename tag, Show in grid and Delete tag from all characters.

Library Tags lists every tag with how many characters carry it. Renaming a tag to a name that already exists merges the two, and Esc cancels a rename without closing the manager; Show in grid closes the manager and filters the grid by that tag.

When tags differ only in capitals or spacing, a dupes chip offers Merge duplicates, with Merge or Merge + Add Import Rule (the second also maps the variants onto the kept spelling on future imports). Undo last bulk run reverses the most recent bulk tag change; it shows once there is one to undo.

Batch Tagging adds and removes tags on the characters you selected, or on every character in the current view.

Import Rules cleans tags as characters arrive from online sites: Strip emoji and decoration from imported tags, Clean whitespace on imported tags, Capitalize the first letter of imported tags, plus rules of your own that rewrite or drop a tag (Add Rule). Test a tag... shows what a rule set would make of a tag, and Apply to Library Now runs the rules over the tags you already have.

On a phone, tap a tag to see what you can do with it: Show in the Library, Rename (it asks for the new name) and Delete from Every Card. In Import Rules each rule is one line saying what it matches and what it becomes; tap it to edit it, to move it with Move Up and Move Down, or to Delete it, and tap Add a Rule at the end of the list for a new one. How Rules Work beside the first line explains the rest.

Tip

A rule's match can be a regular expression between slashes, and its replacement can use what it captured: /^(.+) \(OC\)$/ with the replacement $1 keeps the name and drops the suffix. An empty replacement drops the tag. Rules run top to bottom and the first match wins; local files are never rewritten. Undo last bulk run reverses a rename, a merge or a tag deleted everywhere too, and the undo can itself be undone.

Selecting many characters

Press Space on the Characters view (or pick Select for Batch from a card's menu) to start selecting; click cards to add or remove them. On a phone, use Select for Batch from a card's menu. Esc ends it.

The selection toolbar with two characters selected, its controls numbered
The selection toolbar
  1. How many characters are selected.
  2. Select All.
  3. The actions, in the table below.
  4. Delete.
  5. Ends selecting, as Esc does.

The selection toolbar:

ButtonWhat it does
Select AllSelects every character the current search and filters match, however many
TagsOpens the Batch Tag Editor: Current Tags, Add Tags, Remove Tags, then Apply Changes
Favorite / UnfavoriteAdds them all to favorites, or removes them
ExportOpens the export chooser (see Exporting many characters)
UpdatesChecks the linked ones for updates on their sites (see Update checks)
MediaDownloads their remote media in the background (see Downloading media for many characters)
PlaylistAdds them to a playlist
MoreHolds what does not fit, including actions extensions add
DeleteDeletes them, after a confirmation

Select All selects the view itself, not just the cards loaded so far: a search matching 40,000 characters selects all 40,000, and the toolbar's count comes from the server. Changing the search or filters clears the selection, so an action never lands on a set you have stopped looking at.

Tip

To act on all but a few, press Select All and then click the cards to leave out. The rest of the view stays selected, and the count follows.

A change to a large set runs on the server as a background job, a chunk at a time. Tag changes show their progress on the Apply Changes button and can be stopped with Cancel; what already landed stays. Every bulk tag change is journaled, so the Tags Manager's Undo last bulk run can reverse it. Deleting, favoriting and playlist changes report when they finish.

Deleting a selection asks first, names the first few characters, and says that each goes with its chats, gallery files, snapshots and provider links. If no search or filter is active, it warns that the selection is every character in your library. A delete over a filtered set is refused if the set changed since it was counted, and asks again.

The card menu

Right-click a card (on a phone, long-press it or swipe it left) for its menu:

The menu a right-click opens on a card in the grid
A card's menu

With several characters selected, right-clicking one of them shows the selection's menu instead: Edit Tags, Check for Updates, Download Media, Add to Playlist, Add All to Favorites, Remove All from Favorites, Export All, Delete All and Clear Selection.

Finding duplicates

More Options > Find Duplicates looks for characters that are probably the same card: names that match or nearly match, and the same card under a new name (its description and first message unchanged). It compares the creator, the creator's notes, the description, the first message, the personality and the scenario, and treats two characters linked to the same online page as the same, and two linked to different pages on the same site as different when their text differs; one the text cannot confirm is shown with that reason. Characters that only share a name, by different creators with different stories, are never paired. Each pair shows a Keep card beside a Potential Duplicate, with the fields that differ, side by side with every changed word marked, and the ones that match, rated from Possible Match through Similar, Very Similar and Near-Identical to Identical. Each card has View, Playlist and Delete; nothing is merged.

Find Duplicates comparing two copies of Elowen: the card to keep beside the potential duplicate, and the one field that differs
A near-identical pair, its one difference marked

Settings > General > Duplicate Detection > Minimum Match Score (20 to 120, default 35) sets how close a pair must be to show; lower shows more. At 120 the readout says Exact and only identical cards show, with an Add to Playlist button that collects all the newer or all the older copies at once.

Deleting from here is the same as deleting anywhere: the character goes with its chats and gallery.

The Card Recommender

More Options > Card Recommender asks one of your AI connections to pick characters from your own library. Type what you are in the mood for and press Recommend. The recommender draws a random sample of your library, sends each sampled character's name and a few short details to the model, and shows its picks with a reason for each.

The Card Recommender with three picks for a cozy night in, its controls numbered
The Card Recommender
  1. What you are in the mood for.
  2. Recommend.
  3. The connection and its Overrides.
  4. Settings, below.
  5. Add all to playlist.
  6. Reroll: asks again with the same request, leaving out what was already suggested.
  7. A pick's Add to playlist and Ask about this character, below.

The Settings button (the sliders) holds three groups:

  • Sample Pool: which characters can be sampled: Has Chats and Favorite (each Yes, Any or No), a Date Created range (tick Enable), and Include Tags / Exclude Tags. A line shows how many characters match.
  • LLM Context: what is sent about each character: tags, creator's notes, tagline, creator (on by default), description and source site (off by default). An estimate shows the request's size. Text is cleaned and cut short before sending; your chats are never sent.
  • Generation: Sample (how many characters are sent, default 100), Max (how many picks, default 10), Batch Mode (splits a larger sample across several requests and ranks the results in a final one), and Batches (3 to 7).

The connection and its overrides sit at the top (see Connections). Settings are remembered when you press Recommend.

Each result shows the character, its reason (click to read it all) and its tags; click the name to open the character.

Ask about this character on a result opens a small chat about that one card: the model reads its full text (and its lorebook, when you tick Include lorebook) and answers your questions.

The chat about one pick, its system prompt open, its controls numbered
Asking about a pick
  1. Chat settings: shows the system prompt, which you can edit.
  2. Load a Prompt...: a prompt you saved.
  3. Save current as a preset, Delete the selected preset and Reset to the default prompt.
  4. Your question.
  5. Send.

Notifications

The bell in the top bar appears only when there is something to show: a download running, an import working in the background, a backup, an extension's job, the search index being tidied, an update, or a failure. It shows a working icon while busy and a warning badge when something failed. On a phone it is Notifications in the More sheet, and the More button wears a dot while something runs, something failed or an extension update waits.

Its sections:

  • Media Downloads: the background media queue (see Background downloads), with Cancel this download, Retry and Dismiss for failures, and Clear finished.
  • Imports: characters importing in the background from the Online view, with Retry, Download media and Dismiss.
  • Library Backup: a backup copying, with its progress and Cancel the backup; a backup that failed, with Dismiss; and a scheduled backup that did not run, asking Back Up Now, Tonight or Skip (see Library Backup).
  • Extension Jobs: long work an extension runs, such as tagging characters with AI, with Cancel this job.
  • Maintenance: shown while the app tidies its search index in the background, which it does when the app sits idle and an index is in pieces, or when you ask in Search Index, naming the part it is working on (card text, lorebook entries or chat messages). Until it finishes, searches and the Related tab may be slower and the disk busier. It needs nothing from you and leaves on its own (see Keeping it that fast). Opening the notifications to read it, or coming back to the app, leaves it running; one the app started while it sat idle pauses at your next click, key or scroll elsewhere in the app.
  • Extension updates: for an admin who switched on Tell me when an extension has an update, the installed extensions with a newer version, each with the version you have and the one coming, and Open Extensions, which opens Settings at the first of them (see Keeping installed extensions up to date).
  • Project Σ update: for an admin who left Tell me when Project Σ has an update on, a newer version with a link to what is new, Update Now (or How to Update for a ZIP or Docker install) and Skip This Version; while an update runs, what it is doing; and for everyone, Reload once the server runs a new version (see Updating).

Extensions can add sections of their own. When nothing is going on the bell hides.

Search and filters

Search Everything finds anything in the app; everything after it on this page narrows the Characters grid, and the search box, the tag and playlist filters and Advanced Filters all combine: a character shows only when it passes every one of them. The server runs the whole query, so a search over a huge library costs about what it costs over a small one.

Search everything

Search Everything is one field for the whole app. Press the key under Esc, left of the 1 (` on a US keyboard, ^ on a German one, § on a Nordic one), anywhere outside a text field, or pick Search Everything at the top of More Options (on a phone, in the More menu).

Search everything with the text sky: a lorebook as the top hit, characters and messages below, and a preview of the top hit
Search everything

Type a few letters and it finds, grouped and best first:

  • your characters, with their portraits: by name, nickname and creator first, then by what their cards say (description, first message, personality, scenario, creator's notes, example messages, alternate greetings and the rest of their text);
  • your chats, by title or by character;
  • the messages in your chats that hold every word you typed (a single letter on its own does not count as a word), each shown with the words marked;
  • your lorebooks, by name;
  • the lorebook entries whose title or content hold every word you typed, each shown with its lorebook and the words marked;
  • your tags, playlists and personas;
  • every setting, by its label;
  • the views, the More Options items and every extension command that needs no input.

When a group holds more than it lists, its heading says Show all: click or tap it to see every result of that kind for what you typed, more loading as you scroll. Back, Esc or the phone's back button returns to all your results.

While a search is still running, an empty list says Searching; it says Nothing matches only once every part of the search has answered, and Could not search when part of it failed (try again).

The best match of all leads as the Top hit. On a wide window a preview beside the list shows the highlighted character's portrait, tags and notes, a chat's last message, the matched message, or the matched entry's text.

Enter does the obvious thing: it opens a character's details, opens a chat (a message's chat at that message), opens a lorebook in the Lorebooks manager (an entry's lorebook with that entry open and marked), shows a tag's or a playlist's characters, makes a persona yours, or opens Settings at a setting with the settings search already set to it.

Tab (or a right-click; on a phone, the ⋯ at the end of a row) opens what else you can do with a result. For a character: Open, Chat (their latest chat, or their first one), Add to favorites or Remove from favorites, Add a tag, Add to a playlist, Check for updates (for a character linked to a site) and Delete (which asks first). For a chat: open it, or open its character. For a tag: show its characters, or add it to the characters you have selected. For a lorebook entry: open it, or open its lorebook. For a persona: use it, or edit it in Settings.

Some actions ask for what they act on in the field itself. Chat with…, Open a lorebook…, Show characters tagged… and Search the library for… show their name at the start of the field; type, and pick from what it finds. Add a tag offers your tags and, when you type a new one, adds that. With characters selected, Add a tag to the selection… tags them all at once.

Esc (or the phone's back button, or Back) steps out of an action to your search, and closes the field from there. With nothing typed, the field leads with what you last opened from it, then those actions and the views.

Inside cards, messages and lorebook entries, a word is found when it starts with what you typed ("drag" finds "dragon"), and the search starts at the third letter. Each can be switched off under Settings > General > Search Everything: Search inside character cards, Search inside chat messages and Search inside lorebooks. All three are on to begin with; names, chats, lorebook names and the rest are always searched.

Type in the search box at the top. The grid follows as you type, waiting a moment between keystrokes (a little longer for one or two characters). The × in the box clears it.

What plain text matches is set by Search Settings, the sliders button beside the box:

Under Search inDefaultMatches
Character NameonThe card's name and its nickname
Listing NameonThe title the character has on its online page
TagsonAny tag containing the text
AuthoroffThe card's creator
Creator's NotesoffThe creator's notes, word by word (see below)
TaglineoffThe short tagline
Under Card text
DescriptionoffThe card's description, word by word
First MessageoffThe first message, word by word
Alt GreetingsoffEvery alternate greeting, word by word

Favorites only at the bottom of the same menu shows favorites alone.

The name, listing name, tags, author and tagline match what you type as one piece of text, anywhere inside the field, ignoring capitals.

Creator's notes and the card text are searched word by word, and search finds text inside words: every word you type must appear inside some word of the field, so agon finds "dragon" and witch finds "bewitched". Capitals and accents are ignored (cafe finds "café"). Typing several words finds the characters that have all of them, in any order and anywhere in the ticked fields. Put words in quotes to find them as a phrase: "red dragon" finds those two whole words side by side, in that order. Punctuation only separates words, so a search of punctuation alone finds no card text.

Card text is searched through an index, so it answers quickly at any library size. A word of one or two letters is the exception: it sits inside so many words that the search reads every card instead, which is slower.

With text typed and no field ticked, nothing matches.

These boxes reset when you reload; the ones the library starts with are Settings > General > Search Defaults, where the creator's notes box is called Creator Notes.

On a phone, the floating search button opens the search, and the sliders button in the bottom bar holds the sort, the favorites, tags and playlists filters, and a shorter Search in list.

Search prefixes

Prefixes filter by one property each. Type a prefix and its value with no space after the colon, at the start of the box or after a space. Several prefixes combine (a character must match all of them), and whatever text is left over is searched as above. Prefix names and values ignore capitals. A value runs to the next space, so it cannot contain one; use Advanced Filters for a multi-word value.

The library searched with creator:dxmpie, showing only that creator's characters
A prefix in the search box

Tip

Prefixes find what is missing as well as what is there: linked:no lists characters linked to no site, playlist:none the ones in no playlist, and version:none the ones without a version.

PrefixValuesShows
creator:textCharacters whose creator contains the text
favorite: or fav:yes or noFavorites, or the rest
linked:yes or noCharacters linked to any online site, or to none
version:text, or noneCharacters whose version contains the text, or that have none
uid:part of an idThe character with that id (the Info tab shows it)
playlist:a name, any or noneCharacters in a playlist whose name contains the text, in any playlist, or in none
chub:yes or noLinked to ChubAI, or not
janitorai: or jai:yes or noLinked to JanitorAI, or not
janny:yes or noLinked to JannyAI, or not
charactertavern: or ct:yes or noLinked to CharacterTavern, or not
pygmalion:yes or noLinked to Pygmalion, or not
wyvern:yes or noLinked to Wyvern, or not
datacat: or dc:yes or noLinked to DataCat, or not
botbooru: or bb:yes or noLinked to Botbooru, or not
risu:yes or noLinked to the RisuAI Realm, or not

For the yes-or-no prefixes, yes (or true) means yes and any other value means no. Extensions that add an online site add its prefix too.

An example: creator:ann fav:yes chub:no elf shows favorites by a creator whose name contains "ann", not linked to ChubAI, matching "elf" in the fields ticked under Search in.

The tag filter

Tags in the top bar opens the tag list, with Find tags... to search it and a button to sort by name or by how many characters carry each tag. Click a tag (or the button beside it) to cycle it:

The tag list sorted by use, with Fantasy and Royalty included and Angst excluded
Two tags included, one excluded
  • Included (a tick): only characters with this tag.
  • Excluded (a minus): characters with this tag are hidden.
  • Neutral: no effect.

Once a tag is active, two switches appear above the list:

  • Match Any, which a click turns to Match All: whether a character needs any one of the included tags, or all of them.
  • Hide All, which a click turns to Hide Any: with Hide All (the default) a character is hidden only when it carries every excluded tag; with Hide Any, one excluded tag is enough.

Both choices are remembered. The Tags button shows the active counts, and Clear all tag filters (the ×) resets them. Tags you have activated stay at the top of the list.

The playlist filter

Playlists in the top bar filters the grid to one playlist; All Characters goes back to everything. See Playlists.

Advanced Filters

The funnel button () in the search box opens Advanced Filters: rules built from a field, an operator and a value, all of which must hold.

Advanced Filters with one rule, description contains tea, and its presets open, its controls numbered
Advanced Filters
  1. Presets: saved sets of rules, below.
  2. Clear All: empties the panel.
  3. Filter or name new preset... and its save button. See Filter presets.
  4. A rule: its field, its operator and its value.
  5. Removes the rule.
  6. Add Filter: adds a rule.
FieldOperators
Name, Nickname, Listing Name, Creatorcontains, does not contain, equals, starts with, is empty, is not empty
Tagsincludes, excludes
Creator Notes, Description, Personality, Scenario, First Message, Example Dialogue, System Prompt Text, Post-History Instructions, Character's Notecontains, does not contain, is empty, is not empty
Favoriteyes, no
Provider Linkis linked, is not linked, linked to (a site), not linked to (a site)
Linked Lorebookis linked, is not linked, contains, does not contain, equals
Date Added, Date Created, Date Modifiedbefore, after (a date), in the last (a number of days)
Last Chatbefore, after, in the last, never
Versioncontains, is empty, is not empty
Token Countmore than, less than, equals
Playlistin, not in, in any, not in any
Name Overrideyes, no, to card name, to listing name
Embedded Lorebookyes, no
Alt Greetingsmore than, less than, equals (a count)
Card Spec (e.g. 3.0)equals

Extensions can add fields of their own (the Ratings and Notes extension adds Rating), grouped under the extension's name, with is set and is not set besides their own operators.

Filter presets

Presets at the top of the panel saves and loads sets of Advanced Filter rules. Type a name in Filter or name new preset... (up to 40 characters) and press Enter or the save button; the same box filters the list when you have many. Click a preset to load it, or its × to delete it. A preset holds the Advanced Filter rules only, not the search text, tags or sort.

The Characters and Chats views keep separate preset lists. To open the library with a preset applied, pick it in Settings > General > View Defaults > Characters > Filter preset.

Searching chats

In the Chats view the search box matches the chat's name and the character's name. To search inside messages, use Advanced Filters, which has its own fields there:

FieldOperators
Character, Chat Namecontains, does not contain, equals, starts with
Messagesmore than, less than, equals (a count)
Message Textcontains, does not contain
Last Messagebefore, after, in the last
Char Favoriteyes, no
Char Tagsincludes, excludes
Char Provider Linkis linked, is not linked, linked to, not linked to
Char Playlistin, not in, in any, not in any
Chat Lorebookis not empty, is empty, contains, equals

Message Text searches by words: every word you type must appear in the same message, each matching the start of a word, ignoring capitals and accents. A single letter on its own is passed over, while a number and a single Chinese, Japanese or Korean character count, matching the words that start with them.

Searching online

Each online site has its own search box, sorts and filters in the Online view. See Browsing online.

Built for speed

Project Σ is fast. Really fast. Here are typical answer times on a real library of 17,417 characters, with 292 chats holding 25,917 messages, 178 lorebooks holding 3,202 entries, and 13,560 tags, on an everyday desktop PC:

What you askAnswered in
Search Everything: characters, card text, chats, every message, lorebooks, every entry and tags, all at onceabout 10 ms
Every card whose text mentions "forest" (2,175 of them)7 ms
Every chat message holding a word1 to 3 ms
The search box, "el" across names and tags (2,697 matches)14 ms
An Advanced Filters rule looking for a name anywhere in Description29 ms
Related Characters for a cardabout 35 ms

A blink of an eye takes 100 to 400 ms. Every one of these answers comes back well before you finish blinking.

Keeping it that fast

To stay this quick, Project Σ looks after its search index on its own. Once a big import, a SillyTavern migration, an update or everyday edits have left it in pieces, it tidies the index in the background the next time the app sits idle for two minutes, and pauses the moment you click, type or scroll again, so you never wait on it. A tidy-up takes seconds on a small library and can take several minutes for tens of thousands of cards on a hard drive; it picks up where it left off until it is done. The bell tells you while it runs, so you always know what is going on behind the scenes:

The notifications bell during a tidy-up: Maintenance, Tidying the search index, working on card text
A tidy-up in the notifications

There is nothing to do and nothing to wait for. The row leaves on its own when the tidy-up is done. To see how tidy each index is, or to tidy it yourself, open Search Index in the settings.

Character details

Click a card in the grid (or pick Open Character from its menu) to open the character's details. The window opens on the Details tab and fills in as the card's text arrives.

The details window

The details window for Kettle, its controls numbered from the star to the tabs
The details window's controls
  1. Toggle Favorite: adds the character to your favorites, or takes it off.
  2. Delete Character. See Deleting a character.
  3. Chat: resumes the character's latest conversation, or starts its first.
  4. The picture: click it to view it full size, with the gallery after it.
  5. The tags; a +N pill shows the rest.
  6. The character's playlists; Add to playlist puts it in another.
  7. The tabs: Details, Edit, Chats, Gallery and Related, plus Info when it is switched on and any tabs extensions add.

On a narrow window, the tabs that do not fit wait behind More tabs. On a phone the sidebar (4 to 6) folds away: tap the round picture in the header to view it, the tags move into the Edit tab, and you swipe the tab content left or right to change tab.

Stepping to the next character

With Prev/Next navigation in character details on (the default), you can move through the grid without closing the window: the chevrons at its sides on a computer, ← and → on the keyboard, or a swipe across the header on a phone. The order is the grid's current sort and filters. If you have unsaved edits, you are asked first.

The Details tab

The line under the header shows:

  • Created, the date the character entered your library (or the card's own date when that is unknown).
  • Author, the card's creator: click it to search the library for that creator.
  • The link chip: Link when the character is not linked to an online site (click to link it), or the site's name when it is, with a lock when update checks are switched off for it. See Linking characters to their source.
  • The name toggle (see Display names).

Below come the site's tagline (when Show provider tagline in character details is on), Creator's Notes, Description, First Message, Alternate Greetings, the card's own lorebook (Embedded Lorebook), and the lorebooks linked to the character (Linked Lorebooks). Click a title to open long text full screen; the creator's notes and the greetings also have zoom controls there.

Creator's notes are often written in HTML with their own styling. With Rich creator's notes rendering on (the default) they render in a sealed frame that keeps their styling away from the app; off, they show as plain formatted text. Expand creator's notes by default opens them on every character. Both are under Settings > General > Character Details, with Allow rich tagline display for HTML taglines.

When media localization is on, links in the card text to images you have downloaded show your local copies (see Media).

Display names

A character can have up to three names: the card's own name, a listing name (the title on its online page) and a nickname you give it. Settings > General > Display Names > Display name source picks which one the grid and the details show (Card Name, Listing Name or Nickname), falling back to the card name when the chosen one is empty. Nothing about the card changes; it is only what you see.

For one character, the name toggle on the Details tab (Card, Listing or Nickname) cycles through the names it has and remembers your choice for that character. It shows when the character has at least two different names and Show name type toggle in details is on. The Name Override rule in Advanced Filters finds the characters you set this way.

Editing

The Edit tab opens locked, so nothing changes by accident. Press Unlock Editing to edit; Lock Editing locks it again. Fields, in the tab's groups:

The Edit tab, locked, with Unlock Editing and Versions above the card's fields
The Edit tab
GroupFields
Basic InformationCharacter Name, Creator / Author, Character Version, Tagline, Nickname, Listing Name
Character DefinitionDescription / Persona, Personality Summary, Scenario / Setting
MessagesFirst Message, the alternate greetings (one box each, Add Greeting for more), Example Dialogue (for training context)
Advanced (Prompt Overrides)System Prompt (Main Prompt Override), Post-History Instructions (Jailbreak), the Character's Note with its depth and role, Creator's Notes (For users, not sent to AI)

The Character's Note is a standing reminder sent inside the chat, a few messages from the end: Note Depth is how many turns back (4 when left blank; a depth below 0 sends nothing) and Note Sent As is the role it speaks with. An empty note removes it.

More ways to edit:

  • Expand all fields to fit content grows every box to its text.
  • Expand editor on a long field opens it full screen, with Apply to bring the text back. Creator's notes there have a preview.
  • Edit all greetings in expanded view puts the first message and every alternate greeting in one window, with Collapse All, Expand All, Add Greeting and Apply All.
  • Tags: on a computer, type in Add tag... in the sidebar (existing tags are suggested, and Create makes a new one); the × on a tag removes it. On a phone, Edit Tags opens a sheet.
  • The picture: with editing unlocked, click the portrait (Change Image), or tap the header picture on a phone, and pick a PNG, JPEG or WebP up to 10 MB. It shows as pending until you save; the × reverts it. Saving converts it to PNG; picking a card PNG as the picture changes only the picture, never the card's text.
  • Lorebooks: the Linked Lorebooks and Embedded Lorebook sections are described in Lorebooks. Linking and unlinking a lorebook happens at once; edits to the embedded book land with Save Changes.

Saving

Save Changes shows every changed field, old above new with the change highlighted, and Confirm Save writes them. With Auto-snapshot before edits and updates on (the default), the character as it was is saved to its version history first (see Version history), so a save can be undone. Cancel throws your edits away.

Closing the window, stepping to another character, or pressing Esc with unsaved edits asks first (Discard or Keep Editing).

The Chats tab

Every chat with this character: its name, when it was last active, its message count, and the lorebooks bound to it. Click a chat to open it. New Chat starts a fresh one. The row buttons bind lorebooks to a chat, open it, or delete it. See Chats.

The character's images, videos and audio. Drop files onto Drop files here to add to gallery (or click it) to add them, and press Download Media to fetch the remote images the card links to. See Media and galleries.

Related Characters lists characters that may share a universe or themes with this one, strongest first. Three switches choose what counts:

The Related tab for Elowen, related characters grouped by strength with their reasons
Related characters, strongest first
  • Shared Tags: tags in common, a rare tag counting for much more than a common one. A tag most of your library carries is ignored, and spellings that differ only in case, spaces, dashes or underscores count as one tag.
  • Same Creator: a character by the same creator gets a small lift, more when that creator has few characters. At most five characters by one creator are listed, so a prolific creator never fills the tab.
  • Content Similarity: the rare words both characters use in their description, personality, scenario and first message, such as names and places. A word much of your library uses does not count, so this reads best in a larger library.

Results are grouped as strongly, moderately and possibly related, each with its reasons ("Both mention Hyrule, Sheikah", the shared tags, the same creator). Copies of one character show once, with a Copies button that counts every copy and opens a list of up to eleven of them (the one shown and ten more), each with its creator, when it was added and its length: pick one to open it. Two characters count as copies when the duplicate check would call them the same character, never just for sharing a name. Click a result to open it in place.

Version history

Every character keeps a history of snapshots: copies of the whole card as it was at a moment. Open it with Versions next to Unlock Editing on the Edit tab, Version History in the card menu, or Version History in the link window.

Elowen's version history: three snapshots, one compared with the character as it is now, the changed line of the description marked
A snapshot compared with now

Snapshots are saved:

  • automatically before an edit, an update from the character's online page, linking and unlinking, while Auto-snapshot before edits and updates is on (Settings > General > Version History, on by default), and before every restore whatever the setting;
  • whenever you press Save Snapshot and give it a label.

An automatic snapshot that cannot be saved never holds the change up: the change goes ahead, and a warning names the character that was changed without one (one warning for a whole batch).

Automatic snapshots are capped per character by Max auto-backup snapshots per character (10 by default, 0 for no limit); the oldest automatic ones go first, and ones you saved by hand are never removed. An automatic snapshot that would be identical to the previous one is skipped.

The Chat Assistant saves the card before each change it writes, as a snapshot marked with a wand. These keep a limit of their own, Max Chat Assistant snapshots per character (10 by default, 0 for no limit), so a long session with the assistant never pushes out your other automatic snapshots, and edits of your own never push out the assistant's.

Click a snapshot to compare it with the character as it is now: every field that differs, long text as a line-by-line diff, tags as added and removed, greetings one by one, the embedded lorebook entry by entry, and the picture (with Apply Avatar to take just the picture back). Snapshots you saved can be renamed and deleted.

Restore puts the character back to that snapshot. The state before the restore is kept with the character until the next restore, so Undo reverts it whenever you come back, after a reload too; its confirmation shows when that copy was taken, and anything you edited since goes with it. Restoring changes the card's text and its embedded lorebook, not its picture or its linked lorebooks.

For a character linked to ChubAI, the history has a second tab, Remote, listing every published version of the card on ChubAI (and the page's current state), which you can compare and restore the same way. When the page's linked lorebook cannot be read from ChubAI, its comparison says so and shows no lorebook difference, and restoring it keeps the character's lorebook as it is. No other site publishes version history.

The Info tab

Switch on Show "Info" tab in character modal under Settings > Developer to see an Info tab with the card's technical details: its id (what uid: searches), its link, its lorebooks, media counts, token estimate, card spec, dates, the data extensions stored on it, and Copy Raw Card Data.

Deleting a character

The bin in the header, or Delete Character in the card menu, deletes a character after a confirmation that counts what goes with it; a count it could not read is said, never left out. Deleting removes the character together with its chats, its gallery files, its version snapshots and its links to playlists, tags and lorebooks. The lorebooks and playlists themselves stay. There is no undo, so export the character first if you might want it back.

When it changes somewhere else

If the open character is saved in another tab or on another device, a Changed elsewhere band appears with Reload. If it was deleted elsewhere, the window says so and closes.

Importing and exporting

Import Characters

More Options > Import Characters (on the Characters view) brings characters in from links or files. Pick the source at the top:

Import Characters on the URLs tab with three character links pasted, and the import options below
Importing by link
  • URLs: paste one character page link per line, from any online site you have switched on (see Browsing online). Each link is fetched from its site and imported with its link kept, so update checks work later.
  • Local Files: drop files onto Drag & drop card or bundle files here, or press Browse Files. Accepted:
    • card PNGs (V1, V2 and V3 cards, up to 100 MB). When a card carries both a V2 and a V3 copy of itself, the V3 copy is the one imported, and anything only the V2 copy holds is kept too. A RisuAI card's packed-in images (expressions, backgrounds) go into the character's gallery, and stay inside the card's picture, so an exported card still carries them back to RisuAI;
    • CHARX files: the card, its main picture, and its other images, which go into the character's gallery;
    • a Project Σ bundle (.zip), which opens the bundle review instead (see Importing a bundle).

Options under the source:

OptionDefaultWhat it does
Skip duplicates (already in library)onSkips a link to a page one of your characters is already linked to, or listed twice
Auto-download galleryfollows Include Provider GalleryDownloads the gallery from the character's site after importing
Auto-download embedded mediafollows Replace remote URLs with local filesDownloads the images the card links to (see Media)

Press Import. A progress bar and counts of imported, skipped and failed cards follow, and a log lists each one. When a file matches a character you have but its content differs, you are asked whether it is a new copy (Import as Copy) or not (Skip). Closing the dialog during an import asks whether to stop.

If the duplicate check itself cannot run (the server could not answer it), the import stops to ask once: Import Without Checking brings in this card and the rest of the run unchecked, each marked "not checked for duplicates" in the log; Skip Them skips every card the check could not look at, with the reason in the log.

Imports never overwrite a character you already have. To replace one deliberately, use Replace with This Card when an online import warns of a duplicate (below), or restore an older version from Version history.

JSON card files are not accepted; a card JSON's lorebook can be imported on its own in the Lorebooks manager.

A link that no site recognizes (a file link on an image host or a chat attachment, say) is skipped, with a note pointing at Settings > General > Imports > Import unrecognized URLs as direct downloads. With that on, such a link is downloaded as a file and imported if it is a card PNG or CHARX. Links to private or local network addresses are never fetched.

Tags on import

Tags on characters imported from online sites pass through the Tags Manager's import rules first (see The Tags Manager).

The duplicate warning

Importing from an online preview first looks for the character in your library: by its online page, by its name (every character of that name, however common), by its creator, and by its text, so the same card under a new name is found too. A character you own from another page on the same site is compared by its text: a different card by the same creator is left out, and one the text cannot confirm (a hidden definition, say) is shown with that reason. Matches below the minimum score of Find Duplicates are left out once their text has been compared, so the two use one setting; a character linked to that very page, and a match with no text to compare, are always shown. A card wearing a Possible Match badge always gets the window, even when the full check finds nothing closer. When something similar is there, a Potential Duplicate Found window shows the matches, each rated as in Find Duplicates with the reason, with:

  • Skip Import: nothing happens.
  • Import Anyway: the card comes in as a separate character.
  • Replace with This Card: the character you pick keeps its chats, tags, favorite, gallery and anything extensions keep on it; its card text and picture (embedded lorebook included) become the new card's. The card it had is saved in its version history first. If the new card carries different regex scripts than the ones you allowed, they stay off until you allow them again.

If the check cannot run, a Duplicate check failed window gives the reason and asks before anything comes in: Import Anyway or Cancel.

Exporting one character

Export Character in a card's menu downloads the character as a card PNG. The file carries the card's text, its tags, its embedded lorebook, its link to its online page, the name of its first linked lorebook, and an id that lets this app recognize it again. It does not carry favorites, chats, the gallery or further linked lorebooks; a bundle does (below).

With Settings > Developer > Export Character downloads set to CHARX (Card and Gallery), Export Character downloads a CHARX file instead: the card as a V3 card, its picture, and every file in its gallery (images, videos and audio), which apps that read V3 cards open with the gallery. The card in your library does not change. Importing your own CHARX back gives the card exactly as it was, so it is recognized as already in your library; if another app has edited the file since, it comes in as the V3 card it became.

With Settings > Developer > Export as provider links on, Export Character copies the character's online page link to the clipboard instead of downloading a file. Characters with no link are skipped.

Exporting many characters

Select characters (see Selecting many characters) and press Export in the toolbar. The chooser offers:

  • Full Bundle (.zip): cards, every chat and every gallery file in one archive, for moving characters to another Project Σ library. With Include linked lorebooks in the full bundle (on by default) their lorebooks travel too.
  • Character Cards (.png): one PNG per character, as above.
  • Character Cards with Gallery (.charx): one CHARX per character, as above, each with its gallery.
  • Provider Links: the online page links of the linked characters, copied to the clipboard.

A progress bar follows, with Cancel. Bundles can be large: everything is packed on the server first, then downloaded. Export All in the selection's right-click menu skips the chooser and exports the card files Export Character downloads picks (or links, with Export as provider links on).

A bundle holds the cards, the chats (as SillyTavern-style JSONL files), the gallery files and the lorebooks. It does not hold version history, playlists, personas, settings, connections, prompt presets, chat backgrounds, or data that extensions keep (ratings, notes, trackers and the like).

To back up a whole library, use Library Backup and copy the data/ folder; a bundle is for moving characters, not a full backup.

Importing a bundle

Drop a bundle .zip into Import Characters > Local Files. The Import Bundle review lists every character in it (those you already have are marked In library), with how many chats and gallery files each brings, and a box for the bundled lorebooks. Untick what you do not want, then press Import.

A bundle never overwrites:

  • A character identical to one you have is reused, and the bundle's new chats and gallery files attach to it.
  • A character that has changed since (a different version of one you have) is skipped and listed. Afterwards, a button imports those as copies if you want them.
  • A bundled lorebook identical to one you have is reused; a different book with the same name comes in as "Name (2)".

Each character lands completely or not at all. Bundles made by the Character Library extension for SillyTavern are refused; bring that data across with the migration instead.

Chats

Single chat files cannot be imported through the app. Chats arrive inside bundles and through the SillyTavern migration. Each chat exports on its own as JSONL from the conversation's options menu (see Exporting a chat).

Creating characters

More Options > Create Character opens the character creator: a form for a new card, and the Studio, an AI design partner that talks the whole draft through with you. The Studio needs a connection (see Connections); the form does not.

The form

On a computer the picture and tags sit on the left and the fields on the right; on a phone they stack, with Import and Studio buttons at the top.

Create Character with a name typed in, its controls numbered
The form's controls
  1. Opens the Studio. See The Studio.
  2. Expand all fields to fit content: grows every box to its text.
  3. Click or drop an image: any common image type, up to 20 MB. Without one, the card gets a plain placeholder.
  4. Suggest tags from the draft: asks your connection for tags that fit the draft and shows them as Suggestions, with Add All.
  5. Add tag...: your library's tags are suggested as soon as you click in and narrow as you type; click one (or light it with the arrow keys and press Enter) to add it, or press Enter to add what you typed.
  6. Work on this field in the studio, beside each field. See Working on one field.
  7. Import from Library. See Starting from a character you have.
  8. Create Character.
  9. The other ways to save. See Saving.
  • The fields: Character Name (the only required one), Creator / Author, Version, Tagline, Description / Persona, Personality Summary, Scenario / Setting, First Message, Alternate Greetings (with Add Greeting), Example Dialogue, System Prompt (Override), Post-History Instructions (Jailbreak) and Creator's Notes (Not sent to AI), which has a rendered preview.

The creator has no lorebook, nickname or Character's Note fields; add those in the character's details after creating it.

Starting from a character you have

Import from Library loads an existing character into the form: its text, tagline, greetings, tags and picture. From there you can make a variation as a new character, or save your changes back over the original. If its picture could not be loaded, a warning says so and the form is left without one: add a picture before Create Character, or the character is saved without one.

When you then press Create Character, a Carried Over dialog lists what the imported character has that the form has no fields for: its embedded lorebook, its Character's Note, its other card settings and its gallery, each with a switch, all on. Create Character there gives the new character the parts left on, and copies the gallery's files into the new character's own gallery; Back returns to the form without creating anything. Its link to a character site and its linked lorebooks stay with the original. Saving over a character never carries these parts.

Saving

  • Create Character always creates a new character, then opens its details.
  • The arrow beside it saves over an existing character instead: Save Over the character you imported from, or Save as Existing Character... to pick any character. Either shows Review Changes, every field that will change, before Save Changes. With Auto-snapshot before edits and updates on, the character's previous state is saved to its version history first.

Closing the creator with work in it asks first. The form itself is not saved between visits, but a Studio conversation keeps the draft it was working on (below).

The Studio

Open it with the wand at the top of the creator (on a phone, Studio). It is one conversation about the whole card: you talk about who the character is, and it reads the current draft every time you send.

The Studio beside the form with three proposed changes, its controls numbered from the wand to Send
The Studio's controls
  1. The wand at the top opens and closes the Studio.
  2. Work on this field in the studio, beside each field. See Working on one field.
  3. Session: the Studio conversations about this draft. See Sessions.
  4. New conversation, Rename this conversation and Delete this conversation.
  5. What it can see: the draft and the reference cards it is sent. See What the Studio sees.
  6. Studio settings. See Studio settings.
  7. A proposed change's own buttons: Show the changes side by side, Touch up the text before applying, Apply this change now and Set this change aside. See Proposed changes.
  8. Apply Selected: applies the ticked changes to the form.
  9. What your next message is about: Whole Card, or the field you are working on; and Add reference cards.
  10. Saved prompts: picking one fills the box, it does not send.
  11. Attach pictures, below.
  12. Send.

When the conversation is empty it offers starting points, such as fleshing out a rough idea or drafting the card from what you have. Type in Talk about the character... and send with Enter (on a phone, use the send button). The saved prompts start with Draft the card, Suggest tags and Three greetings, and hold any you add.

The paperclip beside Send shows the Studio pictures, for example to write the appearance from a portrait or to build a character from reference art: Pictures from this device, or The draft's picture (the one in the form, saved or not). You can also paste or drop pictures. They are kept with the Studio conversation and deleted with it. The paperclip shows only when the Studio's connection is set as seeing pictures.

Working on one field

Each field in the form has a wand (Work on this field in the studio). Clicking it points your next message at that field. Select part of a field's text first and the next message revises just that passage.

Proposed changes

When the Studio suggests text for the card, it arrives as proposed changes under Proposed changes, not as edits already made. Each change says what it does (writes a field, replaces a passage, changes tags, adds a greeting). For each you can compare Now and Proposed side by side, touch the text up, apply it on its own, or set it aside. Apply Selected applies the ticked ones. Applying changes the form only; nothing is saved to your library until you press Create Character or save over a character.

A change that cannot be applied as written (marked in yellow or red, with the reason) offers Try again : the Studio is told what went wrong, re-reads the draft as it is now and proposes the change again, or says it does not fit any more. A reply with several such changes also offers Try All Again in its footer. Once the Studio has replied again, it is not shown the changes of an earlier reply you left unapplied, so it only builds on what is in the form.

Every message can be copied, edited (Edit this message), asked again from that point (Ask again from here), or deleted.

Sessions

Studio conversations are saved on the server with the draft they were about. The session menu at the top switches between them, starts a New Conversation, renames or deletes one. Switching to a session whose draft differs from the form asks Restore this conversation's draft? When you create the character or save over one, its sessions move to that character, so you can pick the conversation up again later.

What the Studio sees

The context view shows what is sent: The draft (every filled field) and, optionally, Reference cards drawn from a playlist of yours, as examples of what you like. Budget (tokens) caps how much of the reference cards is sent (2500 by default).

Studio settings

The gear (Studio settings) holds:

  • the connection the Studio uses and its overrides (see Connections);
  • Format as it streams: Same as Chat (the switch in Chat settings), On or Off, for whether an unfinished code block shows as a box while a reply arrives (other blocks and tables appear as soon as they are whole either way). It is greyed out while Stream the reply is off under Overrides. A reply shown as it is written follows to the bottom; scroll up and the view stays where you are, and scroll back to the bottom to follow it again;
  • Studio prompt: your own description of the Studio's role, in place of the built-in one (Load the Built-In Prompt to start from it, Back to Built-In to return). The notes on writing each field, the rule that keeps the draft's text quoted rather than obeyed, and the instructions for proposing changes are always added;
  • the saved prompts list;
  • Context budget (tokens): a ceiling on the whole request, 0 for none. Over it, the oldest messages of the conversation are left out; the draft and the reference cards are always sent whole.

Changes apply to the next message you send.

Media and galleries

Every character has a gallery: images, videos and audio kept with it on your server. Card text often links to images hosted elsewhere, and those links break when a host deletes them; downloading them into the gallery keeps the card whole.

A character's Gallery tab shows its images and videos in a grid, and audio files in their own section with players. Click a tile to open the viewer. Large galleries are split into pages.

The Gallery tab of a character with five images, and Download Media
A character's gallery

To add files, drop them onto Drop files here to add to gallery, or click it to pick them: images, videos and audio are accepted. A file identical to one already in the gallery is not stored twice. A file whose name says the wrong kind (a video named like a picture, say) is stored and shown as what it really is.

Right-click a file (on a phone, press and hold it) for its menu: Open shows it in the viewer, Download saves it, and Delete removes it from the gallery for good, after asking.

The gallery shows images (PNG, JPEG, WebP, GIF, AVIF), video (MP4, WebM, MOV) and audio (MP3, OGG, WAV, M4A, FLAC).

The viewer

The full-screen viewer opens from a gallery tile, from View Gallery in a card's menu, or from the character's picture (it opens on the picture, with the gallery after it).

The viewer on Kettle's picture, its gallery in the strip below, its controls numbered
The viewer
  1. Which item of how many.
  2. Open in new tab: the file on its own.
  3. The previous item (or ←, or a click on the image's left half).
  4. The next item (or →, or a click on the image's right half).
  5. The strip: jumps to any item. Videos play muted and looping, with their controls.

The mouse wheel zooms (up to 5 times), dragging moves a zoomed image, and clicking it or pressing 0 resets the zoom. Esc closes the viewer.

On a phone, swipe to step and double-tap to zoom.

A chat has its own gallery window beside the conversation; see Chat windows.

Downloading a card's remote media

Download Media on the Gallery tab (or in a card's right-click menu) downloads what the card links to into its gallery, in up to four passes:

  1. Embedded Media: images, audio and video linked from the card's text (description, first message, alternate greetings, scenario, creator's notes and the rest).
  2. Lorebook Media: the same from the embedded lorebook's entries, when Include Lorebook Media is on.
  3. The site's own gallery, for a linked character on a site that has one.
  4. External Galleries: albums and folders on image hosts that the card links to (below).

From the Gallery tab a window shows the download: a log of each file, so you can see why one failed. From a card's right-click menu it joins the background queue instead and you carry on. Either way, files you already have are skipped, by link and by content, so running it again only fetches what is new. Downloads go through your server; links to private or local network addresses are never fetched.

With Replace remote URLs with local files on (Settings > Media, on by default), the card's text shows your downloaded copies in place of the remote links: in the character's details and in chats. The card's text itself is not changed.

Downloading media for many characters

Select characters and press Media in the selection toolbar, or right-click one of them and pick Download Media. Each selected character with remote media or a site link joins the background queue, whatever the media setting says, and a message says how many were queued and how many had nothing to download. A selected character is scanned again even if its media was downloaded before, so new links are picked up.

Settings > Media > Bulk Operations > Download Media for All Characters queues every character in your library the same way. Characters already done are remembered and left out (Clear Processed History forgets that, so the next run goes over everything again). The notifications bell follows each download, and the queue carries on after a reload.

Media settings

Settings > Media, in its URL Replacement and Options groups:

SettingDefaultWhat it does
Replace remote URLs with local filesonShows downloaded copies in place of remote links
Include Provider GalleryonDownloads the site's own gallery for linked characters
Include Lorebook MediaoffAlso scans the embedded lorebook's entries
Include External GalleriesonFollows links to albums on image hosts
Fast skip (filename match)onSkips a site gallery file that is already there by name, without downloading it to compare
Import in the backgroundonOnline imports return at once and finish in a queue (see Browsing online)
When an import has extra mediaDownload in the BackgroundOr Ask Me (Show a Download Prompt), or Do Nothing

Civitai API Key (its Key) and Pixiv Login (your Pixiv PHPSESSID cookie) unlock content on those hosts, each with Test Connection; they are kept on your server. Save and Test Connection both hand over what you typed first: a key or cookie the server refuses (too long, or more than the session value) is said, and nothing is tested or saved.

When a card links to an album or folder on one of these hosts, the downloader opens it and fetches the images inside:

HostWhat it opensNeeds
Catboxalbumsnothing
Civitaiposts and imagesnothing for public posts; the API key for private or hidden ones
Dropboxshared folders and filesnothing
Google Driveshared foldersnothing
ImgBBalbums and image pagesnothing
Imgboxgalleriesnothing
Imgchestpostsnothing; a password-protected post works when the card's text holds the password
MEGAshared foldersnothing
Pixivartworksnothing; R-18 works need the Pixiv login, with R-18 viewing on in your Pixiv account (when the saved login cannot be used, an R-18 artwork's error says so: paste the PHPSESSID value again)
PostImggalleriesnothing

Background downloads

By default (When an import has extra media set to Download in the Background), the media of every online import is queued and downloaded one character at a time while you carry on. To be asked first instead, or to skip the media, change that setting under Settings > Media. The notifications bell follows the queue: the current download's progress (with Cancel this download), what is waiting, failures with Retry and Dismiss, and Clear finished. The queue survives a reload: unfinished downloads resume on the next visit, skipping files already fetched.

Thumbnails

The grid, the gallery and chat lists show small copies of images, made by the server the first time each is needed and kept on disk, so a large library scrolls smoothly; the viewer and the details always show the full image. There is nothing to set up.

A freshly imported or migrated library makes its thumbnails as you first browse it, which can feel slow once. Settings > Media > Bulk Operations > Generate Missing Thumbnails makes them all ahead of time.

Limits

A gallery upload or a downloaded file can be up to 200 MB; a download gives up after a minute. A card picture can be up to 10 MB when you replace it in the editor, and a persona picture up to 25 MB.

Chats and the conversation

Chats need a connection to an AI model; see Connections. Everything else on this page, such as reading, searching and exporting chats, works without one.

The Chats view

Chats in the view switcher lists every chat across your library, newest activity first by default, loading more as you scroll. Its controls in the top bar:

The top bar on the Chats view, its controls numbered
The Chats view's top bar
  1. The search box, which matches chat and character names. See Searching chats.
  2. Advanced Filters, with fields for chats.
  3. The sort: Most Recent, Oldest First, Character (A-Z), Character (Z-A), Most Messages, Least Messages, Most Chats (Character).
  4. The grouping: Recent, by time (one list) or By character (a collapsible group per character).
  5. The layout, for the single list: List (compact rows with date bands such as "Today" and "This week") or Cards (larger tiles with a preview).
  6. Refresh Chats.
  7. More Options.
The Chats view: the latest chat large at the top, the rest grouped by day
The Chats view

The sort and grouping it opens with are Settings > General > View Defaults > Chats; the layout is remembered when you change it.

Each chat shows the character's picture, the chat's name, when it was last active, the character's name (click it to open the character), the message count, and the start of the last message. A chip shows when the chat is played as a different persona from your usual one, and Draft when you left an unsent message in it. With the list sorted by Most Recent and no search, the latest chat sits on top as a large Continue card.

Click a chat to open it. Right-click it (on a phone, long-press it or use its ⋮) for Open Chat, Lorebooks (bind lorebooks to this chat, see Lorebooks) and Delete Chat. On a computer, pointing at a chat also shows its lorebook and delete buttons.

Searching chats, including the words inside messages, is covered in Search and filters.

Starting a chat

  • Chat in a character's details resumes that character's latest chat, or starts the first one.
  • New Chat on a character's Chats tab always starts a fresh one.
  • Inside a conversation, New Chat in the options menu starts a fresh chat with the same character.

A new chat opens with the card's first message; the card's alternate greetings are the first message's alternates, so you can swipe through them before you reply.

The conversation

A conversation with Kettle, its controls numbered from Back to chats to Send
A conversation's controls
  1. Back to chats: closes the conversation (below).
  2. The character and the chat's name: click the name to open the character's details, the picture for its gallery.
  3. The chat windows: Personas, Assistant, Gallery, Background, Inspect the prompt, Lorebooks, Connections, Prompt manager, Regex scripts and Chat settings. Each is described in Chat windows. Extensions you switch on add their own buttons after these (see Extension windows).
  4. A message's actions, shown when you point at it: Edit message, Regenerate and More actions. See Messages.
  5. The last reply's alternates: Previous alternate, the counter and Next alternate. See Alternates.
  6. Chat options. See The options menu.
  7. Attach pictures. See Writing.
  8. Continue the last reply, direct the character's next reply, and Write my next message for me. See Writing.
  9. Send.

On a narrow window the window buttons that do not fit move behind More; on a phone they are tiles under Windows in the options menu. On a computer, a counter in the header shows the tokens used this session, as the model reports them.

Back to chats closes the conversation. Switching to another view instead parks it: a reply that is being written keeps going, the Chats tab shows a dot (pulsing while writing, solid when a new reply has landed), and coming back returns you to where you were.

On a phone

On a phone the chat fills the screen, so parking it has a button of its own:

A conversation on a phone, with its minimize button and the chat options numbered
A conversation on a phone
  1. Keep the chat running and browse the library: minimizes the chat, like a window. A reply that is being written keeps going in the background while you browse your characters, the Chats tab shows a dot (pulsing while it writes, solid once the reply has landed), and tapping Chats brings you straight back to the conversation, right where you left it. The back arrow, by contrast, closes the chat.
  2. Chat options: everything else, the chat windows included as tiles under Windows.

Writing

Type in Write a message... and press Send, or Enter on a computer (Shift+Enter starts a new line). On a phone, Enter always starts a new line and you send with the button. Sending an empty box asks the character for another reply.

The buttons beside the box:

  • Continue the last reply: the character carries on from where its last message ended.
  • Direct the character's next reply: what you typed steers the next reply instead of being sent as your message. Swiping or regenerating that reply follows the same direction.
  • Write my next message for me: the model drafts your next message into the box; nothing is sent until you send it. Anything already typed steers the draft.
  • Attach pictures (the paperclip): pictures for your next message. You can also paste a picture into the box or drop one onto the chat. Each lands in the chat's own gallery and waits above the box until you send; its × takes it off this message and leaves it in the gallery. A message can be pictures alone, with no text. The paperclip shows only when the chat's connection is set as seeing pictures (Sees pictures set to Yes, see Connections); set to No or Not checked, it is gone.

A message's pictures show under its text; click one to see it full screen. The model sees every picture in the chat that fits the context budget, the character's included: a picture on one of the character's messages goes to the model just before that reply.

Your unsent text is saved as you type, so it is still there when you come back, even on another device.

Macros in your message (such as {{char}}) are filled in when you send it. See Macros.

The options menu

The ☰ button (Chat options) beside the box holds:

  • Display: Background, Show Every Message Action (shows each message's actions without pointing at it), and Open Thinking by Default.
  • This chat: Chat Card (this chat's own scenario, examples, main prompt and Author's note, see The chat's own card), Rename Chat, New Chat, Copy as Markdown, Export JSONL, Character Details and Delete Chat.
  • Messages: Regenerate Last Reply, Continue Last Reply, Direct the Character's Next Reply, Write my next message, Copy Last Reply, and the Keep a Stopped Reply switch.
  • Extensions: actions that extensions add, when there are any.

Messages

Each message shows its author's picture and name, its time, and its actions. Turn on Reply cost in Chat settings to see each message's number and token count too.

The actions (pointing at a message on a computer; the ⋯ on a phone, which opens a Message sheet):

  • Edit message: edit the text in place, then Save or Cancel.
  • Regenerate: on the last character message, writes it again.
  • Under More actions:
    • Copy source: copies the raw text.
    • Branch from here: starts a new chat holding everything up to this message, named after this chat with "Branch #N", keeping its lorebooks, persona and background, and opens it. The chat's own card texts and Author's note come along, and with Memory or Trackers on, their state as of this message.
    • Continue this reply: on the last character message.
    • Hide from the prompt: the message stays on screen, dimmed and marked hidden, but the model does not see it. Send to the model again undoes it.
    • Delete message: for a message with alternates, you choose the whole message or just the alternate shown.

A divider marked Context starts here appears above the oldest message that still fits the context budget; older messages are kept but not sent. See The context budget.

Alternates

The last character message carries its alternates, with Previous alternate, a counter such as "2/5", and Next alternate. On the last alternate the right arrow becomes Write another reply and generates a new one, keeping the others. With ← and → you can do the same from the keyboard. An alternate opens at its first line; when it runs past the bottom of the screen, Jump to latest takes you to its end.

Regenerate rewrites the alternate you are looking at instead of adding one; use Write another reply when you want to keep the current one. The first message's alternates are the card's alternate greetings: they cycle round and never generate.

Once you reply, earlier messages keep their alternates but show only the one you chose.

Combine alternates into a new one (shown with two or more alternates) opens the swipe combiner: tick the alternates to merge, optionally guide the mix, and add the result as a new alternate. See Combining alternates.

While a reply is written

The reply streams in as it is written. Scroll up, however little, and the view stays where you are; Jump to latest appears once there is more below to return to. Scroll back to the bottom and let go, and it follows the reply again. While it follows, the bottom stays in view when the phone's keyboard opens or the box you type in grows. When the app is in a background tab, the tab's title flashes when a reply lands (see Flash the tab when a reply lands in Chat settings).

Stop ends the reply. With Keep a Stopped Reply off (the default) the half-written reply is dropped and the chat is as it was; with it on, what arrived is kept, marked "interrupted", so you can edit or continue it. Leaving the chat, reloading or closing the tab while a reply is written counts as stopping it.

Models that think before answering show their thinking in a Thinking fold above the reply, closed unless Open Thinking by Default is on. A closed fold is filled the first time you open it, so a long chat opens quickly; your browser's find doesn't reach inside a fold you haven't opened unless Render closed thinking up front is on in Chat settings.

When a reply fails, the reason shows above the box: no connection set up, a model that spent its whole reply budget thinking, an empty reply, a timeout. The server retries a couple of times on its own before giving up when the failure looks temporary; after that, send again or regenerate.

Formatting

Messages render markdown: paragraphs, headings, lists, quotes, tables, bold, italics (shown as narration), strikethrough, inline code and code blocks (with Copy code). Text in quotation marks is coloured as dialogue. Images and links in a message show, links opening in a new tab. Complete HTML blocks render when Render HTML blocks is on, with scripts removed. Styles that come with them (a preset's regex scripts often draw styled cards) apply to their own message only, never to the rest of the app or to other messages. A block wider than the message (a wide table, a card's own layout) scrolls sideways inside itself instead of stretching the message. See Chat settings for the options.

Renaming, exporting and deleting a chat

From the options menu:

  • Rename Chat: chat names are unique per character.
  • Export JSONL: downloads the chat as a JSONL file in SillyTavern's chat format.
  • Copy as Markdown: copies the whole chat as text, each message under its speaker's name.
  • Delete Chat: removes the chat and every message in it; the character is untouched.

Chats cannot be imported one at a time; see Importing and exporting.

Several tabs and devices

Every open tab follows changes made elsewhere on the same account: a reply written in another tab appears when it finishes, a rename updates the header, and a chat deleted elsewhere closes with a note. If you try to edit, delete or regenerate a message that changed in another tab since you last saw it, nothing is written and the chat reloads, so an older screen never overwrites newer text.

Group chats

Every chat has one character; group chats are not supported.

Keys

In an open chat, when you are not typing in a box: / jumps to the message box, End to the latest message, ← and → page the last reply's alternates, R regenerates, C continues, I writes your next message, and E edits the last message. Esc closes an open menu or the top chat window, then the conversation (stopping a reply that is being written); in the message box it only leaves the box. Shift+Esc stops a reply from anywhere. The rest are in Keyboard shortcuts and gestures.

Chat windows

The buttons in a conversation's header open windows beside the chat: settings, the prompt, regex scripts, the lorebooks, the persona, the background, the gallery and the assistant. This page covers each. The conversation itself is in Chats and the conversation.

How the windows work

On a computer each window floats over the conversation. Drag its title to move it, drag an edge or corner to resize it, and double-click an edge to put it back. Clicking a window brings it to the front, and Esc closes the front one. Windows remember their size and place; Settings > General > Theme & Layout > Reset Window Layouts puts them all back. With One panel at a time on (in Chat settings, below), opening a window closes the others.

A conversation with the Assistant window open beside it
A window docked beside the chat

Tip

The conversation is a window too: on a computer, drag its header to move it and its edges to resize it. Double-click a window's title bar, or the conversation's header, to put it back where it started.

Arrange the header

On a computer the header's buttons are yours to arrange, the ones extensions add included:

  • Reorder: drag a button left or right; a bar shows where it lands, and Esc cancels the drag.
  • Group: drop a button on a group to file it there (rest on the group and it opens, so you can drop it at a spot in its list). A group shows as one icon with a small corner mark; click it for its buttons.
  • Right-click a button, a group, a divider or the header itself for the rest: Move Left and Move Right, Move to Group (or New Group, which asks you to pick its icon), Add Divider, Hide, and on a group Rename, Change Icon and Ungroup.
  • To bring a hidden button back, right-click the header, choose Hidden Buttons and pick it; it returns to its place. Reset Header puts everything back as it ships.

From the keyboard, the menu key opens the same menu on the button you are on, and the arrow keys move through it. Chat settings > Conversation header lists every button with a switch to show or hide it.

On a phone every window opens full screen, with a back arrow; the phone's back button closes it. The windows are tiles under Windows in the conversation's options menu.

Chat settings

Chat settings holds the settings that apply to every chat. Find a setting searches them.

The Chat settings window: line length, message fill and layout
Chat settings
GroupSettingDefaultWhat it does
ReadingLine lengthFillHow long a line may get before it wraps; far right removes the limit
Message fillonDraws each message on its own plate
Message layoutAuto (Full Width on Mobile)Text beside the avatar, or full width under it
DisplayLayoutBannerBanner puts each message on a card; Column sets the text in a bubble under the name
Show avatarsonThe speaker's picture beside each message
TimestampsonWhen each message was written
Reply costoffEach message's number and token count
Render closed thinking up frontoffFills every closed Thinking fold as the chat opens, so your browser's find reaches the words inside them; off, a fold is filled the first time you open it, which keeps long chats quick to open
Message textDialogue quotesStraight and CurlyWhich quotation marks count as dialogue; Add CJK and Guillemets adds 「」 and « »
Close unfinished emphasisonCloses a stray * so the rest of a message is not italicized
Render HTML blocksonRenders complete HTML blocks in messages (never scripts), with their own styles and pictures kept to that message, and hides comments and tags that are not HTML, such as a preset's own markers, keeping their text. Off shows every tag as written
Keep these literalemptyStrings shown as typed rather than read as formatting
Context budgetContext budget8192The prompt's size limit in tokens, unless the connection sets its own
Reserve for the reply350Tokens kept free for the reply
While you readShow the reply as it is writtenonThe reply and its thinking appear as they arrive; off, the reply appears whole when it is done and its row says how long it has been thinking or writing. The three below only apply while it is on
Streaming caretonThe caret at the end of a reply being written breathes slowly; off, it holds still
Smooth streamingoffEvens out text that arrives in bursts
Format as it streamsoffCode blocks, HTML blocks, tables and the thinking take shape while a reply arrives, instead of when it finishes
Flash the tab when a reply landsonFlashes the tab's title when a reply finishes in a background tab
One panel at a timeoffOpening a chat window closes the others (computers only)

On a computer, a Conversation header group lists every button in the header, in its order, with a switch to show or hide it, its groups and dividers, and Reset Header (see Arrange the header). When extensions add chat windows, an Extensions group lists them with a switch for the phone's tiles.

The prompt manager

Prompt manager controls what is sent to the model and in what order. It works on presets: a preset is an ordered list of blocks. With no preset chosen, Built-In Defaults apply: the main prompt, the character's description, personality and scenario, lore before and after the character, your persona's description, the example dialogue, the chat history, and the post-history instructions. A preset whose blocks all send nothing for a reply is refused with a message saying so, and nothing in the chat changes.

The prompt manager with a preset of its own, its controls numbered
The prompt manager's controls
  1. The preset this chat uses, below.
  2. How many tokens the preset's own written blocks add to every prompt.
  3. Preset actions, below.
  4. Whose choice the preset is, with Make Default, Use Default or Clear Default.
  5. Filter blocks and contents.
  6. Drag a block to a new place; the icon beside it says whether it is your own text or a marker the app fills.
  7. Edit this block, Duplicate this block and Delete this block.
  8. The switch turns the block on or off.
  9. Text Block, Marker, Group and Sub-group: add a block.

The menu beside the preset's name (3) has Preset Settings, New Preset, Duplicate Preset, Rename Preset, Import a Preset File, Export This Preset, Export as a SillyTavern Preset and Delete Preset.

The preset you pick is for the open chat alone: picking one never changes any other chat. The first choice, Same as the Default (with the default's name), puts the chat back on the default. The line under the preset's name says whose choice it is, and only its buttons change the default:

  • This chat's own: the chat keeps the preset you picked, and the Prompts button wears a dot. Make Default makes it the default as well, for every chat without one of its own. Use Default puts the chat back on the default.
  • The default: the chat follows the default. Clear Default puts every chat following it on the built-in blocks.

The blocks shown are the ones this chat sends, so an edit changes what this chat sends (and every chat using the same preset). A preset you make, duplicate or import becomes this chat's own. Built-In Defaults can be the default but not a chat's own; to give one chat the built-in blocks, make a new preset (it starts from them). Deleting a chat's own preset puts the chat back on the default; deleting the default puts every chat following it on the built-in blocks. A branch keeps its chat's preset.

Each block can be switched on or off, dragged to a new place (on a phone, moved up and down from its menu), edited, duplicated and deleted. At the bottom: Text Block (your own text), Marker (a slot the app fills, such as the chat history or lore), Group and Sub-group (to organize long presets). A block's editor has:

  • Name.
  • Sent as: system, user or assistant.
  • Placement: Before the Chat History, After the Chat History, or Inside the Chat History, at a Depth (with a depth and an order).
  • Fires on: Normal reply, Continue, Impersonate, Swipe and Regenerate. With none ticked the block is sent on every reply; tick some and it is sent only on those, and its row wears a small filter mark. A SillyTavern preset's own choices come across when you import it; a choice this app never makes (SillyTavern's Quiet) shows as a tick of its own, so you can see it and untick it.
  • Ignore the character's own version of this block, for the main prompt and the post-history instructions: by default a card's own system prompt and post-history instructions replace the preset's, and {{original}} inside the card's text stands for the preset's.
  • The content, where macros work (see Macros).

If the chat history block is switched off, the window warns you: every reply would be written without the conversation.

The Character's picture marker shows the model the character's avatar, so a reply can draw on how they look. It is not in the built-in blocks: Marker adds the markers a preset lacks, one at a time, and a new block starts switched off. It always goes in your turn, before or after the chat history, and is left out when the connection does not see pictures.

Import a Preset File reads this app's own preset files and SillyTavern chat-completion presets. A setting this version does not know, in a file from another version of this app, is left out and named when you import. From a SillyTavern preset it takes the prompts and their order; samplers and connection settings are left out (set those on the connection), and a report lists what did not come across. A preset that carries regex scripts brings them along, off: the report says how many and has a switch to allow them (see Regex scripts). A file of this app's whose regex script is not in a shape it reads is refused, nothing is made, and the message names the script by its place in the file.

Every preset builds its prompt the way SillyTavern does, so a SillyTavern preset behaves here as its author tested it: each block goes as its own message, the card's example dialogue goes as separate turns, and your persona goes as you wrote it. One thing differs on purpose: an example with no line starting with a speaker's name and a colon (the names written another way, or plain prose) is sent whole, as one piece of text, where SillyTavern sends none of it. An imported preset brings its own wording for the settings below; a preset you make starts from this app's. Export as a SillyTavern Preset writes the preset as a SillyTavern file, its regex scripts included; anything SillyTavern has no place for (the character's picture block, the directed-reply wording) is named when you export.

Preset Settings opens the preset's settings in place of the list (the built-in defaults show theirs, read only). Each changed field has Back to Default, and nothing is kept until Save; closing with changes not saved asks first:

  • Wrapping: the text sent around the character's Personality, the Scenario and the Lore placed before or after the character. Each part goes where its marker is ({{personality}}, {{scenario}}, {{lore}}); an empty box sends the part as it is.
  • Messages: a Conversation opener sent just before the oldest message, a line sent Before each example, and Join neighbouring system blocks, which sends system blocks that sit together as one message.
  • Requests: your own wording for Write my next message, Direct the character's next reply and Continue last reply (an empty box sends nothing), what to Join the new words with when a reply is continued, and End on the reply itself, which ends the prompt on the reply so far instead of sending the continue wording. Many presets tell the model never to write as you, and it then refuses Write my next message however it is asked: rewording it here is the fix.

A box holds up to 20,000 characters. If one is longer, nothing in that Save is kept and a message says why; Preset Settings opens again on what you typed, for you to shorten. Your other changes to the preset still save.

Regex scripts

A regex script finds a pattern in the text and replaces it: hiding a status block on screen, tidying a model's habits out of what it reads, swapping a name. They work as SillyTavern's do, and a script file from SillyTavern imports as it is. The Regex scripts button (beside the prompt manager's) opens the window; on a phone it is the Regex tile.

Scripts come from three places, run in this order, each its own tab:

  • Yours: run in every chat.
  • Preset: the scripts the chat's preset carries.
  • Character: the scripts on the character's card.

A preset's and a character's scripts stay off until you allow them. While a preset or a card with scripts waits for an answer, the button and its tab wear an orange dot (in a narrow window, the More button the Regex button waits behind wears it), and the tab offers Allow or Leave Them Off. After that a Run these scripts switch on the tab changes your mind. Saving a new script into a list that is not allowed does not allow it. Your answer stands for the scripts you saw: replace a character with a card that carries different scripts and they wait for a new answer, dot and all.

Each script has its own switch, and a tap opens it. Runs on says which text it reads: your messages, AI replies, narrator lines, lorebook entries or reasoning. What it changes decides where the result goes:

  • What you see: only on screen.
  • What the AI reads: only in what is sent.
  • Both: on screen and in what is sent.
  • The message itself: as if the message had been written that way, on screen and in what is sent, while the stored message keeps its words. Switch on Change what is saved to rewrite messages as they are stored instead, as SillyTavern does: when you send one, when a reply arrives, on a new chat's greeting, and on an edit when Run when a message is edited is on.

Advanced holds the rest: Min depth and Max depth set how far back a message may be for the script to run on it (0 is the newest, empty is any; Min depth skips the messages newer than it, Max depth the ones older), Macros in Find fills macros like {{char}} into the pattern, Trim out cuts text out of what was found before it goes back, and Run when a message is edited decides whether a message you edited by hand still takes the script. Try it runs the script on any text you type and shows the result on screen and as the AI reads it (for a script that changes what is saved, what the save leaves).

Editing a message by hand opens it as its scripts wrote it, so a line a script cut stays cut once you save the edit. Continue picks up from the reply as its scripts wrote it, so the new part never vanishes behind a line a script cuts. Hidden messages still show through their scripts, and a reply that a script changes on screen is drawn formatted as it streams, even with Format as it streams off, so its blocks never show as code.

A pattern that never finishes is stopped after a quarter of a second and wears Too slow until you save it again, and the scripts after it carry on; one that does not compile wears Broken pattern. Reorder scripts by dragging their handle, or with Move Up and Move Down in a script's menu. Import and Export read and write SillyTavern's script files.

The context budget

Every prompt has to fit the model's context. The budget is the connection's Context size when it sets one, otherwise Context budget in Chat settings (8192 tokens), minus Reserve for the reply. When a chat outgrows it, the oldest messages are left out first; the newest two are always sent, and the card, lore and examples are never cut. A Context starts here divider in the chat marks the oldest message still sent.

Lorebook entries have a budget of their own inside it: Budget (% of context) in the scan settings (see Scan settings). Hidden messages are never sent.

A picture costs as much as a page or more of text. When a chat with pictures outgrows the budget, the oldest pictures are sent as a line of text ([picture: its name]) before any message is left out, and the newest message's pictures are always sent as pictures. A connection's Most pictures a request does the same past its limit.

The prompt inspector

Inspect the prompt builds the exact prompt the next reply would get and shows it message by message: how many messages and tokens, how many old turns were left out to fit, and how many pictures go. Each message shows the pictures it carries above its text, and a note at the top says when older pictures go as text to fit, or when the connection is not known to see pictures and none are sent. A macro that nothing fills is flagged, since it would be sent as written.

The prompt inspector showing the prompt about to be sent, its controls numbered
The prompt inspector's controls
  1. Copy the whole prompt.
  2. Rebuild: builds it again.
  3. Find in the prompt: Enter goes to the next match, and arrows for the previous and next match appear beside it.

Tip

The inspector is a dry run of a plain reply: a lorebook entry with a trigger chance is shown as if its roll passed, and what you have typed in the message box is not in it yet.

The chat's own card

Chat Card in the options menu (the window is This chat's card) holds texts that belong to this chat alone.

Card Texts overrides the card's Scenario, Example dialogue and Main prompt for this chat only, leaving the character untouched. An empty field uses the card's own. Remove All clears them.

Author's Note is a note sent with the chat, for steering the story:

  • the note itself;
  • Placement: Before the main prompt, After the main prompt, or In the chat, at a depth (how many messages back from the newest, set under Depth);
  • Voice: whether it is sent as system, user or assistant;
  • Frequency: every so many of your messages (1 is every reply, 0 never).

Default for new chats sets the note new chats start with. Under Lorebook scanning, Scan the note lets lorebook entries fire on the note's words (this applies to every chat).

Background

Background sets a wallpaper behind the conversation. Pick where it applies: This Chat, This Character or Everywhere; the most specific one wins.

The Background window with one image in its library, its controls numbered
The Background window's controls
  1. Where it applies: This Chat, This Character or Everywhere.
  2. Where images come from: Library, Gallery or Add.
  3. An image's rename and delete buttons, shown when you point at it (in the Library).
  4. How the image is drawn.
  5. No Background.
  6. Inherit.
  7. Apply.

Images come from three tabs: Library (images you have used before, which you can rename or delete), Gallery (the character's picture and gallery), and Add (a file from your device, or an image link with Fetch). Then adjust Fit (Cover, Contain, Stretch, Center or Tile), Opacity, Blur, Brightness, Saturate and Resolution. Changes preview live; Apply keeps them, and closing without it puts the old wallpaper back. No Background shows none here, Inherit goes back to the wider setting.

Gallery

Gallery shows the character's picture and gallery beside the chat, one large image with a strip below, and the chat's own gallery after them: pictures that belong to this chat alone, like the ones you attach to your messages. A chat's picture wears a small speech-bubble mark in the corner of its thumbnail.

Drop images onto the window, or press Add pictures, to add them. They go to the character's gallery unless you choose otherwise in Gallery options (the sliders button), which also holds the Show ticks: The character's pictures and This chat's pictures, each on or off, and Add new pictures to: The character's gallery or This chat's gallery. A picture you add to a gallery you have hidden is added all the same, and the message after the upload says so.

The Gallery window showing the character's picture, its other pictures in the strip below, its controls numbered
The Gallery window's controls
  1. Add pictures.
  2. Creator's notes.
  3. Set as background: opens Background with the picture, a chat's picture included.
  4. Attach to your next message: puts the picture beside the message box, ready to send; a character's picture is copied into this chat's gallery first. It shows only when the chat's connection is set as seeing pictures.
  5. Grid view, where Search by filename joins the row.
  6. Full screen.
  7. Gallery options.
  8. The arrows step to the previous and next picture.
  9. The strip: every picture; click one to show it.

On a chat's own picture, Remove from this chat's gallery joins the row: any message that showed it stops showing it, and the confirmation says how many do. Keys: ← → step, G grid, / search, F full screen, B set as background, A attach to your next message, N creator's notes, + and - zoom, 0 reset. With a mouse, the wheel zooms the picture, dragging moves a zoomed picture, and a click puts it back. On a phone, swipe to step and tap an image to zoom it.

A chat's gallery goes with the chat: a branch takes a copy of it, deleting the chat deletes it, and an export that includes media carries it, each message showing the same pictures when the pack is imported again.

Combining alternates

Combine alternates into a new one, on a message with two or more alternates, opens the swipe combiner. Tick the alternates to draw from, optionally write how to mix them in Guide the mix (optional), and generate. Then keep the result with Add as Swipe, try again with Retry, or go Back. It uses the chat's connection, and sends only the alternates you ticked, the names and your guide text, not the rest of the chat. Closing the combiner while it works (with Esc, going back, or switching chats) or opening it on another message stops the generation, so a mix only ever lands on the message it was made from.

The swipe combiner over a reply with three alternates, its controls numbered
The swipe combiner's controls
  1. An alternate: its box puts it in the mix or leaves it out, and its name shows it below.
  2. The alternate you are looking at.
  3. Guide the mix (optional).
  4. Generates the combined alternate (or press Enter).

Tip

It works on the opening message too, while that is still the last message: a way to merge a card's alternate greetings into a greeting of your own.

The Assistant

Assistant ( in the conversation's header) opens an out-of-character writing partner for the story. It reads the character card, the lorebooks in force, and the recent messages, and talks with you about the story: what a scene is doing, where it could go, whether someone is acting out of character. It never writes the roleplay itself.

The Assistant window answering what a scene is doing, its controls numbered from the session menu to Send
The Assistant's controls
  1. Session: this chat's Assistant conversations; pick one to switch to it.
  2. New session, Rename this session and Delete this session.
  3. What it can see: the card, the sources, the messages and the lorebooks it is sent, and the switches for proposed edits. See What it sees.
  4. Assistant settings: its connection, its prompt and how much it reads. See Assistant settings.
  5. Saved prompts: questions you keep; picking one fills the box, it does not send.
  6. Attach pictures, below.
  7. Send, which turns into Stop while an answer arrives.

Type in Ask about the story..., or start from one of the suggestions on an empty session. Each message can be copied, edited, asked again from that point, or deleted. Closing the window does not stop an answer in progress; switching chats does.

The paperclip beside Send shows the Assistant pictures: Pictures from this device (they go into this chat's gallery, see Gallery), the character's portrait, or the character's gallery, which opens the character's gallery pictures over the box: tap a picture to add it, tap it again to take it off, and Done closes them. You can also paste a picture into the box or drop one on the window. They wait above the box until you send, and a message can be pictures alone. The paperclip shows only when the Assistant's connection is set as seeing pictures; a picture it cannot see is described to it by name.

Sessions

Assistant conversations are saved per chat. The session menu (1 above) switches between them; New session, Rename this session and Delete this session (2) manage them. Deleting a session leaves your chat and lorebooks untouched.

What it sees

What it can see (the at the right end of the session row, 3 above) swaps the conversation for exactly what is sent; press it again to go back.

The Assistant's context view: the character card's fields, then the Sources it can be given, each with its size and switch
What the Assistant is sent

In short:

  • the whole character card, creator's notes and Character's Note included (the creator's notes the roleplay model never sees), and this chat's own card texts;
  • the Sources you leave on (below);
  • the most recent messages, up to Messages it can see (20 by default); hidden messages are left out;
  • the lorebooks this chat can reach: entries that fired, in full, and the rest by title only.

Sources lists what else the assistant can be given, each with a switch and its size:

  • Persona (on): who you play here, with the persona's name, pronouns and description, so it knows which character is yours.
  • Author's Note (on): the note this chat sends, where it goes and how often, and whether it is this chat's own or the default.
  • Chat facts (on): the chat's name, how many messages it holds, and the chat it branches from.
  • Preset text blocks (off): the text blocks your preset sends, as written. A long preset makes every question cost more.

An extension can add sources of its own; they show in the same list with their own switches. A source you switch off is not read at all. Whatever it is given, the assistant never decides what your character does, says or feels in anything it drafts: it leaves your part to you, or asks.

It can ask to read more (another alternate of a message, or a lorebook entry in full), at most once per answer, and you see a note when it does.

Proposed edits

When you allow it, the assistant can propose edits instead of only describing them:

  • Let it propose lorebook edits: new entries, changed entries, deletions.
  • Let it propose message edits: rewriting a message (the alternate on screen), replacing a passage, hiding a message, deleting one.
  • Let it propose card edits: the character card's fields (the Character's Note among them), its tags and its alternate greetings. Every chat with the character reads the card, and a greeting opens new chats, not this one. The card is saved to its Version History before anything is written, so an applied change can be undone from there. These snapshots keep a limit of their own (Max Chat Assistant snapshots per character, under Version History in Settings), so a long session never pushes out the card's other automatic snapshots.
  • Let it propose edits to this chat's notes: the Author's Note, and this chat's own scenario, example dialogue and main prompt. Only this chat changes: a chat using the default note gets a note of its own, and the card stays as it is. The Author's Note can only be changed while its source is on.
  • Let it propose persona edits: your persona's description. A persona is shared, so the change reaches every chat that uses it. It can only be changed while the Persona source is on.

All of them are off by default. With the notes or persona switch on and its source switched off, a note under the switch says what it cannot change until the source is back on. A card or persona change says on its card what it reaches beyond this chat. Proposals arrive under Proposed changes, each with a box to include it, a side-by-side comparison, a touch-up editor, Apply this change now (Write this to the card now on a card change), and a way to set it aside. Apply Selected writes the ticked ones after a confirmation. Every change is checked again just before it is written, so one aimed at something that has since changed or vanished is refused rather than misapplied. A refused change (marked in yellow or red, with the reason under it) offers Try again : the assistant is told what went wrong, re-reads the story as it is now and proposes the change again, or says it does not fit any more. A reply with several refused changes also offers Try All Again in its footer. Try again shows only while that kind of edit is switched on, since the assistant can propose it only then. A new lorebook entry goes into a book you pick, or a new book linked to the character. An applied change is written at once and has no undo (a card change aside, through its Version History), so read the comparison first.

The assistant only ever builds on what you applied: once it has replied again, it is not shown the changes of an earlier reply you left unapplied, so it never treats one as part of the story.

Assistant settings

The gear (Assistant settings, 4 above) holds, for every chat:

  • Answers with: the connection the assistant uses, which can differ from the chat's (a cheaper model is often enough), with Reasoning effort (the connection's levels, Custom… included), Max reply tokens and Temperature.
  • Assistant prompt: your own description of the assistant's role, in place of the built-in one. The rules that keep story text quoted rather than obeyed, and the edit instructions, are always added.
  • The saved prompts list.
  • Messages it can see and Context budget (tokens) (0 for no limit).
  • Show the reply as it is written (off by default). While a reply is written it follows to the bottom; scroll up and the view stays where you are, and scroll back to the bottom to follow it again, as in the chat.
  • Format as it streams: Same as Chat (the switch in Chat settings), On or Off, for whether an unfinished code block shows as a box while a reply arrives (other blocks and tables appear as soon as they are whole either way). It is greyed out while Show the reply as it is written is off, since only a reply shown as it arrives has anything to format early.
  • The proposed-edit switches above.

Personas, Lorebooks and Connections

These windows have their own pages: Personas, Lorebooks and Connections.

Extension windows

Extensions can add windows of their own (Memory, Trackers, Story Beats, Translator, Chat Timeline, among the bundled ones). They open from the header like the built-in ones, and their buttons arrange like the others (Arrange the header); Chat settings > Extensions chooses whether each has a phone tile. See Extensions.

Connections

A connection is an AI endpoint the app can send a prompt to: a hosted service or a model server you run yourself. Chats, the Assistant, the Studio, the Card Recommender, AI lorebook generation, the CSS Assistant and several extensions need one. The library, search, editing and online browsing do not.

The app calls them profiles in Settings and connections in a chat; they are the same thing.

Adding a connection

Settings > AI > Profiles lists your connections. Press Add Profile and the editor opens below the list on a new one called "New profile"; name it there, fill in the endpoint, key and model, and press Save (Save Settings saves it too, and closing Settings asks before dropping an unsaved change). In a chat, Connections in the header does the same with New Connection.

Until the connection a chat uses can send, the chat says so above the message box and names what is missing (an endpoint, a model, or a kind whose extension is switched off); Finish Setting It Up opens it in Connections, and the note goes once it is ready.

Each row shows whether the connection is ready (an endpoint, a key and a model are set) and which kind and model it uses; Edit opens it again.

The connection editor

The same editor opens from Settings and from a chat.

The connection editor: name, kind, endpoint, key, model and context size, then the sampling settings
The connection editor

Connection:

  • Name: what you call it.
  • Kind: how the request is sent (see Kinds).
  • Endpoint: the address of the API, for example https://api.example.com/v1.
  • API key: Add Key to enter one, then Replace or Remove later. The key is stored on the server and never sent back to the browser; the editor only ever shows that a key is stored and its last four characters. Replacing or removing it takes effect when you save.
  • Model: type a model name, or press the refresh button (List the models this endpoint offers) to pick from the endpoint's list, which also shows each model's context length when the endpoint reports it, and an eye beside a model the endpoint says can see pictures.
  • Context size: the prompt budget for this connection in tokens. Picking a model from the list fills it in when the endpoint reports one. Blank uses the app-wide Context budget from Chat settings (see The context budget).
  • Sees pictures: whether pictures you attach reach the model: Yes, No, or Not checked. Picking a model from the list fills it in when the endpoint says, unless the field already holds an answer (yours, or one saved before). Check shows the model two small pictures and asks it to name their colours: if it names both, it sees; if it answers without them, or the endpoint refuses pictures, it does not; and if the check could not be made (a wrong key, no answer) the field stays as it was and the note under it says why. Save keeps the answer. The paperclip that attaches pictures shows only for Yes. Only a connection set to Yes is sent pictures: one set to No or Not checked gets none, not even the pictures already in a chat. Some kinds of connection cannot carry pictures at all, and the field says so.
  • Most pictures a request: for an endpoint that takes only so many pictures in one request. Past it, a chat sends its oldest pictures as text, the newest message's always as pictures. Blank is no limit.

Sampling: Temperature, Top P, Top K, Max reply tokens, Presence penalty, Frequency penalty, Seed and Reasoning effort. A blank field sends nothing, so the provider's own default applies, which is not the same as sending zero.

Reasoning effort is for models that think before they answer. Pick one of the common levels (none, minimal, low, medium, high, xhigh, max), or Custom… and type the word your provider uses for a level of its own. Whatever you pick is sent exactly as it is written, and providers name their levels differently, so a model that does not take a level refuses the request: Test shows you straight away. A custom level is letters, digits, _ and -; anything else is left out as you type.

Test sends a tiny request through the connection as it stands in the editor, before you save, and says whether it answered. Save keeps your changes, Cancel drops them. The menu by the name (Connection actions) has Duplicate (key included) and Delete; chats that used a deleted connection fall back to the first one left.

Kinds

  • OpenAI-compatible (built in): any service or local model server that offers the OpenAI-style chat completions API. The endpoint is required and must include the API's version path (it usually ends in /v1); the app adds the rest. The key is optional, for servers that need none.
  • Anthropic Messages API: Anthropic's own API, added by the bundled Anthropic extension. Switch it on under Settings > Extensions first (see Extensions). The endpoint is optional, the key is your Anthropic API key, and settings that newer models refuse are left out for you.

A model server on your own network works as a connection: the app's block on private network addresses applies to downloads and online sites, not to your connections.

Choosing the connection for chats

In a chat, Connections lists your connections, and the line at the top says which one answers this chat and why.

The chat's Connections window with two connections, its controls numbered
The chat's Connections window
  1. The connection that answers this chat, and why.
  2. New Connection.
  3. Answer this chat only with this connection.
  4. Make this the default for every chat.
  5. Edit.

The two buttons on each row:

  • The globe (Make this the default for every chat) makes it the default: every chat without a connection of its own uses it. The default's row says default.
  • The speech bubble (Answer this chat only with this connection) gives the open chat that connection alone, whatever the default becomes. Its row says this chat, and the Connections button wears a dot while the chat has its own.

Use Default at the top puts the chat back on the default. A connection you make with New Connection is not in use until you press its globe or its speech bubble. With no default chosen, or after it is deleted, chats use the first connection you created, and a chat whose own connection is deleted goes back to the default. A branch keeps its chat's connection.

The chat's Connections window: the default, and another set for this chat only
The chat's Connections window

Which connection each feature uses

FeatureWhere you choose
Chat replies and combining alternatesThe chat's Connections window: the default for every chat, or one for this chat only
The AssistantAssistant settings > Answers with (The Assistant)
The StudioStudio settings (Creating characters)
The Card RecommenderIts connection menu at the top (The library)
The CSS AssistantIts Connection menu (Settings and themes)
Generating lorebook entriesThe Connection step of the generator (Lorebooks)
Extensions that call a modelSettings > Extensions, the extension's own Connection setting; by default The one the chat uses for an extension that works on a chat, The one your chats use for one that does not

Overrides

Where a tool has its own connection menu (the Studio, the Card Recommender, the CSS Assistant, lorebook generation), an Overrides button beside it changes the request without touching the saved connection: Temperature, Reasoning (the same levels as the connection's, Custom… included) and Max reply tokens, plus Stream the reply for tools that show the reply as it is written. Blank fields use the connection's own settings.

Timeouts and retries

A reply that sends nothing for five minutes before its first word, or stalls for two minutes in the middle, is given up on. Before the first word arrives, the server retries a temporary failure up to twice on its own.

Lorebooks

A lorebook (also called world info) is a set of entries, each a piece of background the model should know only when it matters: a place, a person, a rule of the setting. An entry has keywords; when one of them comes up in the recent messages, the entry's text is added to the prompt. Constant entries are always sent.

Where a lorebook applies

A book reaches a chat in any of four ways, and a chat uses every book that reaches it:

A card can also carry a book inside it, the embedded lorebook. An embedded book is never used in chats until you bring it into your library (see The embedded lorebook).

The Lorebooks manager

More Options > Lorebooks opens the manager: your books on the left, the selected book on the right. Each book shows its entry count and where it is used (characters, chats, global, personas).

The Lorebooks manager with one book open, its controls numbered
The Lorebooks manager
  1. New: an empty book. See Creating, importing and exporting.
  2. The other ways to create one: Generate with AI.
  3. Import.
  4. Search lorebooks, characters, chats...: finds books by name, and also the books bound to a character, chat or persona whose name starts with what you type.
  5. The chips filter the list: All, Linked to characters, Bound to chats, Active in every chat, Bound to personas, Not bound anywhere; the ghost shows placeholder books, names something is bound to that have no book yet.
  6. The sort: Name A-Z, Name Z-A, Most Entries, Most Bound, Created (Newest), Created (Oldest), Modified (Newest), Modified (Oldest).
  7. The book's Rename, Duplicate, Export JSON and Delete.
  8. Where the book is used. See Binding a book.
  9. Search entries....
  10. opens or closes every entry, AI generates entries, and Add Entry adds one.
  11. Save: edits to the entries wait for it.
  12. An entry's switch: on or off.
  13. An entry's duplicate and delete.

↑ and ↓ step through the books. On a phone the list and the book take turns on screen.

Edits to a book's entries are held until you press Save; switching books or closing with unsaved edits asks first. If the book changed somewhere else meanwhile, or the check cannot tell, saving asks whether to overwrite it.

Creating, importing and exporting

  • New creates an empty book (type its name and press Enter). The arrow beside it offers Generate with AI (see Generating entries with AI).
  • Import reads .json files: SillyTavern world files, a card's lorebook on its own, or a whole card's JSON (its lorebook is taken out). Several files at once are fine. A name you already use gets a number, such as "Name (2)".
  • On a book: Rename (everything bound to it follows the new name), Duplicate, Export JSON (downloads it in the SillyTavern world format, including unsaved edits) and Delete (its bindings go with it).
  • Add a Note keeps a note about the book inside it, so it travels with exports.
  • While you rename a book, type a new one's name or edit its note, Esc (or going back on a phone) cancels just that edit; press it again to close the manager.

Binding a book

The top of an open book shows where it is used, in four groups:

  • Characters: click + (Link to characters) to pick characters, with a search, a playlist filter and Hide already-linked; the × on a character unlinks it.
  • Chats: + (Bind to chats) picks chats the same way.
  • Personas: + (Bind to a persona) picks a persona.
  • Global: the switch makes the book Active everywhere.
Picking characters to link a book to, its controls numbered
Linking a book to characters
  1. Search characters....
  2. Narrows the list to one playlist.
  3. Ticks every character shown, or clears them.
  4. Hide already-linked.
  5. A character: click its row to tick it; clicking its picture opens the character instead.
  6. Link: links the book to the ticked characters.

Entries

Each entry is a row with its switch, title, keywords, position and order; click it to open it. Search entries... filters them, the sort orders them (By Order, By Title, Oldest First, Newest First), and Add Entry adds one. Each entry can be duplicated or deleted.

A lorebook entry open for editing: its title, status and content
An entry open

The fields:

  • Title / Memo: a label for you.
  • Status: Normal (sent when a keyword matches), Constant (always sent) or Vectorized.
  • Content: the text added to the prompt.

Activation

  • Primary Keywords: type a keyword and press Enter or a comma. A keyword written as /pattern/flags is a regular expression.
  • Optional Filter: secondary keywords, with Logic deciding how they combine with the primary ones: AND ANY (one must also match), AND ALL, NOT ANY (none may match) or NOT ALL.
  • Position: where the text goes: Before Character Defs, After Character Defs, Top of Author's Note, Bottom of Author's Note, @ Depth (inside the chat, a number of messages back, with a Role), Top of Example Msgs, Bottom of Example Msgs, or Outlet (named macro) (wherever a prompt writes {{outlet::name}}).
  • Insertion Order: lower numbers go higher up.
  • Trigger %: the chance the entry is sent when it matches (with Use trigger %).

Advanced

  • Recursion: whether this entry's text can trigger other entries, can be triggered by them, or waits for recursion (Non-recursable (won't be activated by others), Prevent further recursion, Delay until recursion).
  • Inclusion Group: entries sharing a group label compete, and only one is sent: by Group weight, by group scoring, or always the one marked Prioritize (group override).
  • Scan Overrides (blank = use global): this entry's own scan depth, case sensitivity and whole-word matching.
  • Timed Effects (blank = off): Sticky (stays in for so many messages after it fires), Cooldown (sits out for so many after), Delay (cannot fire until the chat has so many messages).
  • Generation Types (none = every kind): fire only for some kinds of request, such as normal replies, continues or regenerations.
  • Character Filter (blank = everyone): only for certain characters or tags, or never for them.
  • Additional Matching Sources: also look for keywords in your persona's description or in the card's description, personality, Character's Note, scenario or creator's notes.
  • Ignore token budget sends the entry even when the lore budget is used up.

Scan settings

How entries are matched applies to every chat. Open it from the gear in a chat's Lorebooks window (Scan settings (they govern every chat)):

SettingDefaultWhat it does
Scan depthLast 4 messagesHow many recent messages are searched for keywords
Whole words onlyonA keyword must match whole words ("bat" does not fire on "bathroom")
Case-sensitiveoffCapitals must match
Scan speaker namesonSpeaker names count, so a character's name can fire their entry
Match like SillyTavernoffMatches keywords exactly as SillyTavern does
Show placeholder booksoffLists names bound to no book yet
Recursive scanonEntries that were sent can fire other entries
Max recursion steps0Limits how deep that goes; 0 is no limit
Budget (% of context)25The share of the context lore may use; 0 switches the limit off
Budget cap (tokens)0A ceiling in tokens on top; 0 is none
Show why entries firedonShows the reasons in the Lorebooks window

The chat's Lorebooks window

Lorebooks in a conversation's header shows every book that reaches the chat and every entry in them, marked as in the prompt right now, always sent, not matched, or switched off. With Show why entries fired on, chips say why each fired (the message number that matched, the entry that triggered it, its chance roll) or why a matching entry was held back (over the lore budget, lost its roll or its group, cooling down, the wrong kind of request).

The chat's Lorebooks window with the book linked to the character and its four entries, its controls numbered
The chat's Lorebooks window
  1. Filter entries.
  2. In Prompt: only the entries in the prompt right now.
  3. Opens every entry the filter shows, or closes them again.
  4. Add: links or binds a book: to the Character (every chat with it), to This Chat, or Everywhere.
  5. The scan settings, which govern every chat. See Scan settings.
  6. A book's row: its chips show how it reaches the chat (clicking one removes that link), the count says how many of its entries are in the prompt, and adds an entry.
  7. An entry's state: in the prompt right now, always sent, not matched, or switched off.
  8. Edits the entry in place, and its switch turns it on or off.

Click an entry to read it. Changes here are saved at once.

When the card carries its own lorebook that is not in your library yet, the button gets an orange dot (in a narrow window, the More button it waits behind wears it, and so does a group you filed it in; on a phone, the options button and the Lorebooks tile in its menu wear it) and the window offers Import or Leave It Embedded.

Lorebooks on a character

Linked lorebooks

A character can have several linked books, in order. The Details tab shows them; on the Edit tab (unlocked), Linked Lorebooks lists them, Add links another, and the × unlinks one (the book itself is kept). The first linked book is the one named inside the character's exported card.

The embedded lorebook

The Embedded Lorebook section of the Edit tab edits the book inside the card: each entry's keys, secondary keys, content, Selective, Constant, order and priority, and its switch, which turns the entry on or off and says On or Off beside it. Edit lorebook in expanded view opens it larger, where Collapse All folds each entry to its name and keys. Edits land with Save Changes.

  • Insert from Library copies a library book's entries into the card (replacing any book it had).
  • Send to Library puts the saved embedded book in your library and links it to the character, so chats use it. If a book with that name exists, you can link that one instead.
  • Remove Book empties it.

Importing a card never creates a library book on its own; the card's book stays embedded until you send it to the library (or import it from the chat's Lorebooks window).

Lorebooks in one chat

To bind books to one chat, use Lorebooks in a chat's right-click menu in the Chats view, the book button on a chat in a character's Chats tab, or Add > This Chat in the conversation's Lorebooks window. Click books to bind or unbind them; Unbind All clears the chat's list.

Generating entries with AI

Generate with AI (beside New, for a new book) or the AI button in an open book (Generate entries with AI, to add to it) opens a three-step generator:

  1. Source material: Paste Text, Web / Wiki (a page address and Fetch; wiki category pages list their pages to choose from, and Detail per page sets how much of each page is read), or From Library (characters' fields and chats).
  2. Instructions, optional: what you want from the entries.
  3. Output: the Connection, how many entries at most, and how much text each request may carry (Context).

Large sources are split across several requests. The results open for review (Review generated entries): edit, regenerate or discard each, then Add Selected. Nothing is saved until you press Save on the book.

Reviewing three generated entries, its controls numbered
Review generated entries
  1. Select all, or clear them all.
  2. Expand all, or close them all.
  3. An entry's switch: whether it is added.
  4. Regenerate this entry.
  5. Discard this entry.

Lorebooks and card updates

When a linked character's card is checked for updates, its embedded lorebook is compared entry by entry with the site's. Applying an update changes only the card's embedded book; the books in your library are never touched by an update check. See Checking for updates.

Browsing lorebooks online

ChubAI, Wyvern and Botbooru publish lorebooks too. In the Online view, the toggle beside the site picker switches between characters and lorebooks (Browse this site's lorebooks), and Import puts a book in your library. See Browsing online.

Personas

A persona is your side of a chat: the name the character calls you and a description of who you are. Its name fills {{user}} and its description {{persona}} in prompts and in card previews, and the prompt's Persona description block sends the description to the model.

You can keep several personas. One is your global persona, used everywhere; any chat can be set to use a different one.

Managing personas

Settings > Chat > Personas lists them. The circle on a row (Make active) makes that persona your global one; the pen edits it, and the editor's Save or Save Settings keeps your changes; New Persona adds one. The first persona you create becomes the global one by itself. Below it, In the conversation points to the chat header's windows, where everything else about a chat is set.

A persona has:

  • a name and a description (how the character should see you);
  • pronouns (below);
  • a picture and bound lorebooks, which are set from a chat's Personas window (below).

With no persona at all, {{user}} is left as written in previews; in prompts it falls back to the name stored with the chat, or "User".

In a chat

Personas in a conversation's header shows who you are in this chat and why: your global persona, or one set for this chat only.

The chat's Personas window with the global persona Rowan and a second persona, its controls numbered
The chat's Personas window
  1. Who you are in this chat, and why.
  2. A persona: click it to edit it, below.
  3. Be this person in this chat only: uses it in this chat alone.
  4. Be this person everywhere: makes it your global persona.
  5. Delete this persona.
  6. New Persona.

While the chat has a persona of its own, Use Global at the top puts it back on your global persona.

Clicking a persona edits it here, with more than the Settings editor offers:

  • Add a picture (or Replace picture / Remove): any image up to 25 MB, shown beside your messages.
  • Lorebooks: books bound to the persona (see below).

The window keeps up with changes made elsewhere: a persona added, renamed, given a new picture or deleted in another tab, on another device or in Settings shows here without reopening it, and over your messages in the chat too.

Closing the window, or picking another persona, with changes you have not saved asks first: Keep Editing keeps them, Discard lets them go.

If the persona you are editing is changed somewhere else meanwhile (the Assistant applying a persona edit, another tab, another device), the editor shows it as it is now when you have not typed in it yet. Once you have, your typing stays and Changed elsewhere says so: press Reload to see the saved version before saving, since saving over it is refused until you do.

A chat whose persona differs from your global one shows it on its card in the Chats view. Deleting a persona that a chat uses puts that chat back on your global persona.

Lorebooks

A persona can carry lorebooks: pick them under Lorebooks in the persona's editor in a chat's Personas window, or bind them from the Lorebooks manager. They are active in any chat where that persona is in force, alongside the character's own books and the global ones. See Lorebooks.

Pronouns

The Pronouns fold in a persona's editor sets how cards and prompts refer to you. Pick She, He, They, It, or Custom and fill in the five forms: subject, object, possessive, possessive pronoun and reflexive.

Cards and prompts use them through {{sub}}, {{obj}}, {{poss}}, {{poss_p}} and {{ref}}, which follow the capitals you write them with: {{Sub}} starts a sentence ("She"). A form left empty, or no persona at all, gives the they/them word. The full table is in Macros.

Bringing personas across

The SillyTavern migration brings personas with their names, descriptions, pictures and one bound lorebook each, and makes SillyTavern's default persona your global one. See Bringing a SillyTavern library.

Macros

Macros are placeholders in double braces that are filled in when a prompt is built. They work in card fields, prompt manager blocks, your persona's description, lorebook entries (their keys and content), the Author's note, a preset's Preset Settings, and the messages you send (filled in once, when you send). The card's first message is filled in when a chat starts.

Macro names ignore capitals, so {{Char}} and {{char}} are the same macro, with one exception: the pronoun macros copy the capitals you write (below). A macro that nothing fills is sent as written; the prompt inspector flags those.

Outside a chat (card previews in the library, for example) only {{user}}, {{char}} and the pronoun macros are filled in.

Names and the card

MacroBecomes
{{user}}Your persona's name
{{char}}The character's name
{{persona}}Your persona's description
{{description}} or {{charDescription}}The card's description
{{personality}} or {{charPersonality}}The card's personality
{{scenario}} or {{charScenario}}The card's scenario (or this chat's own, when it has one)
{{charPrompt}}The card's system prompt
{{charInstruction}}The card's post-history instructions
{{charDepthPrompt}}The card's Character's Note
{{creatorNotes}} or {{charCreatorNotes}}The card's creator's notes
{{greeting}} or {{charFirstMessage}}The first message; {{greeting::2}} is the second alternate greeting
{{version}} or {{charVersion}}The card's version
{{mesExamples}}The example dialogue, split into its examples
{{mesExamplesRaw}}The example dialogue as written
{{original}}Inside a card's system prompt or post-history instructions, the preset's own text they replace
{{authorsNote}}This chat's Author's note
{{defaultAuthorsNote}}The Author's note new chats start with
{{notChar}}Your name (in a one-character chat, everyone who is not the character)
{{group}}, {{charIfNotGroup}}, {{groupNotMuted}}The character's name (chats have one character)

Pronouns

Your persona's pronouns, set in its editor (see Personas):

MacroFormWhen the persona has none
{{sub}}Subjectthey
{{obj}}Objectthem
{{poss}}Possessivetheir
{{poss_p}}Possessive pronountheirs
{{ref}}Reflexivethemselves

Write the macro the way the word should come out: {{sub}} gives the form as you stored it, {{Sub}} capitalizes it ("She"), and {{SUB}} gives capitals ("SHE").

Chat and generation

MacroBecomes
{{lastMessage}}, {{lastMessageId}}The last message, and its number
{{lastUserMessage}}, {{lastCharMessage}}Your last message, the character's last message (hidden ones skipped)
{{firstIncludedMessageId}}The number of the oldest message that fits the context budget
{{firstDisplayedMessageId}}The number of the first message shown
{{lastSwipeId}}, {{currentSwipeId}}How many alternates the last message has, and which one is showing (from 1)
{{allChatRange}}The range of message numbers, such as 0-41
{{model}}The model answering
{{maxContext}}, {{maxResponse}}, {{maxPrompt}}The context budget, the reply's reserve, and what is left for the prompt
{{lastGenerationType}}What was asked for: normal, regenerate, swipe, continue or impersonate
{{input}}The text you typed as direction for a directed reply or "write my next message"
{{isMobile}}true when you are on a phone
{{hasExtension::id}}true when the extension with that id is on

Time

Times are on your device's clock.

MacroBecomes
{{time}}The time; {{time::UTC+2}} in another zone
{{date}}, {{weekday}}The date and the day of the week
{{isotime}}, {{isodate}}The time and date as 14:05 and 2024-01-31
{{datetimeformat::format}}The date and time in your own format (for example {{datetimeformat::dddd, MMMM D}})
{{timeDiff::a::b}}The time between two dates, in words
{{idleDuration}}How long ago your previous message was sent

Text helpers

MacroBecomes
{{// note}} or {{comment::note}}Nothing: a note to yourself that is never sent
{{newline}}, {{newline::3}}One or more line breaks
{{space}}, {{space::3}}One or more spaces
{{trim}}Removes the line breaks around it; {{trim}}text{{/trim}} trims the text inside
{{noop}}Nothing
{{reverse::text}}The text backwards
{{outlet::name}}The lorebook entries placed in the outlet called "name" (see Lorebooks)

Write \{ and \} for literal braces.

Chance

MacroBecomes
{{roll::2d6+1}} or {{roll::20}}A dice roll
{{random::a::b::c}} or {{random::a,b,c}}One of the choices, picked afresh every time the prompt is built
{{pick::a::b::c}}One of the choices, the same one every time in this chat and place

Conditions

{{if::condition::text}} gives the text when the condition holds. The longer form spans lines and has an else:

{{if persona}}
Some text about you.
{{else}}
Nothing is known about you.
{{/if}}

A condition is false when it is empty or reads off, false or 0. Put ! before it to turn it around. A bare macro name as the condition ({{if persona}}) is filled in first.

Variables

Variables remember a value between replies. Local ones belong to the chat; global ones are shared by every chat.

LocalGlobalDoes
{{setvar::name::value}}{{setglobalvar::name::value}}Sets it
{{getvar::name}}{{getglobalvar::name}}Gives its value
{{addvar::name::value}}{{addglobalvar::name::value}}Adds a number, or appends text
{{incvar::name}}, {{decvar::name}}{{incglobalvar::name}}, {{decglobalvar::name}}Adds or takes away one
{{hasvar::name}}{{hasglobalvar::name}}true when it is set
{{deletevar::name}}{{deleteglobalvar::name}}Removes it

A shorthand covers the same ground: {{.name}} reads a local variable and {{$name}} a global one, and operators follow the name, for example {{.count++}}, {{.mood = happy}} or {{.hp -= 3}}. Only a real reply saves changes to variables; the prompt inspector works on a copy.

Extension macros

Extensions can add macros. Among the bundled ones, Memory adds {{memory}} (and {{summary}}), and Trackers adds {{trackers}}, for placing their text exactly where a preset wants it.

Browsing online

The Online view browses the character sites from inside the app: search, sort, filter, preview a card in full, and import it with its online link kept, so you can check it for updates later. Every request to a site goes from your browser or your server straight to that site; Project Σ runs no service in between.

These sites are run by other people and change without notice. When a site changes its API, its browsing can break until the app catches up.

The sites

SiteOn at firstWhat an account adds
ChubAIyesOptional token: following, your favorites, restricted content
JannyAIyesNone needed; full card text needs the Hosted Browser
CharacterTavernyesOptional session: NSFW content
PygmalionyesOptional login: NSFW content and following
WyvernyesOptional login: following and the recommended sort
BotbooruyesOptional login: NSFW, favorites, follows, favorite tags
JanitorAI (beta)noNeeded past the first page, for following, and for hidden definitions; also needs the Hosted Browser
DataCat (beta, deprecated)noNone needed
RisuAI Realm (beta)no, it comes with an extensionNone needed

Choosing your sites

Settings > Online > Provider Order & Defaults lists the sites. Drag them into the order you like; the Online tab opens on the first one unless View Defaults names another. The eye on each row shows or hides that site in the Online tab, and each row can set the view and sort the site opens with and whether it starts with Hide Owned or Hide Possible. Turning on a beta site shows a short note about what it needs first.

The RisuAI Realm arrives with its bundled extension: switch on RisuAI Realm under Settings > Extensions and it appears here.

With two or more sites on, a menu at the top of the Online view switches between them. On a phone, Switch Provider in the More sheet does the same.

Browsing

Each site's bar has its own search box, sorts and filters, matched to what that site offers:

The Online view on ChubAI, its controls numbered
Browsing ChubAI
  1. The site you are browsing. See Choosing your sites.
  2. Browse this site's lorebooks, on the sites that have them. See Lorebooks online.
  3. Browse everything, or Following: new characters from the creators you follow.
  4. The sort. Where a list has no sort to choose, the sort stays in its place, greyed, and says how the list is ordered: a following feed that comes in one order shows it (Latest Updates on ChubAI's timeline, Newest Created on Wyvern, Feed Order on JanitorAI), and a creator's characters show Creator's Sort (Uploader's Sort on Botbooru), since their sorts sit in the creator's bar, by their name.
  5. Tags.
  6. Features.
  7. SFW Only: the NSFW switch.
  8. Refresh.
  9. The search box, and its arrow to search.
  10. The search for creators.
  11. A character: click it for its preview, below. marks one already in your library.

The same controls on every site, matched to what that site offers:

  • Search: by name or keyword. Several sites also accept a link to a character page, which opens that character directly, and most have a separate search for creators.
  • Sort: the site's own orders, such as trending, newest or most downloaded. Each order wears an icon, the same one on every site (a flame for hot, a calendar for newest), so a menu reads at a glance.
  • Tags: include or exclude tags (most sites cycle each tag through included, excluded and neutral), with extra options such as token limits where the site supports them.
  • Features: on/off filters such as "must have a lorebook" or "exclude forks", and on every site Hide Owned Characters and Hide Possible Matches.
  • The NSFW switch, remembered per site.

Switching between Browse and Following, or into a creator's characters, never rearranges the bar: every control keeps its place. One that cannot apply to the list you are on stays greyed, and hovering it (or tapping it on a phone) says why. Tags keep working in Following, filtering the characters it brings in. While filters are on, Tags and Features show how many with a small number on their corner, so the bar never shifts as you pick them.

More results load as you scroll. Settings > Online > Infinite Scroll turns that off per site, for a Load More button instead.

Exclude Tags in each site's settings section hides tags you never want to see from every search on that site.

Creators and following

Click a creator's name to browse only their characters, with the creator's own sorts and a Follow button. Sites that support following (ChubAI, JanitorAI, Pygmalion, Wyvern, Botbooru and DataCat) have a following view listing new characters from the creators you follow; Manage there lists them, adds one by name or link, and unfollows.

In Library and Possible Match

Characters you already own show an In Library badge, matched by the online link your character carries.

Characters that look like one you own get a Possible Match badge, on any site: the same card re-uploaded elsewhere is the common case. The badge weighs who made the card, the site's own description of it when the site shows one, and how common the name is in your library: owning twenty different characters called "Narrator" does not flag every Narrator online, while the same creator, the same description or a long, unusual name does. A character of the same name that you own from another page on the same site is weighed by its public description: the same description counts fully, a different one not at all (creators often publish several cards of one name), and when there is nothing to compare the badge shows dimmed as a possible match. The brighter the badge, the surer the match. Settings > Online > Possible Match Detection > Sensitivity (0 to 100, default 65) sets how readily it appears; lower flags more. The badge is only a hint: importing still runs a full comparison against your library (see The duplicate warning).

Hide Owned Characters and Hide Possible Matches in a site's Features menu remove those cards from the grid.

Previews and importing

Click a card for its preview: the full text the site provides (description, scenario, greetings, examples, creator's notes), its stats, its lorebook and gallery when it has them, and Import. Settings > General > Character Details > Collapse all browse preview sections by default starts each preview folded.

A character's preview on ChubAI, its controls numbered
A preview
  1. The picture: click it to see it full size.
  2. The creator's name: their other characters. See Creators and following.
  3. The creator's profile on the site.
  4. Adds the character to your favorites on the site, with your account there.
  5. Open: the character's page on the site.
  6. Import.
  7. A section's heading: folds its text or opens it.

Every site's preview has this layout. Only ChubAI and Botbooru have the heart, and Botbooru names the card's writer and its uploader apart.

Import first checks your library for the character. With Import in the background on (Settings > Media, on by default), the preview closes at once and the import joins a queue, one at a time per site, followed in the notifications bell, where a failure can be retried. Off, the preview waits for the import.

An import that could not fetch part of a character still comes in, and a warning names what it came in without: its picture (it gets a plain placeholder), a linked lorebook on ChubAI, or on CharacterTavern the card file (its picture, and any alternate greetings, tags or lorebook only that file carries) or, when the file came but would not read, the card inside it. On JannyAI and Pygmalion, when the character's page could not be read, only what the search listing shows comes in, and the warning says it came in without its definition: delete it and import it again later.

A card with media beyond its picture (images its text links to, a gallery on the site, galleries on image hosts) is handled by When an import has extra media, also under Settings > Media:

  • Download in the Background (the default): queued for the background downloader while you carry on.
  • Ask Me (Show a Download Prompt): a window lists what there is, with Download All.
  • Do Nothing.

Most people want an imported character to arrive complete, so the media downloads by itself. To be asked first, or to skip it, change When an import has extra media under Settings > Media.

Lorebooks online

ChubAI, Wyvern and Botbooru also publish lorebooks. The toggle beside the site menu (Browse this site's lorebooks) switches the Online view to them: search and sort, preview a book, and Import it into your library. See Lorebooks.

Accounts and logins

Logins are set in each site's section under Settings > Online, and some sites also ask in place when you reach for a feature that needs one. Tokens and passwords are kept with your account's settings on the server.

SiteWhereWhat you enter
ChubAIAuthenticationURQL Token: the URQL_TOKEN value from chub.ai's local storage while you are signed in there; the check button beside it confirms ChubAI knows the token and names your account
JanitorAIStep 2: Account LoginEmail and Password (Sign In runs through the Hosted Browser), or a session token in Token with Use Token
CharacterTavernSession CookiesCookie String from a signed-in browser; Auto keep-alive refreshes it
PygmalionLoginEmail and Password; Remember credentials (auto-refresh token) keeps you signed in
WyvernLoginEmail and Password
BotbooruLoginUsername and Password, or a token pasted in the login window

For JanitorAI, use a throwaway account: recovering hidden definitions acts on the account (see below).

The Hosted Browser

Some sites (JanitorAI, and JannyAI's card pages) sit behind Cloudflare, which only lets real browsers through. The Hosted Browser is that browser, shared by every site that needs it. Set it up under Settings > Online > Hosted Browser, where Browser picks one of two:

  • Run One for Me (Recommended): the server starts a hidden Chrome, Chromium or Edge on its own machine the first time something needs it, and stops it after 10 minutes idle. Start Now and Stop control it by hand. With accounts on, only admins can use it; others use their own browser instead.
  • Use My Own Browser Endpoint: point Endpoint at a Chrome DevTools address, such as a Chrome started with --remote-debugging-port=9222. This suits a server without a screen or graphics, or an account on a shared server. Project Σ's download comes with a ready-made endpoint to run on another machine, the hosted-browser tool, with its own instructions.

If it says "No Chrome, Chromium or Edge found on this machine", install Google Chrome or Microsoft Edge on the machine running Project Σ, then press Start Now. A browser installed somewhere unusual can be named instead: start Project Σ with CL_BROWSER set to the path of its program. Or set Browser to Use My Own Browser Endpoint and use a browser on another machine. On an Android phone it says "No Chromium found on this phone": the browser there is Chromium from Termux, which you install yourself, and JanitorAI and JannyAI on an Android phone walks through it, signing in included.

The test button (Test this browser) checks the browser: that it answers, that it can run pages, its codecs and graphics. Codec and graphics rows are only hints. The decider is each site's own check, Check janitorai.com and Check jannyai.com in their sections, which tries to get past Cloudflare for real: a pass there means the site works. Whether a given machine passes varies, so check rather than guess.

Signing in and getting past Cloudflare are separate: a login does not get you past Cloudflare, and getting past Cloudflare does not sign you in.

Extensions can use the Hosted Browser too. Under Extension Sites in the same section, every site an extension you switched on has registered is listed with its own Check. That list is what each extension declared, not a limit: an extension has full access, so it can use the browser anywhere. Such an extension drives the browser with every login it holds on that site, so the warnings in Using extensions apply.

Notes per site

ChubAI

Browsing and importing need no account. A token adds the following view, My Favorites and the favorite button. The following view is ChubAI's own timeline: the latest updates from the creators and tags you follow, newest first, loading as you scroll. Build the timeline from every followed creator (in Settings > Online > ChubAI) lists each followed creator's newest characters instead, in an order you choose from the sort menu; it asks ChubAI once per creator, so it loads slower the more creators you follow. ChubAI is the one site with version history: a linked character's version history lists every version published there. ChubAI's lorebooks can be browsed too.

JanitorAI

First-party access to janitorai.com, off by default (beta). It needs the Hosted Browser, and an account for anything past the first page of results, for following, and for hidden definitions. On an Android phone, JanitorAI and JannyAI on an Android phone walks through all of it. Settings walks through both: Step 1: Browser and Step 2: Account Login. A sign-in that leaves no session says why: JanitorAI's own message, Cloudflare's human check not passed on the sign-in form (on a phone the usual case, so paste a session token there; elsewhere most often a VPN), or a sign-in that never left the form.

Many JanitorAI characters hide their definition. Their preview says so and offers Extract Now, which recovers the definition by having the site build a prompt for a chat with the character and reading it back. For that one request, on your JanitorAI account, it creates a throwaway persona with a random name, a temporary API preset pointed at an address that goes nowhere (so nothing is sent to any model), and one chat with one message; all of it is removed and your settings restored afterwards. On an account that has never chatted, your profile name is set to the same random name for the request and cleared again. If JanitorAI refuses to put any of it back, a warning says what to fix on janitorai.com. When the creator has also turned off outside API use, Try Anyway asks JanitorAI's own model to repeat the definition back instead; check what comes back, since it is the model's copy rather than the creator's text. Importing a character with a hidden definition runs the extraction first.

In the Update Checks group, Recover hidden definitions on update checks (off by default) does the same during update checks. In DataCat Migration, Migrate DataCat Links... turns characters linked through DataCat into JanitorAI links where it can.

JannyAI

A mirror of JanitorAI with no account and no following. Browsing and search work without setup, but a card's full definition lives behind Cloudflare: without the Hosted Browser, an import gets only the name, picture, tags and blurb. Press Check jannyai.com after setting up the browser. JannyAI's Cloudflare can be stricter than JanitorAI's; if the managed browser fails, point the Hosted Browser at a browser of your own.

CharacterTavern

NSFW content needs a session: paste the cookie string from a browser signed in to CharacterTavern. Filters include having a lorebook and being an original character. The sort menu offers CharacterTavern's own orders: Popular, Best, New & Noteworthy, Top Rated, Hidden Gems, Newest and Recently Updated. Search results show a card's tokens; its likes, tags and alternate greetings appear in the preview once the character's page loads.

Pygmalion

NSFW content and following need a login. Pygmalion follows creators by user id.

Wyvern

Browsing, searching and the Popular NSFW sort work without an account; a login adds following and the Recommended sort. Wyvern's lorebooks can be browsed too.

Botbooru

A tag-driven catalogue. Without an account you browse SFW cards; logging in adds NSFW (and NSFL, with Include NSFL posts), your favorites, following and your account's tag blacklist. Favorite Tags boosts tags in the Curated sort; Weighted tag mode (experimental) gives each tag a weight from -1000 to 1000 instead, with always-follow and always-block, and the sort menu then lists Curated (Recent), Curated (Tag Score) and Curated (Only Followed). Under Downloads, Report downloads to Botbooru (on by default) counts your imports on the site.

DataCat

Deprecated and off by default. DataCat mirrors JanitorAI and can extract characters it does not have yet (Extract). Some of its sorts come from JanitorAI behind Cloudflare and are often unreachable; its own sorts work without setup.

Its section in Settings:

  • Session: the anonymous Token the app uses to browse, made for you. New Token makes another and Clear Session drops it.
  • Extraction: Publish extracted characters on DataCat puts what you extract on DataCat's public feed (off keeps it private), and Re-extract characters on update checks asks DataCat for fresh data before each comparison, which is slower.
  • JanitorAI Login (Hampter pagination): JanitorAI shows only the first page of the sorts it serves to visitors without an account. Paste a JanitorAI session Cookie and press Save Login to page further.
  • Card Maintenance: Restore Original Avatars finds DataCat-linked characters that still carry DataCat's smaller picture, shows the current and original side by side, and replaces the ones you pick.

RisuAI Realm

Comes with the bundled RisuAI Realm extension, off until you switch it on. Search accepts tag:name terms. The full definition, greetings and lorebook arrive with the import; update checks are not available.

Linking characters to their source

A character linked to its online page can be checked for updates, can download its gallery from the site, and shows In Library when you browse. Imports from the Online view and from links are linked automatically.

To link one by hand, click Link on its Details tab (or Link to Provider in its card menu).

Link to Provider for a character not linked yet, its controls numbered
Link to Provider
  1. The name and creator to search for.
  2. All Providers, or the one site to search.
  3. Searches; pick the right result to link it.
  4. A character page's link, pasted.
  5. Link this URL.

For a linked character, the same place opens its link window: View on the site, Download Gallery (for sites with galleries), Version History, Update Lock (Skip this character during update checks) and Unlink (which saves a snapshot first).

More Options > Auto-Link Characters searches your sites for every unlinked character in your library and sorts the results into Confident, Needs Review and No Match, by the same rule as Find Duplicates. Confident matches have the same name (a version tag such as "(v2)" aside) and the same creator, or, when either side has no creator, the character's own text; they are ticked for you. For each one needing review, pick the right match. Nothing is linked until you press Link Selected. Stop pauses the scan, and you can resume it while the app stays open.

Auto-Link with every character matched with confidence, its controls numbered
Auto-Link Characters
  1. Confident, Needs Review and No Match, each with its count.
  2. Select All and Deselect All.
  3. A character's box: tick it to link it.
  4. Opens the character's possible matches, to pick the right one.
  5. Link Selected.

Checking for updates

For a linked character, Check for Updates in its card menu compares your copy with the current card on the site, field by field. Open a long field to see your version and the site's side by side. Tick the changes you want and press Apply, which counts them. A change that would empty a field you filled is marked empties your field. With auto-snapshots on, the character's state before the update is saved to its version history.

Check for updates on one character, its controls numbered
Checking one character
  1. The character's name: opens it.
  2. Ticks every change, or none.
  3. A change's box: whether it is applied.
  4. Opens a long change to compare your version and the site's.
  5. Apply, counting the ticked changes.

To check many at once, select them and press Updates, or use Settings > Online > Card Updates > Check All for Updates for every linked character. First pick which fields to compare (comparing tags often turns up differences you do not care about), then Start Check. Each character's row says what was found and names the changed fields, and View opens its changes. Tabs above the list show only the characters with changes, up to date, failed, unavailable, locked or updated, once there are any.

Checking two characters at once, its controls numbered
Checking many characters
  1. Ticks every character shown, or none.
  2. A character's box: whether it is updated with the others.
  3. The character's name: opens it.
  4. View: its changes.
  5. Update Lock: locked, the character is skipped by update checks.

Cancel stops the check before the next character (one it was still fetching waits with the rest), and the same button then offers Resume for them; with none left, it is Close. Review opens a summary of every change the ticked characters would take, with any change that would empty a field listed separately, and Apply to in the summary applies them (both buttons count the characters).

A character with Update Lock on is skipped. Embedded lorebooks are compared entry by entry; applying replaces the card's embedded book only (see Lorebooks and card updates).

What each site supports:

SiteUpdate checksGallery downloadVersion historyLorebook browsing
ChubAIyesyesyesyes
JanitorAIyesnonono
JannyAIyesnonono
CharacterTavernyesnonono
Pygmalionyesyesnono
Wyvernyesyesnoyes
DataCatyesnonono
Botbooruyesyesnoyes
RisuAI Realmnoimages arrive with the importnono

When a site fails to load

The grid shows what went wrong, with Retry and Copy Error Report. The report is ready to paste into a bug report: it includes the app version, the site, the error and your settings as on/off flags only, never your tokens.

Settings and themes

Using Settings

More Options > Settings opens Settings, with its sections down the side: General, Online, Media, AI, Chat, Extensions, Account, Developer and Info. Search... at the top finds a setting in any section. On a phone, Settings opens on a list of its sections, each with a line on what it holds, under Search...; tap one to open it, and back returns to the list.

Settings on the General section: the start page and the view defaults
Settings

Most settings wait for Save Settings at the bottom. A few apply the moment you change them: UI Scale, Modal Size, Button Style, Mobile Layout, and every button that runs something (Back Up Now, Reset window layouts, and the like). The theme, custom CSS and extensions have their own save buttons. A connection or persona you are editing, and a key or login you pasted, each have a Save of their own too, and Save Settings saves them along with everything else; if one can't be saved (a key the service turns down, say), Settings stays open and says why. Closing Settings with anything unsaved lists what it is and asks whether to discard it.

Restore Defaults puts every setting back as it shipped, after listing what you would lose (your theme, custom CSS, tag rules, saved prompts and window layouts, among others). Saved logins and tokens are kept, and so are your extensions' switches.

Settings belong to your account and follow you to every device, except Mobile Layout, which is kept per device.

Where each section is covered:

SectionCovered in
Generalbelow, and the start page in Getting started, search defaults in Search and filters, duplicates in The library, display names in Character details, version history in Character details, backups in Data and backups
OnlineBrowsing online
MediaMedia and galleries
AIConnections
ChatPersonas (the rest of a chat's settings live in its own windows, see Chat windows)
ExtensionsExtensions
AccountAccounts and server settings, and the migration in Bringing a SillyTavern library

The theme

Settings > General > Theme & Layout > Theme opens the theme editor, with a live preview of a dialog, a window, a conversation and buttons. Nothing changes for good until Save.

The theme editor: starting points, the accent colour and the surface sliders, with a live preview
The theme editor

Start from offers presets: Glass, Frosted, Solid, High contrast and Classic. Then adjust the groups of settings:

  • Accent: the accent colour.
  • Surfaces: glass opacity, blur, borders, shadows, the app and panel backgrounds, the top bar, glow, grain and vignette.
  • Phone surfaces: opacity and blur on a phone.
  • Header: the tint, colour and fade of window headers.
  • Text: the body, secondary, faint and muted text colours.
  • Shape & type: corner radius, density, text size, the interface font (Noto Sans (default), System, Segoe UI, Humanist, Serif or Monospace) and line spacing.
  • Conversation header: its fill and blur.
  • Transcript: message text, speech, narration and emphasis colours, the character and user message plates, avatar size and the transcript font.

Each setting has a reset button. Every token at the bottom opens every colour and size the app's stylesheet defines, for full control.

Export saves your theme as a file and Import loads one (an imported theme applies when you save). Reset Defaults puts the draft back to the shipped theme. Closing with unsaved changes asks what to do.

Themes can also come from extensions: the bundled Midnight theme brings palettes, a sky and a layout of its own, and the bundled Σ theme finishes the app's own design with calm palettes and the chat windows' material on every surface. Each is switched on under Settings > Extensions, and your own theme and custom CSS still apply over it.

Scale, size and layout

Under Settings > General > Theme & Layout:

Theme & Layout in Settings: the theme, mobile layout, UI scale, modal size and window layouts
Theme & Layout
SettingChoicesWhat it does
Mobile LayoutAuto (Default), Always, NeverWhether to use the phone layout; kept per device
UI Scale80%, 90%, 100% (Default), 110%, 120%Zooms the whole app (computers only)
Modal SizeSmall, Medium (Default), Large, Extra LargeThe size dialogs open at; Extra Large needs 80% scale
Window layoutsReset Window LayoutsPuts every dialog and chat window back to its default size and place
Accent Colora colourThe accent, which links and the keyboard focus ring take too; a warning shows when your custom CSS overrides it
Button StyleGlass (Default), SolidTranslucent or opaque buttons

Dialogs and chat windows can be resized by dragging their edges; double-click an edge to reset that one. A dialog's side panel (the character details, Settings, the Lorebooks manager, the Custom CSS editor, the creator) widens the same way, by its inner edge.

Character details and the grid

Settings > General > Character Details:

  • Show provider tagline in character details (on), with Allow rich tagline display (off) for HTML taglines.
  • Rich creator's notes rendering (on): creator's notes render with their own styling in a sealed frame.
  • Expand creator's notes by default (off).
  • Snap-scroll in browse previews (phones only, off).
  • Collapse all browse preview sections by default (off).

Card Grid & Browse is in The library. Its phone-only settings: Provider quick switch, Hide modal back-arrows (rely on the phone's back button instead), Quick-import button on browse previews, Swipe gestures on character cards and Haptic feedback.

Imports holds Import unrecognized URLs as direct downloads (see Importing and exporting).

Custom CSS

Settings > General > Custom CSS > Open Custom CSS Editor lets you restyle anything with your own CSS. Use it at your own risk: the app's class names can change between versions.

The editor has two modes:

  • Raw: one block of CSS. Apply Raw makes it the active CSS; Save as Snippet keeps it as a snippet.
  • Snippets: named pieces of CSS you switch on and off and drag into order. New adds one; Save Snippet saves it; Apply Snippets combines the switched-on snippets, in order, into the active CSS.
The Custom CSS editor in Snippets mode with one snippet open, its controls numbered
The Custom CSS editor
  1. The two modes, Snippets and Raw.
  2. New: adds a snippet.
  3. A snippet's row: drag it into order, tick its box to switch it on, click its name to edit it, and Open AI assistant (shown when you point at the row) to work on it with the CSS Assistant, below.
  4. Deletes the snippet you are editing.

Custom CSS is limited to 64 KB, and script and style tags are removed. Overriding the app's own colour and size tokens (the ones Every token in the theme editor lists) is the most reliable way to restyle it.

If your CSS makes the app unusable, open the browser's developer console and run clResetCSS(): it clears the active CSS and keeps your snippets. clDisableCSS() switches it off for that tab only, until a reload, which tells you quickly whether your CSS is the cause.

The CSS Assistant

The wand on a snippet in the Custom CSS editor (Open AI assistant) opens the CSS Assistant: describe a change to the app's look, and it writes CSS for it, knowing the app's components and tokens. The snippet you opened it from is sent along with your next message, so you can refine it. Each answer's CSS can be copied, saved as a new snippet (switched off until you switch it on), or written over the snippet you started from. It needs a connection; pick it in its Connection menu (see Connections).

The CSS Assistant opened from a snippet, its controls numbered
The CSS Assistant
  1. Connection and its Overrides.
  2. Reset: starts a new conversation.
  3. Leaves the snippet out of your next message, for a fresh start.
  4. Describe a UI tweak (Enter to send, Shift+Enter for newline): what you want changed.
  5. Send.

Themes, Custom CSS and theme extensions

Three things change how the app looks. They stack, and each suits a different job.

The same library in the default look and in the bundled Midnight theme
The default look and Midnight

The theme

The theme editor (above) sets the app's design tokens: the named colours, sizes, corners, fonts and effects its stylesheet is built from. It cannot add a rule of its own, use a picture (a value with url( is refused), or reach anything the tokens do not cover. The theme belongs to your account and follows you to every device, and app updates keep it, since the tokens are the app's stable surface; a value for a token an update removes is dropped. Export saves it as a file and Import loads one. The file also carries your active custom CSS; when that differs from yours, Import asks first, and Keep mine (the answer Escape gives) leaves your CSS alone while Take its CSS replaces it once you save. Making a theme takes minutes, with a live preview, and Reset Defaults puts it back.

Custom CSS

Custom CSS takes any CSS: any selector, any property, pictures and fonts from the web included (a picture or font from another site is fetched from there whenever the app is open). Keep it as snippets you switch on and off one by one, or as one block. It belongs to your account like the theme, but has no file of its own: the theme's Export carries the active CSS as one block. Rules that name the app's classes can stop matching when an update changes its markup; rules that only set tokens keep working. A bad snippet can hide the whole interface, which clDisableCSS() and clResetCSS() undo (see Custom CSS). The CSS Assistant writes snippets for you.

Theme extensions

An extension can be a look of its own. The simplest is a stylesheet alone: a folder holding a manifest and a CSS file, installed once on the server and switched on by each account that wants it. A full theme extension like the bundled Midnight theme adds code: a settings section, palettes, layout choices written as classes on the page, a sky drawn behind everything, a tint read from a character's portrait, commands and a menu verb, and files it keeps for your account. Extensions run with full access to the app and are installed by an admin (see Extensions); they are shared as a folder, a zip or a git repository that any Project Σ server can install. Switching one off takes its look away, and starting the server with CL_EXTENSIONS=off takes every extension's away. Making one ranges from a CSS file and a few lines of manifest to a full extension (see Writing extensions).

How they stack

When two rules are equally specific, the later layer wins:

  1. The app's own stylesheets.
  2. The stylesheets of the app's modules and of your extensions, in the order they load.
  3. Your theme: the theme editor's tokens and your accent.
  4. Your custom CSS, always last.

So a token your custom CSS sets beats the same token in the theme (the theme editor then marks that setting Set in CSS, and moving it changes nothing on screen), and both beat an extension's stylesheet. A more specific rule, or one marked !important, still wins whatever its layer. The palette accent of Midnight or Σ is such a rule: it applies only while you have picked no accent of your own and your custom CSS sets none. Accent Color shows a warning when your custom CSS overrides the accent.

A snippet that is almost a theme

A snippet that only sets tokens on :root, such as :root { --accent: #e0a040; }, looks like a theme and mostly behaves like one. The differences:

  • It outranks the theme editor, which shows Set in CSS on every setting the snippet covers.
  • It is not part of the theme, so the theme editor's presets and Reset Defaults leave it alone.
  • It travels in a theme file only inside the active CSS block, and an import replaces the receiver's active CSS rather than joining their snippets.
  • It can do what a theme cannot (a url(, any selector), and nothing checks its values.

Which to use

You wantUse
Different colours, corners, spacing or fonts across the appThe theme
To hand your whole look to someone as one fileThe theme's Export, which brings your active custom CSS along
To restyle one part, hide something, or use a pictureA Custom CSS snippet
Several tweaks you switch on and off separatelySnippets
A tweak written for you from a descriptionThe CSS Assistant
One look for several accounts, or for other serversA theme extension that is a stylesheet
A look with its own settings, palettes or motionA full theme extension, like Midnight or Σ

Developer

Settings > Developer:

  • Logging > Enable debug logging: extra detail in the browser's console and the server's log.
  • Character Inspection > Show "Info" tab in character modal: adds the Info tab to character details (see Character details).
  • Export > Export Character downloads: Card PNG (the default) or CHARX (Card and Gallery), the card as a V3 card with its picture and every gallery file (see Exporting one character).
  • Export > Export as provider links: makes Export Character copy the character's online link instead of downloading a PNG (see Importing and exporting).

Info

Settings > Info shows the version of Project Σ the server runs (Version Info) and, under Repository, where the project's public repository is.

For an admin, Updates says what the last check found: up to date, a newer version with Update Now (or How to Update for a ZIP or Docker install), an update running, or one waiting for a restart. Check Now asks GitHub at once, and Tell me when Project Σ has an update (on by default) checks once a day and puts a newer version in the notifications. See Updating.

Extensions

Extensions add features to Project Σ: windows in a chat, actions in menus, views beside Characters and Chats, online sites, macros, connection kinds, themes. A set ships with the app, and others can be installed.

Installed extensions run with full access to the app, the server and the computer it runs on. Read Before you install anything first.

Before you install anything

Read this before installing any extension that did not ship with the app.

An installed extension is code that runs inside Project Σ with no limits. There is no permission system and no sandbox, and nothing in the app can stop an extension that wants to do harm. Once installed, an extension can:

  • read, change or delete every character, chat, lorebook, picture and setting on the server, for every account;
  • see the API keys, passwords and logins saved in Project Σ, and act on the sites the Hosted Browser is signed in to;
  • read and write files on the computer running the server, and reach anything that computer can reach, on your network and on the internet.

If it has a server part, that part starts at the next server restart, whether or not anyone switches it on, and runs on the server with access to every account. Switching it on for your account runs its code for you, in your browser, on the server or both, with everything your account can do.

Project Σ does not review, check or vouch for extensions, and is not responsible for what they do. Whatever an extension does is on its author and on whoever installed it. So:

  • install only an extension whose code you have read, or one from an author you have real reason to trust, and read the code even then: accounts get taken over and projects change hands;
  • prefer an extension whose source sits in a public repository with a history you can look at over a zip from a stranger;
  • treat every update as new code, and look at what changed before you update;
  • on a server other people use, remember that what you install runs for all of them;
  • when in doubt, do not install it.

The extensions in the Bundled group ship with Project Σ and update with it; everything above is about the ones you install.

Turning extensions on

Settings > Extensions lists them in two groups: Installed (extensions added to this server) and Bundled (the set that ships with the app). The switch on each row turns it on or off for your account only; it takes effect at once, without a reload, and follows you to your other devices.

Settings, Extensions: the bundled extensions, each with its switch
The bundled extensions

Open a row (the chevron) to read what the extension adds and to reach its own settings, which appear there while it is on. Extensions that call a model have a Connection setting. Its default is The one the chat uses for an extension that works on a chat (the chat's own connection if you gave it one, else the default) and The one your chats use for one that does not (see Connections).

The bundled extensions

Every bundled extension starts switched off.

They are examples, not core features. Every bundled extension was vibe-coded: written entirely by AI, without the author reviewing it line by line. They were built as a stress test of the extension API, an attempt at what someone other than the author might build on it. Nothing else in the app depends on them, and they may have rough edges: use them as they are if they suit you, or as samples to learn from or to start an extension of your own.

ExtensionWhat it doesNeeds a connection
AnthropicAdds the Anthropic Messages API connection kind, for Anthropic's modelsits own API key
Auto-taggerTags characters with your model: new arrivals without tags, or a selection on demand (Suggest Tags with AI)yes
Chat TimelineEvery chat with a character drawn as one branching tree: search it, jump to a message, branch from any point, and see the alternates you did not takeno
Hello WorldA tour of everything an extension can do, for people writing extensions; Hello World Tour in More Options opens its viewfor its demo call
Library StatsA Stats view: what your library holds, who you chat with most, your most used tags, and when you chatno
Lore SearchSearches every lorebook at once, finds entries like the one you are reading, and lets a chat look into books it does not useno
MemoryKeeps a running summary of each chat, written by your model and placed in the prompt, so long chats keep their factsyes
Midnight themeA new look for the whole app: palettes, a sky drawn behind it and a layout you choose part by part (Midnight theme)no
Next BeatSuggestions for where the story goes next, as buttons above the message box or a window of its ownyes
Ratings and NotesOne to five stars and a private note per character, a Rating tab, a rating sort and filterno
RisuAI RealmThe RisuAI Realm as an online site to browse and import fromno
Send to CreatorSend to Creator in a character's card menu opens the character creator with that character's fields, tags, greetings and picture in it, to make a new character from themno
Σ themeThe app's own design, finished: the material of its chat windows on every surface, calm palettes, and a layout you choose part by part (Σ theme)no
Story BeatsPlan the moments a story should reach and feed them into the prompt as guidanceyes
TrackersKeeps a chat's state (the scene, the cast, an inventory, relationships, or your own) up to date after each replyyes
TranslatorTranslates chat messages, replies as they arrive, and what you sendyes

Where they show up: chat windows open from a conversation's header (and the Windows tiles on a phone), menu actions appear in the card menu, the selection toolbar and the conversation's options menu, and views appear beside Characters, Chats and Online (on a phone, under Views in the More sheet).

Midnight theme

The Midnight theme gives the whole app the look of an observatory at night, and every part of it can be set back to a plainer form. Switch it on in its row under Settings > Extensions, then open the row; its settings apply as you change them.

  • Palette: Midnight (ice blue on navy), Aurora (teal into violet), Ember (amber and rose), Moonlit (silver, high contrast), or Auto, which follows the hour: Ember at dawn, Moonlit by day, Aurora at dusk and Midnight at night. New Palette opens an editor for one of your own (its Accent, Base hue, Glow and Sky), with the app showing it as you go; Save Palette keeps it for your account. An accent colour you picked in the theme or in custom CSS stays, and the palette colours the rest.
  • Layout: Navigation (Left rail or Top bar) and Top bar (Floating capsule or Docked), both for a desktop; Grid tiles (Windows, each portrait in a window with its name on a plate, or Full-bleed); Window shape (Arch, Rounded or Square); Names on tiles (Always or As the app shows them); Conversation (Editorial, replies set under their speaker's name and your turns in glass capsules, Glass bubbles, or The app's own plates); Character details (Hero banner, opening on a band of the portrait's light, or Plain header).
  • Type and shape: Display face (Marcellus, System serif or The app's own) and Corners (Soft or Crisp).
  • Motion and sky: Motion (Full, with shooting stars, Gentle, at half speed, or Off; it stays still when your system asks for less motion) and Hover lift. Draw the sky puts stars, an aurora, embers or a moonlit haze behind the app, as the palette says, and How much sky sets how much of it there is (Balanced, Sparse or Rich). Tint a conversation with its character's colours leans each conversation's glow toward its character's portrait.

Next Palette in the More Options menu (the theme-midnight.next command) steps to the next palette, your own and Auto included. Your own theme settings and custom CSS still apply over Midnight.

Σ theme

The Σ theme is the app's own design, finished. The quiet look of the chat windows (Inter, thin edges lit along the top, soft depth) is carried through every surface, the colours are calm, and a slow drift of light sits behind it all. Every part of it can be set back to a plainer form. Switch it on in its row under Settings > Extensions, then open the row; its settings apply as you change them. Σ and Midnight each restyle the whole app, so keep one of them on at a time.

  • Palette: Σ (blue and indigo), Iris (violet and rose), Lagoon (teal and blue), Amber (amber and coral) or Graphite (high contrast). New Palette opens an editor for one of your own (its two Colours, its Background hue and its Glow), with the app showing it as you go; Save Palette keeps it for your account, and Edit reopens the one in use. An accent colour you picked in the theme or in custom CSS stays, and the palette colours the rest.
  • Layout: Navigation (Top bar, or Left rail, a slim rail of icons down the left edge; for a desktop, and a window narrower than 1000 pixels keeps the bar); Grid tiles (Σ tiles, each portrait with its name and tags on its lower edge, or The app's own); Names on tiles (Always or As the app shows them); Conversation (Cards, each message on a card of its own with yours in the accent's tint, Open, replies set on the page and your turns in bubbles at the right, or The app's own plates); Character details (Hero banner, opening under a banner lit by the portrait with the name set large, or Plain header).
  • Type and shape: Typeface (Inter, the face the chat windows already use, or The app's own) and Corners (Rounded or Tight).
  • Motion and field: Motion (Full, Gentle, at half speed, or Off; it stays still when your system asks for less motion) and Hover lift. Draw the field puts soft pools of the palette's light behind the app, drifting slowly. Tint a conversation with its character's colours leans each conversation's accent and glow toward its character's portrait.

Search everything wears Σ's material while Σ is on. Next Σ Palette in the More Options menu (the theme-sigma.next command) steps to the next palette, your own included. Your own theme settings and custom CSS still apply over Σ.

Getting more from the bundled set

  • Chat Timeline: open it from a chat's Timeline window, or from Chat Timeline in a character's card menu or a chat's menu in the Chats view; that dialog resizes from its edges and keeps its size. It draws every chat with the character as one tree: each card is a stretch of messages, showing how that stretch begins, and the highlighted line is the chat you have open (or the latest one). Drag to move, scroll or pinch to zoom, and Fit or Your chat brings you back.
    • Chats lists every chat with how many messages it holds and how long ago it was used: beside the map when the window is wide, otherwise over its foot. Pick one to light its path, or its arrow to open it. A chat you named is shown by its name; one with the name it started with is shown by its date and time (and its branch number), the full name when you point at it.
    • Click a card to read that moment. It is headed by the chat you read it in, the one you have open when it passes through; the other chats that share it are listed under it, and picking one reads the moment there instead. Then come how the stretch starts and ends. Open opens that chat at this point and Branch from Here starts a new chat from it. Double-click a card to open it too. A card several chats share shows how many.
    • Every chat that ends has a flag naming it: after its last card, or under a card the other chats carry on from. Click a flag to open that chat; when three or more end at one card, a More tab shows them all.
    • The search finds words in every chat with the character. Enter steps through the matches, each shown with the line around it.
    • Swipes draws each reply's unused swipes as faded branches, and Take This Road starts a new chat that takes one of them.
    • Style picks the map's look: App (follows your theme), Parchment, Blueprint, Nebula or Daylight. Press Your Own to start your own style from the one on show, or just change a colour, the background, the corners or the type; Export saves it to a file and Import reads one back. Map style in its settings picks one too.
  • Memory: with Update after this many new messages at 0, the summary updates only when you ask, in the chat's Memory window.
  • Trackers: with Update after every reply off, a tracker updates only when you press Update Now in its window; on, each reply costs one model call per tracker the chat keeps. In the tracker editor, each field says how often it changes: Updated every reply, Filled once, then kept (the model writes it the first time and leaves it), or Yours: never updated (a field you fill in yourself, right in the tracker's window).
  • Translator: Translate into is only the default; a chat can choose its own language in its Translator window.
  • Story Beats: drag a beat by its grip to move it within its group. Its settings: The director (whether your model reads the chat every few replies to start and finish beats, and how it paces the story) and In the prompt (how the active beats are sent and how much room they may take).
  • Next Beat: each button asks for a different kind of move. Crossroads gives a spread, every suggestion a different kind of turn; Raise the Stakes, Quiet Beat, Reveal, Knock at the Door (someone or something arrives) and Jump Ahead (on to the next moment worth playing) each lean one way; Genres and Your Styles open menus of more. After Dark, for adult fiction, appears once you switch it on in the settings. Surprise Me arms a hidden turn the story brings in a few messages later, without telling you what it is. Director plays a scene you sketch several ways (Takes on one scene) or gives a suggestion for each step you list (Steps in order). Its settings come in three groups: Suggestions (how many, from 1 to 8; how long, from Brief to Detailed; and how much of the chat they read), Insert and Send (whether a suggestion replaces what the message box holds or adds a line under it, and how it is wrapped) and Surprise Me (the range of messages after which a surprise lands, the same number at both ends landing it at exactly that distance, and Endless, which arms the next from the same style each time one lands). On a phone its window scrolls as one page, the suggestions under its buttons, and a short scroll up brings the buttons back over them.
  • Ratings and Notes: Rate the Selection in the selection toolbar rates every selected character at once.
  • Lore Search: Search Lore in More Options and in a chat's options menu searches every lorebook, and More Like This on a lorebook entry finds entries like it.

The Chat Timeline, opened from a character's card menu:

The Chat Timeline for Kettle, its one chat drawn as a tree and listed beside it, its controls numbered
The Chat Timeline
  1. Swipes: draws each reply's unused swipes as faded branches.
  2. Every message: draws each message as its own card, instead of one card per stretch.
  3. Fit, Your chat and Reload.
  4. Style: the map's look.
  5. Chats: the list of chats beside the map.
  6. The zoom: Zoom out, the level (click it to go back to 100%) and Zoom in.
  7. Opens that chat.

The Story Beats window, with three beats planned:

The Story Beats window with three pending beats, its controls numbered
Story Beats
  1. Drag a beat by its grip to move it within its group.
  2. A beat's title: opens it to edit.
  3. A beat's Start, Skip and Delete, which show brighter when you point at them.
  4. Add Beat.

The Trackers window, keeping the Scene tracker, and its editor:

The Trackers window showing the Scene tracker, its controls numbered
Trackers
  1. A tracker the chat keeps; click its tab to show it.
  2. Keep track of something else: adds another tracker to the chat.
  3. A field that is yours to fill in.
  4. Edit: the tracker editor, below.
  5. Update Now.
The tracker editor on the Scene tracker's first field, its controls numbered
The tracker editor
  1. A field: its key, its label, its kind, and how often it changes.
  2. How the field shows in the window (Headline, Badge or Detail), its tone, and an example of what it holds.
  3. Move up, Move down and Remove.

An extension whose connection was deleted goes back to its default (the one the chat uses, or the one your chats use) and says so in its settings.

Installing an extension

Settings > Extensions opens on a reminder, for everyone who can switch an extension on, that installed extensions run with full access. Installing is for admins (on a single-user install, you). Under it, the install group offers:

  • a git repository address and Install (plain https addresses; the server needs git);
  • Install from a File: a .zip, such as a repository's "Download ZIP";
  • or copy the extension's folder into extensions/installed/ on the server and refresh the list.

Every install first shows what an extension can do and asks you to switch on "I understand the risk" before Install works. A new extension is installed switched off: switching an installed extension on for your account says once more what it will be able to do, and asks.

Remove from the server deletes an installed extension, its files and its folder in every account's home; if an account's folder cannot be deleted, the extension is still removed and a warning names those accounts. The tables it kept in each account's library stay, with their rows, until you drop them: npm run verify lists them as left over, and npm run verify -- --drop-leftover <id> drops them after a backup (see "Data and backups"). Bundled extensions cannot be removed or updated, only switched off.

Keeping installed extensions up to date

An extension installed from a git address updates in place; one installed another way is updated by replacing its folder.

  • Updates, under Install, says when the extensions were last checked and what that check found: every one up to date, which ones have an update waiting, or which could not be checked. Check Now on it asks each installed extension's repository whether it has a newer version. It updates nothing: an extension with one shows update available in its row, with the version coming beside the one you have.
  • The update button on an extension's row asks you to confirm, since an update is new code, then brings it to the newest version its repository holds, even when the author rewrote the repository's history. On a phone it sits under the extension's description and names the version coming. Changes made by hand inside the extension's folder are replaced. A new version that would not load is refused, and the extension stays as it was. The new version runs at once in the tab you updated from; other open tabs use it after a reload, and code that runs on the server picks it up after a server restart.
  • Tell me when an extension has an update (off by default, and saved the moment you flip it) checks once a day while the app is open and lists the extensions with a newer version in the notifications, with Open Extensions to go to the first of them and update it. On a phone the More button wears a dot while one waits. Nothing is ever updated for you. Off, nothing asks the repositories unless you press Check Now.

When an extension misbehaves

Switch it off in Settings > Extensions. If the app will not load far enough for that, start the server with the environment variable CL_EXTENSIONS=off: the app runs with every extension dark (the Extensions section then says Extensions are switched off). Remove or replace the broken extension's folder in extensions/installed/, then restart without the variable.

Writing your own

The extension authors' guide covers the extension API: events, storage, settings, windows, views, menu actions, macros, prompt blocks and online sites.

Data and backups

Where your data lives

Everything is in the data/ folder next to the install (or wherever the CL_DATA_DIR environment variable points):

  • server.yaml: the server's settings (see the README).
  • server.db: the accounts and the server's own records.
  • One folder per account (data/default/ without accounts), holding:
    • library.db: the whole library (characters, tags, chats, lorebooks, personas, playlists, version history, settings, connections), with its library.db-wal and library.db-shm companion files;
    • avatars/, gallery/, backgrounds/ and personas/: the pictures and media;
    • thumbs/: thumbnails, which are made again on demand if deleted;
    • backups/: the database backups (below).

Installed extensions live in extensions/installed/ (or CL_EXTENSIONS_DIR), outside data/; back them up too if you have any.

Library Backup

Settings > General > Library Backup shows your library's size and counts, when it was last backed up, and the backup controls:

Library Backup: the library's size and counts, Back Up Now, and the automatic backup settings
Library Backup
  • Back Up Now copies the library's database into the account's backups/ folder. The copy runs in the background, so you can keep working while it does: the copy is your library as it was when it started, and anything you change meanwhile goes into the next one. Each copy is checked before it is kept. While it runs, the button turns into Cancel, and the notifications show its progress with a cancel of their own; a cancelled backup leaves nothing behind.
  • Automatic backup: Off (the default), Daily or Weekly, keeping the newest few (Keep, 5 by default; older ones are deleted).
  • Quiet hours: automatic backups start only between these hours (03:00 to 06:00 by default), on the server's clock. Pick the same hour twice for any time. The line under them says when the next automatic backup will run.
  • Existing backups lists the copies on disk with their dates and sizes.

If the app was not running during the quiet hours, or the backup there failed or was cancelled, the notifications ask what to do: Back Up Now, Tonight (wait for the next quiet hours) or Skip (the next backup comes on its usual day). One backup runs at a time on a server, so with several accounts one may wait for another to finish.

A backup copies the database, not the images. It protects your characters, chats and everything else stored in the library, but the pictures, galleries and backgrounds are files beside it: copy the whole data/ folder now and then too.

Restoring a backup

There is no restore button; it is done by hand, and step three is the one that matters (the same steps are under How to restore one in the Library Backup group):

  1. Stop the server. Copying over a database that is open damages it.
  2. In the account's folder, rename library.db, and keep it as your way back.
  3. Copy the backup in, rename it to library.db, and delete library.db-wal and library.db-shm if they are there.
  4. Start the server and check that your characters are there.

Images are not part of the backup, so characters imported since the backup keep their files but are missing from the library, and characters deleted since come back without their pictures. npm run verify (below) lists missing files.

Search Index

Settings > General > Search Index shows how quick your searches are, index by index, and lets you tidy them yourself:

  • The three figures (Card text, Chat messages, Lorebook entries) say how many times slower a search can be, when it has to read from the disk, than it would be on a freshly tidied index. 1.0× is as fast as it gets.
  • The line under them says whether the index is in shape, when it was last tidied and how long that took, or, while a tidy-up runs, which index it is on and how far along. If a tidy-up stopped before finishing, it says so and why. Edits saved while a tidy-up runs add new pieces, so after a busy stretch an index can read in pieces again even though the line says it was just tidied.
  • Tidy Now tidies every index that is in pieces, right away and in the background, and keeps going while you work; searches may be a little slower and the disk busier until it ends. On a library of tens of thousands of cards on a hard drive the card text can take several minutes, and a large chat history a minute or so; lorebooks take seconds. Pressing it while the app is tidying on its own takes over and tidies everything. The button rests while every index is already in one piece, and while a tidy-up you asked for runs or waits its turn.
  • Tidy the search index on its own (on by default): everyday edits leave an index in pieces, so once one reaches 2.0× it is tidied for you the next time the app sits idle for two minutes. The moment you click, type or scroll again, the tidy-up pauses and picks up where it left off at the next quiet moment, so the long work happens while you are away and never while you are working. Opening the notifications to see it does not count, and neither does coming back to the app, so you can read what it is doing without stopping it. A tidy-up that stopped before finishing is tried again at the next quiet moment.
  • Load the library into memory at startup (on by default): a few seconds after the server starts, it reads your library once in the background, so the first search after a restart is as quick as every search after it. On a hard drive with a library of 17,000 cards, the first search went from about seven seconds to well under one. The read takes some seconds of disk activity after each start (about twelve on that drive), and the app stays usable throughout. Your system lends it memory it is not using and takes it back whenever another program needs it. A library too large for a quarter of the free memory is left out, and the change applies from the next start.
  • Each index lists every index with how many pieces it is in and its size on disk.

A tidy-up never runs while the library is being backed up: the backup goes first. A backup that starts during a tidy-up pauses it, and one you asked for with Tidy Now carries on once the backup is done. Pressing Tidy Now during a backup does the same: the line says it is waiting for the backup, and the tidy-up starts when it ends.

Copying the data folder

The simplest full backup is a copy of the whole data/ folder made while the server is stopped. It carries every account, every library, every picture and the server's settings. Restoring is copying it back.

Moving to another machine

  • Everything: stop the server, copy data/ (and extensions/installed/ if you use installed extensions) to the new install, and start it there.
  • A selection of characters, with their chats, galleries and lorebooks: export a full bundle and import it on the other install (see Importing and exporting).

To keep the data somewhere other than the install folder, set the CL_DATA_DIR environment variable to that folder.

Checking a library

From a terminal in the install folder:

npm run verify

checks every library in data/ against the rules the server keeps: the database's own integrity, its links between records, its search indexes and counts, and that every picture, gallery file and background its records point at is on disk. It prints what it finds and exits non-zero when anything fails. npm run verify -- --user <handle> checks one account; --db-only skips the file check, the slow part on a large media folder.

It also says who owns each table, index and trigger in a library: the app (as this version builds it), each extension by name (installed, or left over when its extension has left the server), or nobody. A table of the app's that is missing or changed, and anything nobody owns, counts as a failure. An extension's leftover tables are dropped on your word: npm run verify -- --drop-leftover <id> lists them, asks, takes a backup into backups/ as Back Up Now does, then drops them (--yes answers the question for a script). Run it with the server stopped.

A few checks can also repair what they find. npm run verify -- --repair chatMessageObjects removes chat lines an older import stored that were never messages (a line holding only a number, a word or a list), after taking a backup into backups/ as Back Up Now does. Run it with the server stopped. Asked to repair a check that has no repair, it names the ones that do.

Upgrading

A new version upgrades each library's database the first time it opens it; there is no step to run. Take a backup first if you want a way back: a library opened by a newer version cannot be opened by an older one, which refuses it with a message asking you to update.

Bringing a SillyTavern library

Project Σ can bring a whole SillyTavern user folder across: the folder holding characters/, chats/ and worlds/, usually data/default-user inside the SillyTavern install. The SillyTavern folder is only ever read, never changed, and the migration checks its own work against it when it finishes.

What comes across

  • Character cards, with their tags and favorites.
  • Chats, matched to their characters by folder.
  • Every lorebook, which characters each is linked to (including extra lorebooks per character), and the lorebooks SillyTavern had switched on globally. A lorebook whose name starts or ends with a space comes across under its name without the spaces; if another file already has that name, it comes across as "Name (2)", the summary says so, and everything linked to it still finds it.
  • Gallery images and media. Characters that share a name may come across with duplicated galleries; see Before you start.
  • From the Character Library extension, if you used it: version snapshots, playlists, custom CSS, saved chat prompts and filter presets. Saved prompts, CSS snippets and filter presets replace any of the same kind already in your library.
  • Personas: name, description, picture and one bound lorebook each; SillyTavern's default persona becomes your global one.

What stays behind

  • Group chats and group definitions. They are counted and listed so nothing disappears silently, but they stay at the source.
  • The Character Library extension's settings (logins, view preferences and its other options): set up fresh here.
  • SillyTavern's own settings: API connections, sampler presets, themes, Quick Replies, instruct and context templates. Chat-completion prompt presets can be imported separately in the prompt manager.
  • Your own regex scripts, the ones SillyTavern runs in every chat: they live in its settings. Export them from SillyTavern's Regex panel and import them in the Regex scripts window. Scripts saved on a card come across with the card, and a preset's come with the preset when you import it; both stay off until you allow them.
  • Tags applied through SillyTavern's tag manager, which live in its settings rather than on the cards. Tags written in the cards themselves come across.
  • Chat backgrounds, expression sprites and SillyTavern's other asset folders.
  • Card files with no character data inside, and chat folders that match no card (both are counted in the report).

Before you start: characters that share a name

This step is optional. Skipping it loses nothing, but it is worth knowing about.

SillyTavern keeps each character's gallery in a folder named after the character, so characters with the same name (two versions of one card, or two different characters who happen to share a name) share one folder. Project Σ gives every character its own gallery, and nothing in a shared folder says which character an image belongs to, so each character of that name comes across with a full copy of the folder: the same gallery, duplicated, mixing everyone's images.

To avoid that, sort the shared folders with the Character Library extension before you migrate:

  1. In the extension, open "Settings" > "Gallery Folders" and turn on "Use unique gallery folder names". This writes an ID into each card, so the extension asks you to back up your characters folder first.
  2. Press "Assign Gallery IDs" so every character has one.
  3. Press "Smart Relocate" under "Shared Names". It builds a fingerprint for each character from the gallery on the site it came from and the images embedded in its card, matches the shared folder's images against those fingerprints, and moves each match into its owner's own folder. "Migrate All", beside it, is optional here: a name only one character uses comes across to the right character either way.

The migration then reads each character's own folder through the ID in its card. Images Smart Relocate could not match stay in the shared folder, and every character of that name still gets a copy of them.

Plain SillyTavern has no per-character folders, so without the extension, characters that share a name come across with duplicated galleries. Installing the extension for this one step keeps them apart.

The wizard

Settings > Account > Bring your SillyTavern library runs the migration from the app, into your own library. The Coming from the Character Library extension? note above the steps sums up Before you start.

The SillyTavern migration wizard after a run: each step done with its count, then a summary of what came across
The migration wizard after a run
  1. Point at the SillyTavern user folder: type the folder's path, as it is on the machine running the server, and press Check. The plan shows how many cards, chat folders, lorebooks, media files and personas it found, how many characters are new and how many you already have, and any duplicate groups.
  2. Choose what comes across (optional): Skip cards tagged leaves out cards with certain tags; Test pool migrates only some cards first (by name, or a random number of them) so you can look around before the full run; Generate thumbnails as part of the run prepares the grid's thumbnails in the same go.
  3. Run the Migration: the run's steps appear under the button (reading the folder, lorebooks, characters and their pictures, chats, versions and the rest, the check, and thumbnails when you asked for them), each with its count as it goes, a bar for the step running now, the time left once it can tell, and how long the run has taken. If a step sends no news for two minutes it says so; large libraries can be slow there, and the run is still going. Closing Settings or the tab does not stop it, and opening the wizard again picks the bar up where it is. Run it as often as you like: every character heals in place and nothing duplicates.
  4. Finalize when you are done: one last check, then the records that link migrated characters to their SillyTavern files are removed, so they behave exactly like characters created here. Its two steps show the same way; the check is the long one, since it reads every character, chat and lorebook against your SillyTavern folder again. This is one-way: after it, running the migration into this library again would duplicate everything.

When a run ends, a summary says in plain words what came across:

  • How many characters, and how many of them are copies (cards your SillyTavern folder had twice, kept as separate characters) or were already in this library from an earlier run and updated in place.
  • How many pictures and other files, and why any were skipped: the same file was already there for that character, from an earlier run or found twice in SillyTavern's gallery folders. Nothing is lost.
  • The lorebooks and their links, chats, saved versions and personas, any lorebook renamed, and any chat folder that matched no character (its chats stay in SillyTavern, untouched).
  • What the check found: everything in place, or the differences grouped with what each means and what to do (usually: run the migration again to heal them). The lines as the tool wrote them sit under a disclosure, for a bug report.

If Finalize finds differences it removes nothing and says why, with the same groups and the next step. The full log of a run is under Show the full log. What does not come across under the wizard repeats the list above. Only one migration runs on a server at a time.

The command line

The same tool runs from a terminal in the install folder:

npm run migrate -- <path-to-st-user-dir> --user <handle> [options]

A sensible sequence:

  1. Dry run first, which prints the plan and writes nothing: --dry-run.
  2. Optionally a small test pool to try out in the app: --only "Some Character" --only "Another One", or --sample 20.
  3. The real run: no options. It prints progress, writes a JSON report into the account's folder, and verifies the result.
  4. Finalize when satisfied: --finalize.
OptionWhat it does
--user <handle>The account whose library to migrate into (required); default without accounts
--dry-runPrints the plan and writes nothing
--only <name or file>Migrates only this card, by name or file name; repeat it for more
--sample NMigrates a random N of the cards
--exclude-tag <tag>Leaves out cards with this tag; repeat it for more
--warm-thumbsGenerates the thumbnails as part of the run
--verify full, fast or offHow the run checks itself (below)
--no-verifyThe same as --verify off
--finalizeOne last check, then removes the migration's identity records
--forceRuns into a library that was already finalized (this duplicates everything)
--report <path>Where to write the JSON report

When it finishes it re-reads the source and compares it with your library, field by field, message by message, gallery file by gallery file. The full comparison re-reads every gallery file's bytes, which takes hours on a large library, so once a full check has passed over the whole library, later runs and the finalize use a quick check (everything but re-reading gallery bytes). --verify full forces the full one.

Exit codes: 0 when all went well, 1 for a usage or fatal error, 2 when some items failed to import, 3 when the check found a difference (or finalize refused). The report says exactly where.

With accounts on, create the account with the same handle from the admin panel and it picks the migrated library up.

Duplicates in the source

Two files that carry the same identity (a card duplicated inside SillyTavern, or the same character imported twice from a site) come across as two independent characters, and the plan lists every such group, so nothing merges or vanishes silently. Use Find Duplicates afterwards if you want to tidy them.

After migrating

The first browse of a big freshly migrated library is slow while thumbnails are made. Pass --warm-thumbs, tick Generate thumbnails as part of the run, or use Settings > Media > Bulk Operations > Generate Missing Thumbnails to make them ahead of time. Each portrait gets two sizes (one for lists, one for the grid), so a library of 14,599 characters makes 29,198 portrait thumbnails; gallery thumbnails are for pictures only, since videos and sounds get none. The total is counted before the first one is made, and thumbnails already there count as done.

A library migrated with an earlier version, where a lorebook named with a space at either end came across empty for the characters linked to it, is repaired on its own the next time the server starts: the book takes the name without the spaces and every link reaches it. Finalize then passes.

Then add a connection to chat (see Connections), and import your SillyTavern chat-completion preset in the prompt manager if you had one.

Accounts and server settings

Single-user and multi-user

Out of the box Project Σ has one library and no sign-in: whoever opens the page is the owner, with full access, including installing extensions. That suits one person on their own machine or home network.

With accounts on, everyone signs in, and each account gets its own library, media, settings, connections and personas, in its own folder under data/. Nothing is shared between accounts except the server itself and its installed extensions (each account switches extensions on for itself).

Turning accounts on

Set multiUser: true in data/server.yaml (or start the server with CL_MULTI_USER=true) and restart. On the first start with no accounts, the server creates an admin account called default, which takes over the existing single-user library, and prints its password once in the server's output. Sign in with it; you are asked to choose your own password straight away.

Turning accounts off again makes every visitor default once more; the other accounts' folders stay on disk untouched.

Signing in

With accounts on, the app opens on a sign-in screen. A sign-in lasts 30 days by default (sessionTimeoutDays in server.yaml; -1 for no limit, though a browser keeps a sign-in at most 400 days). Repeated wrong passwords lock that account's sign-in for a while, growing with each further attempt.

The sign-in screen with a handle and a password typed
Signing in

Settings > Account shows who you are signed in as, with Change Password and Sign Out. Changing your password signs you out everywhere else. Sign Out signs out this browser only.

Managing accounts

Admins see Users under Settings > Account, listing every account with its badges (admin, disabled, password pending). For each:

Settings, Account as an admin: who is signed in, every account with its badges and buttons, and Add an account
Accounts
  • Issue a temporary password: sets a new one-time password and shows it to you; the person must change it when they next sign in. This is how a forgotten password is reset.
  • Make admin / Remove admin.
  • Disable account / Enable account: a disabled account cannot sign in.
  • Delete account (keeps their data folder): the account goes, its library stays on disk; creating an account with the same handle later picks that library up again.

Add an account takes a handle (lowercase letters, digits and hyphens), an optional display name and a temporary password, with Administrator for an admin. New accounts choose their own password at first sign-in.

The server will not let you remove the last admin, demote or disable yourself, or delete your own account.

Server settings

Server-wide settings (the port, the address it listens on, accounts, cross-origin access, extra host names, whether the launchers open the browser) live in data/server.yaml, written with comments on the first start; most have an environment variable that wins over the file. The full table is in the README. The server refuses to start on an unknown setting or a value of the wrong kind, naming it, rather than run configured differently from what you meant.

Reaching the server from other devices

The server listens on every network interface by default, so phones and other computers on your network can open it by this machine's address. To keep it to this machine alone, set host: 127.0.0.1.

Without accounts, the server answers only requests addressed to an IP address or localhost, so a web page elsewhere cannot point a name of its own at your server. If you reach it by a machine name (a local hostname, or a name on a private network service), add that name to hosts in server.yaml; otherwise you get a page saying the server does not answer to that name. Pages from other sites can never write to your library unless their origin is listed in cors.

Anyone who can reach the port of a server without accounts can do anything there. Keep such a server off networks you do not trust, or turn accounts on.

The Account section

Settings > Account appears on every install: without accounts it holds the SillyTavern migration wizard (see Bringing a SillyTavern library); with accounts, also Signed In (who you are, Change Password and Sign Out) and, for admins, Users.

The API

The server's HTTP API is for power users who want to automate tasks and script their own library, and for extension creators: everything the app does, it does through this same API. Some of what it is good for:

  • bulk tagging and cleanup, or any batch job that would be tedious by hand;
  • scheduled imports and exports, and backups on a timer;
  • reports and statistics on what your library holds;
  • keeping a script or a home automation in step with your library through the change feed.

This page is the orientation; the API reference lists every endpoint with its parameters and answers, and the server publishes the same contract as an OpenAPI spec at GET /api/openapi.json.

The basics

  • Every endpoint is under /api and speaks JSON. Errors answer with a status and { "error": "..." }.
  • GET /api/health answers without signing in: the server's name, version, API version and whether accounts are on.
  • The reference in docs/api-docs.html is generated from the server's own spec; npm run docs regenerates it.

The spec groups the endpoints by area: characters (cards, pictures, import and export), media, backgrounds, chats, the assistant, lorebooks (worlds), the library (playlists, versions, settings, stored documents, backups, bundles, migration, background jobs), tags, the creator studio, LLM connections and calls, extensions, accounts and the admin area, and the infrastructure (health, thumbnails, the change feed).

Signing in

Without accounts, there is no authentication: every request acts as the owner.

With accounts on, POST /api/auth/login with { "handle": "...", "password": "..." } sets a session cookie that later requests send back. GET /api/auth/me says who you are, POST /api/auth/logout signs out, and POST /api/auth/password changes the password. An account that must change its password is refused everything else until it does. There are no separate API keys.

Calling from another site

A page served from another origin may call the API only when that origin is listed in cors in server.yaml (or CL_CORS); requests that carry no origin, such as scripts and command-line tools, are not affected. Writes from a page on another site that is not listed are refused.

The session cookie is restricted to the server's own site, so a page hosted elsewhere works with a server without accounts. The app itself can be opened against another Project Σ server with ?server=<address>; it asks before switching, and remembers the choice on that device.

The change feed

/api/feed is a WebSocket that tells your script what changed, so it can stay in step with the app's tabs, other devices and other scripts. After connecting it sends a hello, then batches of change records naming what changed (a character, a chat, a message, a lorebook, a setting, and so on) and, when a connection falls too far behind, a request to re-read everything. There is no history: after a reconnect, read again what you hold.

Pick an id for your script (8 to 64 letters, digits or hyphens), connect with /api/feed?client=<id>, and send the same id as an X-CL-Client header with your writes: the change records of your own writes then carry it as their origin, so you can skip them.

Background jobs

Changes over large sets (deleting, favoriting or tagging every character a filter matches, adding them to a playlist) answer at once with a job, run on the server a chunk at a time. GET /api/jobs/{id} reports its progress and DELETE /api/jobs/{id} stops it; what already landed stays.

Extensions

Extensions can add endpoints of their own under /api/ext/<id>/. The extension authors' guide covers writing them.

Extensions

Project Σ supports extensions: packages of client and server code that add to or change what the app does. An installed extension is trusted code with the same reach the app itself has, and the install decision is the security boundary.

The extensions bundled with the app were vibe-coded, written entirely by AI as a stress test of this API, without the author reviewing them line by line: an attempt at what someone other than the author might build on it. Read them to see how a door is used in a real extension, not as reviewed reference code. Hello World is the deliberate tour of each door.

The trust model, up front

Installing an extension hands its code full privileges in every user's browser session on this server, and full server-process privileges if it ships a server half: every account's library, the keys and logins saved on the server, the hosted browser's signed-in sites, the files on the machine and everything that machine can reach. A server half starts at the next restart and runs for every account, whether or not anyone switches it on. There is no sandbox and no permission system, by design, and the app cannot protect anyone from an extension that means harm. Project Σ does not review extensions and is not responsible for what they do. So:

  • Only admins can install, update, or remove extensions.
  • Install only code you have read, or code from an author you have real reason to trust, and read it even then: accounts get taken over and projects change hands. Treat every update as new code.
  • The app says so before every install (with an "I understand the risk" switch that holds the Install button), before every update, and when an account switches an installed extension on.
  • Each user chooses which installed extensions run for their own account (Settings > Extensions).
  • CL_EXTENSIONS=off in the server environment boots with the whole extension system dark: nothing is listed, served or loaded. Use it to recover from a broken install without touching the filesystem. on (or leaving it unset) runs them; any other value stops the boot with a message naming the variable.
  • On a single-user server every request acts as the admin, so whoever can reach the server's port can install an extension (as they can do anything else there). The default bind address is every interface; set host in the server config (or CL_HOST) to narrow it.

What this asks of you as an author. Your users cannot be protected by the app, so they are trusting you, and everyone who can push to your repository:

  • Say plainly in your README what your extension reads, what it writes, what it sends and where. Never send anything off the machine without saying so, and never collect data you do not need.
  • Publish your source in a repository with its history, so people can read what they install and what each update changes. A zip with nothing behind it asks for blind trust.
  • Secure the accounts that can publish your extension (two-factor sign-in on your git host): a taken-over account turns every user's next update into an attack.
  • Keep what you reach to what you need: a hosted-browser consumer under the narrowest prefix that works, the stores you use and no others.

Working with the app

Most extensions are written with a coding assistant. The advice below comes from what has actually broken extensions: an update, a second account or another extension tripping over a shortcut. It's worth handing this chapter to your assistant before it plans anything. The extension kit checks the data advice on every test run (see "Testing your extension").

Where the app ends and your extension begins

We keep the app free of code for any one extension, the bundled ones included. The app doesn't read an extension's tables, settings, chat slot, prompt blocks or macros, doesn't name an extension in its prompts, its screens or its routes, and behaves the same whichever extensions are installed. An extension reaches into the app through the doors this guide describes, and the app only ever knows it as "an extension".

One exception: the app declares the bundled RisuAI Realm's provider row itself (its name, its site, its icon and the risu: search operator), so a Realm link in your library keeps its name and risu: keeps filtering while that extension is off. Nothing else in the app names an extension.

The bundled extensions are not part of the app either. They ship as working examples and use the same public doors yours does, which is what makes them proof that those doors are enough.

Why we hold to this, even when a shortcut would be quicker:

  • Extensions come and go. Any of them can be off, removed, a version behind or ahead, or on for one account and off for another. App code that expected one would have to handle all of that, everywhere, for every extension it knew.
  • It keeps your design yours. Once the app reads your tables or your block format, you couldn't change them without breaking it.
  • It scales. A special case for one extension invites the next ten, while a generic door serves every extension, including ones nobody has written yet.
  • Switching off stays honest. Everything an extension adds goes through doors the app tracks, so switching it off takes all of it away. App code that fetched an extension's data itself would leave no trace of what it pulled in, and no way to turn it off.

Your data

Keep your extension's data in places that are yours, and change the app's data through the app's own functions.

  1. Keep your data in your own places. Configuration in ctx.settings, working state in ctx.storage, records in your own x_<your id>_ tables, and on a card or a chat only what should travel with it into an export (card.data.extensions.<your id>, ctx.chatSlot). "Where to store what" has the details.
  2. Write the app's data through ctx.stores rather than your own SQL. A character is not one row. The card you see is put together on every read from the character's row and the rows of its tags, site links and lorebook, so a tag written into the stored card is never seen. A save through the stores also keeps the character's own figures current, such as its token count, and a raw write leaves them stale. It skips the store guards, and every other open tab keeps showing the old data, because nothing tells it. And the app's updates assume its data looks the way the app left it, so a raw write can break an upgrade or be undone by one. Reading the app's tables with SQL works, but the stores give you the finished record.
  3. Keep your state out of the card's own fields. The description, the creator's notes and the tags are what the model reads, what the reader sees and what an export carries to other apps, so your state there changes all three. Put what should travel in card.data.extensions.<your id>, and the rest in your own tables.
  4. Keep one account's data in that account. Use req.db and ctx.files.user(req) for the account that made the request. Avoid holding one account's data in a variable your module keeps between requests, or putting an account's data in ctx.files.shared().
  5. Leave other extensions' data alone (see "Other extensions").

Changing what the app does

An extension doesn't need to change the app's code: it changes what the app does through the doors the app opens for it. Hooks and filters reshape a prompt, a model call or a reply; slots put your interface in named places; commands and events let you act and listen; the stores write the library the way the app itself does. The app keeps these doors stable across releases (a door on its way out is listed under "Deprecated doors" a release ahead), and switching your extension off removes everything you added through them.

Three things look like shortcuts but cost more than they save:

  • Editing the app's own files in your install. That isn't an extension: the next update overwrites it, nobody else can install it, and the license lets you share a changed copy only as a fork on GitHub.
  • Patching the running app: replacing a function on one of the window bridges, rewriting parts of the page the app draws, or reaching into the server's modules from your server half. Nothing stops you (see "Beyond the stable surface"), but it breaks on the next release, switching your extension off doesn't undo it, and two extensions doing it break each other.
  • Asking the app to special-case your extension. "Asking for a new door" describes a request that becomes a door everyone can use.

Other extensions

Please leave another extension's tables, settings, storage and chat slot alone, a bundled one's included. Its author can change them in any release, and it may not be installed, or may be off for this account. If you need what another extension knows, it has to publish it, for example as a command you call (an extension's commands are named <its id>.<name>); otherwise keep the state yourself. The bundled extensions are MIT licensed, so copying one into your own and changing it is fine.

Asking for a new door

When the doors here can't do what you need, ask for one: that's how the API grows. What helps a request become a door:

  • The capability, in general terms. For example "llm.request is told which chat an Assistant call is for", or "a slot on the Assistant's replies, like message.action". Describe it without your extension's name, id, tables or data shape, so it fits any extension.
  • What you are building, in a line or two.
  • What you tried with the doors there are, and where it stopped.
  • A second, unrelated extension that could use it.
  • What it changes with no extensions installed. Ideally nothing: a door does nothing until something walks through it.

File it as an issue. A path into the app's code is welcome as a pointer to where a door might go; the door itself is the design.

How one request took shape. An author wanted the Chat Assistant to see and change what a trackers extension keeps. The first request asked for the app's Assistant to read the bundled Trackers' state and the extensions' prompt blocks, for a badge for active trackers, and for an Assistant reply format for tracker edits. Each of those would have tied the app to one extension, so the work moved to the extension's side, where it fits: keep the state in your own extension (or your own copy of Trackers); add it to the Assistant's material with an assistant source (ctx.assistant.addSource, since API 2.9; before it, an llm.request filter for purpose === 'assistant'); act on the Assistant's answer in a reply.final filter, which on the Assistant is told the chat and the session; and show what the Assistant can see in your own window or settings. The request also found a real gap: llm.request wasn't told which chat an Assistant call was for. That was a door any extension could use, and it shipped in API 2.7.

For your coding assistant

Hand these to your coding assistant as firm rules:

  • Leave the app's own code as it is: don't edit its files, don't patch it while it runs, and don't propose app changes that read, name, special-case or depend on a particular extension, the bundled ones included.
  • Before building anything, look for an existing hook, slot, event, command or store function in extensions.d.ts.
  • If nothing fits, don't work around the app: write a request in the shape of "Asking for a new door", and build the rest inside the extension.
  • Write the app's data only through ctx.stores. Keep your own data in your settings, your storage, your x_<your id>_ tables, or your slot on a card or a chat.
  • Don't read or write another extension's tables, settings, storage or chat slot.
  • When relaying a maintainer's answer, keep what was agreed apart from what was declined: "looking into a generic door" doesn't mean "the app will build our feature".

Installing

Extensions live in extensions/installed/<id>/ on the server, beside the app rather than under data/: a fresh clone, a git clean or a backup of data/ alone does not carry your installs, so back up extensions/installed/ with data/. Three ways in:

  1. Settings > Extensions > Install (admin): paste a plain https:// git repository URL. The server clones it, validates the manifest and files it under its id; the row's update button later runs a fast-forward git pull. The server's git never stops to ask for a sign-in: a repository that wants credentials the server's git does not already hold is refused at once, in git's own words.
  2. Settings > Extensions > Install from a file (admin): a zip of the extension's folder, with manifest.json at the archive's root or inside its one folder (the shape a repository's "Download ZIP" makes), validated and filed like a clone. A .git folder inside is left out, so a zip install has no update button (remove it and install the new zip), and so is the __MACOSX folder macOS adds. The whole archive is refused, naming the reason and writing nothing, when it is not a readable zip, holds a path outside its folder or one a server cannot hold (.., a drive, a device name such as con, a character Windows refuses such as ?, on every server), names a file twice, uses a compression other than stored or deflate, or holds an entry whose bytes disagree with the archive's record of them; and past its limits: 100 MB uploaded, 10,000 entries, 50 MB an entry, 200 MB unpacked. Over the API it is POST /api/extensions/install with an application/zip body.
  3. Copy a folder into extensions/installed/ by hand and press the refresh button in Settings > Extensions. The folder name must equal the manifest id.

A broken install (missing or invalid manifest, id mismatch) shows up in the list with its error instead of vanishing.

Each user then enables the extension for their account with its toggle in Settings > Extensions. Enabling loads it at once and disabling unloads it at once, in every open tab of that account: everything it registered through ctx leaves the page, and its server half stops answering, guarding and listening for that account at the same moment (see "The server half").

Working on an extension

Edit your extension in place, in its folder under extensions/installed/<id>/, and press Reload on its row in Settings > Extensions. The tab runs the code as the folder now holds it: what the extension registered leaves first (its dispose runs), the manifest is read again, and every file of it is fetched fresh, not only the entry, as long as you import your own files with relative paths (./panel.js). A reload that fails says why and leaves nothing registered; fix the file and press Reload again. Reload changes nothing on the server, so any account can use it, and it applies an update (the row's git pull) to the tab without reloading the page.

The server half is not reloaded: Node cannot drop a module it has loaded, so a change to your server code needs the server restarted.

Testing your extension

tools/extension-kit/index.mjs boots Project Σ's own server inside your test's process, on a temporary home, with your extension's folder installed before it starts. Your test then asks your routes what a reader's page would ask, reads the changes your writes reported and pins the plans your tables are read by. The worked example is extensions/bundled/hello-world/test/hello-world.test.mjs; run it with node --test extensions/bundled/hello-world/test/hello-world.test.mjs.

// my-extension/test/notes.test.mjs
import { test, after } from 'node:test';
import assert from 'node:assert/strict';
import { fileURLToPath } from 'node:url';
import { startSigma } from '/path/to/project-sigma/tools/extension-kit/index.mjs'; // your checkout's kit

// the extension this test sits in, installed before the boot
const sigma = await startSigma({ extensions: [fileURLToPath(new URL('..', import.meta.url))] });
after(() => sigma.close());
const me = sigma.session;           // the one account of a server without accounts
const mine = me.ext('my-extension'); // your routes, under /api/ext/my-extension

test('a note is kept and reported', async () => {
    await me.enable('my-extension');  // an extension is on for an account once it switches it on
    const { id } = await me.importCard({ name: 'Nova' });
    const mark = sigma.changes.length;
    assert.equal((await mine(`/notes/${id}`, 'PUT', { text: 'hi' })).status, 200);
    assert.ok(sigma.changes.slice(mark).some(r => r.extension === 'my-extension'));
});
MemberWhat it is
startSigma({ extensions, accounts, prefix, setup, lint })boots the server: extensions are folders installed first, each under its manifest's id (a folder without a readable manifest, or whose id is an extension bundled with the app, is refused before anything starts, as is one the kit's checks stop); accounts ([{ handle, password, admin }]) makes a server with accounts; setup(dataDir) runs on the data folder before the boot; lint: false skips the checks
lintExtension(dir)runs the kit's checks on a folder without booting, answering what they found ([{ file, line, check, name, why }], empty when it passes)
sigma.sessionthe one account of a server without accounts (null when there are accounts)
sigma.signIn(handle, password, { clientId })signs an account in and answers its session; clientId is the tab id its writes carry as their origin (8 to 64 letters, digits or dashes)
session.api(path, method, body)a request under /api, answered as { status, body }
session.ext(id)the same for an extension's routes, under /api/ext/<id>
session.enable(id, on)switches an extension on or off for that account, as its row in Settings > Extensions does
session.importCard(card)imports a card (a V2 or V3 card, or just its data) as a file upload is, answering the import's row
session.apiRequest(path, method, body, opts)the raw request a module's CoreAPI.apiRequest makes, answering the Response
sigma.changesevery committed change record since the boot, each with its account (owner), as the feed delivers them
sigma.db(handle)that account's library, the database your routes read and write
sigma.explain(handle, sql, ...params)the plan SQLite picks for a statement there, line by line
sigma.analyze(handle)statistics on that library, as a running server gathers them
sigma.seed(handle, n)n characters in that library in one write, for a plan pinned at scale; answers their ids
sigma.tick(extId, scheduleId)a ctx.jobs.schedule tick now (the kit arms no timers): its job queued for every account that has the extension on; answers how many
sigma.close()stops the server and takes the temporary home away
  • One server a process: a second startSigma in the same process is refused. node --test runs each test file in a process of its own, so a file is one server.
  • Import the kit first and the app's server modules after startSigma: the server reads its data folder once, when its first module loads. A server module imported earlier read the default folder, your real library, so startSigma refuses to boot and names that folder.
  • The kit checks each extension's own scripts against "Your data" before it boots, and stops the run with the file, the line and the reason for each problem it finds: app-table-write, the app's tables changed with your own SQL (the list read from the app's own schema); other-extension-table, a table named x_ that is not yours; browser-storage, localStorage or sessionStorage. Your tests (a test folder, a .test. or .spec. file) and node_modules are not checked. A line that means it passes with a // sigma-kit-allow: <check> comment on it or the line above. The checks catch honest mistakes, not hidden ones: SQL built from pieces passes them.
  • A plan can move with statistics. Pin the reads your routes and your query doors make at a size that matters, with analyze and without: once SQLite has statistics on a table of a few rows it scans it whatever its indexes, and at scale it reads it by its index.

session.page() opens, in node, the page that account's tab runs, for your client half: the app's own extension host loads it into a small document your code shares (document while the page is open), with the shell's HTML escaping, store verbs, connections read and settings (read from the server, written back a key at a time) and its notifications menu, where a section you register gets its node. The app's own commands stand in and record what they are asked, so an extension that runs or wraps one at init loads. A provider is recorded the same way: ctx.providers.register answers without running your provider's init or refusing a taken id, and its settings section renders into a bare object, so try a provider in the running app. Imports of the app's modules (/modules/...) resolve to the app's files, window is the shell your ctx.CoreAPI is, the document has a documentElement holding its body, and there is no layout: every element measures as an empty box at the origin. A page is a tab: its writes carry a tab id of its own, and one page is open at a time.

test('the chip shows the count', async () => {
    const page = await me.page();
    try {
        await page.boot();                                  // what the account has on, as the page loads it
        const row = (await me.api(`/characters?count=false&ids=${id}`)).body.items[0];
        assert.deepEqual(page.host.badgesFor(row).map(c => c.label), ['1']);
        assert.equal(await page.registry.runCommand('my-extension.greet', { to: 'you' }), 'Hello, you!');
    } finally {
        page.close();
    }
});
MemberWhat it is
page.boot()loads what the account has on, as the page's boot does
page.enable(id, on)the switch on your manager row: the server, then this page
page.openNotifications()opens the notifications menu as a tap on its bell does: each section showing paints into its node through its onOpen
page.registrythe commands, events and hooks your extension joined (runCommand, listCommands, runFilter, ...)
page.hostwhat the app's surfaces ask the host: badgesFor(row), getActions(slot), runAction(key, context), renderDetailTab(key, pane, context), enterView(name, el, { first }), refreshView(name), getChatWindows(), renderSettingsSection(id, el)
page.CoreAPIthe shell your extension is handed; replace a member your test needs
page.logwhat the shell was asked: toasts, opened (chats), overlays, confirms, commands (the app's own, standing in)
page.answerswhat the stand-ins answer: confirm (a confirm dialog) and mobile (whether the page is a phone's)
page.domcreateElement and mountPoint: a small DOM to render a tab, a view, a window or a section into
page.settled()the settings writes still on their way
page.listen()hears the account's changes over the feed, as the page does, so a write made elsewhere reaches your listeners
page.close()unloads what the page loaded and gives the process its document back

Anatomy

my-extension/
  manifest.json
  client/
    index.js        the client entry (ES module)
    style.css       optional stylesheet

manifest.json:

{
    "id": "my-extension",
    "name": "My Extension",
    "version": "1.0.0",
    "author": "you",
    "description": "One sentence about what it does.",
    "requires": { "api": 2 },
    "client": "client/index.js",
    "style": "client/style.css"
}
  • id: lowercase [a-z0-9-], 2 to 60 chars, and it must equal the folder name. Your data on a card lives at card.data.extensions.<id>, so unless the extension is a provider the id may not be a key the app keeps there (a provider's namespace, cl, fav, chat, world) or one other card tools write there for their own data (risuai, talkativeness). Nor may your table prefix (x_<id>_, hyphens as underscores) fall under another installed extension's (a and a-b), nor may the id be jobs, a path the app's own extension routes answer.
  • client: the ES module the host imports. Optional: a server-only extension mounts its routes with no client load at all, and a style-only extension (a theme) ships just a style entry.
  • style: optional; loaded into the module CSS layer, below the user's theme settings and custom CSS in the cascade, so users can restyle your surfaces the way they restyle the app's.
  • requires.api: the extension API version you wrote against: a 'major.minor' string such as '2.1', or a whole number, which means that major's .0 (2 is '2.0'; a range such as "^3" makes the row broken). The major moves when a door breaks, the minor with each batch of doors added within it, so require the minor that brought the newest door you use. An install of an extension that needs a newer api than the app speaks is refused, and one already in place (an update that asks for more) is a broken row; either way the reason names both versions, and neither half loads: the client half is not imported and the server half is not mounted. Current version: '2.11'. What each minor added (api 2 as it stood before minors were counted is '2.0': every door on this page not listed here):
    • '2.1': ctx.prompt.fence (with its char option) and profileSetting on a ctx.llm call (server); the version itself as 'major.minor' (ctx.apiVersion on both halves, a string), and requires.api taking one.
    • '2.2': the chat.card.action slot (addAction('chatCard', spec)), a verb in a chat's menu in the chats view.
    • '2.3': ctx.files.user(req) and ctx.files.shared() (server), your two folders as handles that keep every name inside them and write each file whole.
    • '2.4': the composer.action slot (addAction('composer', spec)), a button in a strip above the conversation's composer; the chat.compose and chat.send commands, text into the composer and sent as the reader; ctx.server.stream, an answer from your server half read a line at a time, and a signal on ctx.server.call; when on a chat window (addChatWindow), which decides whether the window has its doors (its header button and its phone tile), and close on the context a window's hooks are handed, which closes it as its own close button does; CoreAPI.removeNotificationSection(id), which takes a notifications section out, and a section you add through registerNotificationSection leaving when you are switched off.
    • '2.5': CoreAPI.whenLibraryTotal(), the library's count once the server has counted it (a promise; null when the count could not be read), since CoreAPI.getLibraryTotal() answers null until then rather than a guess; and CoreAPI.openUserGuide(section), the user guide in a tab of its own, at a page ('online') or one of its headings ('online/janitorai'); CoreAPI.getPersonaPronouns(), the active persona's pronoun forms ({ sub, obj, poss, possP, ref }, null when none is read or there is no persona), and CoreAPI.answerPronounMacros(text, forms), the five pronoun macros in plain text answered from a persona's forms as the prompt answers them (null forms leave them raw); CoreAPI.openConversationForCharacter(char), a character's latest chat opened, or their first one started (the details' Chat button; resolves whether one opened); ctx.keys.register(spec), a keyboard shortcut of your own in the app's keymap, rebound by the user in Settings > Keyboard; CoreAPI.randomId(length), a random id of lower-case letters and digits (12 long by default); CoreAPI.formatRelativeAge(when), how long ago a time was in the app's short form ('just now', '5m ago', '2d ago'); CoreAPI.galleryKindOf(item), a media item's or file name's kind ('image', 'video', 'audio', or null), the server's kind first; CoreAPI.renderEditableTagChips(container, tags, onRemove), tag chips with a remove button each, in the app's look; CoreAPI.wireDragReorder(list, { item, handle, onReorder }), drag to reorder a list's items (a touch drags from the handle), wired once per list; CoreAPI.clampTagRows(container, look), a list of tag pills cut to the rows that fit (three, two on a phone) with a +N pill that flips to Show less, kept fitted through resizes, the look naming your classes ({ tag, more, overflow }, and optionally collapsed and expanded for the list itself); CoreAPI.tagStateLook(state), the icon class and title the app's three-way tag toggles wear for 'include', 'exclude' and anything else (neutral); and chatId on a ctx.llm call (server), the chat it is made for, whose connection answers it when you name none.
    • '2.6': pictures on a ctx.llm call (server): images on a user's message, as bytes or a reference to the account's own portrait, gallery image or persona picture (see "Calling a model"); ctx.llm.canSee(db, request), whether the connection that call would use sends pictures; and capabilities.vision on a kind of your own, which hands your adapter a user turn's pictures (see "A kind of connection of your own"). A chat's own gallery: ctx.stores.attachments (server), its pictures and which messages show them, and the attachment change it reports (created, deleted, carrying the chat's id), which the feed carries and a store guard can refuse (store.before.attachment.created, store.before.attachment.deleted). A ChatMessage answers its pictures as attachments. CoreAPI.liveFormattingOn(surface), whether the reader's Format as it streams applies to 'chat', 'assistant' or 'creator', so a panel painting a reply as it arrives can pass streaming: 'live' to CoreAPI.formatChatText (with openIslands: false where markup is talked about rather than drawn, so an unclosed html tag stays text until it closes); CoreAPI.aiConnectionStreams(surface), whether the connection block mounted for that surface has Stream the reply on; and CoreAPI.lockMinWidth(el, measure), which holds a control at the widest of the states measure() lays out (it returns their widest scrollWidth), so a label or count that changes never shifts what sits beside it; a control not shown yet locks when it first shows.
    • '2.7': ctx.browser.consumer (server), a hosted-browser consumer of your own for a Cloudflare-gated site, and ctx.browser.fetch (page), a fetch inside the hosted browser through it; an inventory row lists a half's consumers as browserConsumers; and llm.request is told which chat or session its call is for (chatId, sessionId, charId, mode, as reply.final names them).
    • '2.8': regex scripts (server): ctx.stores.regex, the reader's own scripts, each preset's, a character's (on its card, as SillyTavern keeps them) and whether a preset's or a character's list may run, and the two changes it reports, regexScript (created, updated, deleted) and regexConsent (updated), which the feed carries and a store guard can refuse (store.before.regexScript.created, store.before.regexScript.updated, store.before.regexScript.deleted, store.before.regexConsent.updated). hideForeign: true on CoreAPI.formatChatText draws text as a chat message is drawn: comments and tags that are not HTML hidden, their text kept (left out, a reply that talks about markup keeps every tag it names). CoreAPI.showTagAutocomplete(text, { dropdown, exclude, onPick, allowCreate, limit }) fills the .tag-autocomplete element dropdown with the library's tags that contain the text (up to limit, 10 by default), leaving out the names in exclude in any case (none by default), and shows it; a click on one hands its name to onPick, and text nothing matches offers a Create row unless allowCreate is false. dropdown and onPick are required: without them nothing is asked or shown. An answer for text typed over since is dropped. The list opens above its positioned parent, or under it with the is-below class. Call CoreAPI.tagAutocompleteKeydown(event, dropdown) first in the field's keydown: the arrow keys light a suggestion and Enter picks it, and it answers true when it took the key. CoreAPI.uiZoom() answers the factor the reader's UI Scale zooms the page by (1 at 100% and on a phone): divide a rect read with getBoundingClientRect by it to place something in the page's css pixels, such as a popover at a button. CoreAPI.numberSetting(key) answers a numeric setting as the reader set it, or its shipped default when the stored value is no number (0 is an answer, never replaced). CoreAPI.diffSplitView(before, after, { heads }) answers the app's side-by-side diff of two texts as HTML (html, empty when they are the same) with the lines changed, added and removed: changed lines in pairs, each changed word marked, unchanged lines away from a change folded, the two column heads yours to name (Now and Proposed by default). CoreAPI.queueMediaDownloads(target) puts characters on the background media queue, where each one's remote media is scanned and downloaded: target is a selection (CoreAPI.getSelection()), { ids } or { all: true } (the whole library, the ones already processed left out). A character named in a selection is scanned again even if it was done before. It answers the server's counts (queued, noMedia for the ones with no remote media and no provider link, active for the ones already downloading) and says them in a toast. CoreAPI.downloadMediaForCharacter(char) queues one character's media on the background queue, as a card's right-click menu does (the details gallery's button shows its own dialog).
    • '2.9': ctx.assistant.addSource (server), a context source the chat assistant can be given, with its own switch in the assistant's context view; and ctx.CoreAPI.confirmDiscardEdits(subject) (client), the app's own "Discard unsaved edits?" ask, Keep Editing beside Discard, resolving true when the reader lets the typing go.
    • '2.10': the creator.open command, the character creator opened, with a character of the library imported into it.
    • '2.11': params.reasoning.effort takes any level the host names (one word of 1 to 32 lowercase letters, digits, _ or -, sent as-is), where it was low, medium or high, so an adapter of your own can meet none, minimal, xhigh, max or a word of its host's; and CoreAPI.mountEffortPicker(block, { inheritLabel }) (client), the app's reasoning-effort control: the common levels, then Custom with a word field. The block holds a select[data-effort-select], a [data-effort-row] with an input[data-effort-word] in it, and an input[type="hidden"][data-effort-value] that carries the value: read and set it like any field, and listen for change on it. inheritLabel names the empty entry ("send nothing").

An extension written against api 1 loads unchanged (api 2 only added doors) unless it meets one of the refusals named on this page: an id past 60 characters or equal to a reserved key, a table prefix under another extension's, or a provider whose id is not its namespace (see "Provider extensions").

  • settings: optional object of default values for your per-user config keys (ctx.settings / ctx.setting). Declare a default for every key you read.
  • contributes: optional array naming what your extension adds, so the manager can say so before it is enabled: chat.window, chat.action, message.action, character.action, app.action, character.card.badge, character.details.tab, character.bulk.action, shell.view, lore.entry.action, chat.card.action, composer.action. Anything else makes the install a broken row. When you declare the list, the host warns in the console if your code uses a slot it does not name.
  • lazy: optional; your menu verbs, windows and views declared here load your code at their first use instead of at boot (see "Loading on first use").

Only the folders holding your client and style entries are served (at /ext/<id>/...), and an entry can import siblings from inside its own folder. Put server code in a folder of its own (say server/): that folder is never served. manifest.json and package.json at the root are never served either, nor is the scratch directory. If your client entry sits at the root, the whole root is served except those two files and your server entry, so keep anything private in a folder of its own.

Loading on first use

An extension whose way in is a menu verb, a window or a view can leave its code unloaded until someone uses one. Declare those entry points in the manifest:

"contributes": ["app.action", "chat.window", "shell.view"],
"lazy": {
    "actions": [{ "slot": "app", "id": "open", "label": "Open my panel", "icon": "fa-bolt" }],
    "windows": [{ "id": "notes", "label": "Notes", "icon": "fa-note-sticky", "size": { "w": 40, "h": 60 } }],
    "views": [{ "id": "board", "label": "Board", "icon": "fa-table" }]
}

Switched on, the extension's verbs, windows and views appear from these lines alone, and neither its code nor its stylesheet is fetched. The first run of a verb, open of a window or entry to a view loads the code once (however many uses arrive together) and runs your init; your own ctx.ui.addAction, addChatWindow and ui.contribute('shell.view', ...) of the same ids then take the declared places, and that first use goes to your code with the context it was given. So:

  • Register every declared entry point in init, with the same slot and id. One you declare but never register is taken away once your code has loaded, with a warning in the console.
  • A declaration holds only the static parts: an action's slot, id, label and icon; a window's id, label, icon and, optionally, its first size and min; a view's id, label and icon. Each follows the registrars' rules (an id of lowercase letters, digits and dashes starting with a letter, at most 32; a label of at most 40 characters, 24 for a view; a Font Awesome solid icon), each kind is one your contributes names when you declare it, and there is at least one. Anything else makes the install a broken row.
  • An action's when() is code, so a declared verb shows wherever its slot shows until the code runs; if its first use is one your when() refuses, the reader is told it does not apply there. A window's when() is code too: a declared window keeps its doors until the code runs, and once it has, a when() that says no takes them away and closes the window.
  • Hooks, event listeners, badges, tabs and a settings section register only once your code runs. An extension that needs any of them from the start stays eager: leave lazy out.
  • The manager shows a lazy extension switched on as "on first use" until its code has run. Reload (see "Working on an extension") puts the declared entry points back and fetches the code again at their next use.

The bundled Library Stats loads this way.

The client entry

Export a default object with init(ctx). It runs when your extension loads: at startup, after the app's startup modules have initialized, or the moment a user switches it on. A few feature modules load on first use instead (the Chats view, batch tagging, the tags manager, batch transfer): reach them through commands, CoreAPI and events, never by assuming they are already on the page.

export default {
    async init(ctx) {
        ctx.log('ready');
    },
    // optional: runs when the user switches the extension off
    dispose() {},
};

Switching off. When a user switches your extension off, the host first undoes everything you registered through ctx, newest first: commands and wrappers, event listeners, hooks, actions, windows (an open one closes, and its onClose runs), views, tabs, badges, overlays, settings and provider sections, a registered provider, what you registered through ctx.CoreAPI (onViewEnter, onViewExit, onCharactersDeleted, storeWatch, onJob, and a notifications section from registerNotificationSection), and your stylesheet. Then it calls your dispose(). Undo there only what you did outside ctx: a node you added to the page, a timer, a listener on window. A dispose() that answers a promise is waited for before your extension loads again (switched back on, or a Reload), for up to five seconds; one that has not settled by then is logged and the load goes on. Your dispose() runs whenever your init ran, so an init that throws gets it too, once what it registered has been undone, and so does one the user switched off while it was still running, once it settles. The browser keeps your module loaded, so switching the extension back on runs init again on the same module: keep your state inside init, or reset it in dispose.

ctx is the api 2 surface, the part we promise not to break casually: a door leaves only after "Deprecated doors" has listed it.

FieldWhat it is
ctx.manifestyour row in the server's inventory (ManifestRow in the published types): your manifest.json as the server read it, keys it does not know dropped, plus bundled, git and enabled, and with a server half its state (serverState, serverError), what it registered (serverHooks), what its hooks cost this account (serverCalls) and its query doors (serverQuery)
ctx.apiVersionthe host's extension api version, 'major.minor' (see requires.api under "Anatomy")
ctx.CoreAPIthe CoreAPI the app's own modules use, every function it exports: settings, toasts, characters, search, modals, lorebooks, media, the HTTP API. This is the main event. A function's name stays until "Deprecated doors" lists it; what it takes and answers is the app's own and is not typed (see "Beyond the stable surface"). What you register through onViewEnter, onViewExit, onCharactersDeleted, storeWatch or onJob answers its removal and is undone when your extension is switched off. A section you add to the notifications menu with registerNotificationSection({ id, getStatus, onOpen }) answers its node and is taken out when you are switched off, or sooner with removeNotificationSection(id). The id is yours alone: the app holds it under your extension's name (the node's data-notif-section reads ext:<your-id>/<id>), so it never replaces one of the app's sections or another extension's, and removeNotificationSection(id) takes only your own. Anything another CoreAPI call adds to the page is your dispose()'s to take away
ctx.log(...)console.log prefixed with your id
ctx.commands.run(id, args) / list()run a command by id and get its answer: the app's own verbs and every extension's (see "Commands"). list() names them all, with their titles, who wraps them and, for the app's own, the types of their args and answer
ctx.commands.register(name, fn, { title })add a command of your own, registered as <your-id>.<name> so it can never take the app's id or another extension's; fn gets one args object and its return value is the answer
ctx.commands.wrap(id, wrapper, { priority, override })wrap any command: wrapper(next, args) can hand on, change the args or the answer, or answer on its own. Returns the unwrap
ctx.keys.register({ id, label, key, scope, run })a keyboard shortcut of your own, <your-id>.<id>: run() is called on key while scope is in front ('global', the default, 'library' or 'conversation'). Settings > Keyboard lists it under your extension's name, where the user can rebind or unbind it. A key is written as the app writes it ('Mod+Shift+H', 'H', '/'; Mod is Cmd on a Mac and Ctrl elsewhere); one with no Mod, Ctrl or Alt never fires while the user types in a field. A key the app's own shortcuts or another extension's already use there is refused with the clash named; leave key out to ship the action unbound. It leaves with your extension. Returns the full id
ctx.events.on / off(name, fn)listen to the app's events. A name ctx.events.list() names hands fn its payload, an object of ids; any other name is a plain DOM event listener handed the Event, as in api 1 (see "Events")
ctx.events.list()the listed events, their payload keys and each key's type
ctx.events.emit(name, detail)dispatch an event namespaced as ext:<your-id>:<name>
ctx.hooks.add(name, fn, { priority }) / list()the conversation's hooks (list names them with their kind and types): a filter answers the value to hand on and an action is told, highest priority first; see "Conversation hooks"
ctx.server.call(path, method, body, { signal }) / stream(path, method, body, { signal })a request to your own server half: path is under /api/ext/<your-id>, method is GET and body none unless you name them. call answers the parsed body; a refused request throws an Error in the server's own words (its error, else HTTP <status>), carrying status and the parsed body as data. stream (a POST unless you name the method) is the same request read as it arrives, an async iterable: each line of an application/x-ndjson answer, parsed, as it lands, or the parsed body once for any other answer; a refusal throws as call's does (see "Streaming from your server half"). A signal stops either, the request aborting with an AbortError and your route hearing the hang-up
ctx.messages.shown(msg) / digest(text)the text a message shows (its active alternate when it has several, else mes) and a digest of a text, eight hex digits. Your server half's ctx.messages answers alike, so a digest your server stored beside what it made of a message tells the page whether the message still shows those words
ctx.storage.load() / save(doc)a per-user JSON document stored server-side under your id. Stateless on purpose: every load fetches and every save writes, and failures throw instead of quietly becoming an empty document. Cache it yourself if you need to, and drop the copy when ctx.CoreAPI.storeWatch('ext-<your id>', fn) calls fn: another tab, device or process wrote it
ctx.settings.get(key) / set(key, value) / defaultsper-user CONFIG with defaults you declare in manifest.json under "settings". Keys are scoped to your extension on the wire (ext:<id>:<key>), so you can never collide with the app's keys or another extension's. get returns the stored value, or your declared default when nothing is stored or the stored value is null or '' (a stored false or 0 wins). set takes effect in memory at once and is saved within about half a second; a failed save shows a toast and the value goes back to what the server holds
ctx.chats.open(chatId, { messageId, seq })open a chat by its id, from any view, and bring a message into view (scrolled to and briefly marked): messageId names it wherever it sits now, seq names a place, and messageId wins (one gone since reveals nothing). Always answers a promise, true when the chat is the open conversation, false for an unknown id or a failed read. A chat that is already the conversation is resumed, never reloaded. See "Opening a chat"
ctx.chats.follow(spec)one chat's data read while you show it, for a window that follows the conversation: read(chatId) reads it and apply(data, chatId) paints it (null when no chat is shown); the newest read wins and a read that lands after its chat left the screen is dropped. Answers { show(chatId), reload(), reloadSoon(), rest(), isOpen(), chatId() }; reloadSoon waits soonMs (400) for the writes to settle, working(data) true reads again every pollMs (2000) while shown, fail(error, chatId) hears a failed read and moved(chatId, was) the shown chat changing, before its read
ctx.ui.contribute(slotId, spec)fill a slot, one of the places the app opens to extensions; ctx.ui.slots() lists them. The four add... calls below are shorthand for it: contribute('chat.action', spec) is addAction('chat', spec), contribute('chat.window', spec) is addChatWindow(spec), contribute('extension.settings', { render }) is addSettingsSection(render) and contribute('provider.settings', { providerId, render, excludeTagsHint }) is addProviderSettingsSection. It throws on an unknown slot or a spec missing what the slot needs
ctx.ui.slots()every slot with its kind, what its context carries and each key's type, the spec it takes, and how it reaches a phone
ctx.ui.addSettingsSection(render)contribute a settings body; it renders inside your extension's row in Settings > Extensions every time the manager draws its list (opening the panel, a refresh, a toggle), so keep render repeatable. It throws when render is not a function
ctx.providers.register(provider, manifestRow)for provider extensions: register a character source, its ProviderBase instance and its provider row; see "Provider extensions"
ctx.browser.fetch(name, path, opts)a same-origin fetch inside the hosted browser, through the consumer your server half registered under name (ctx.browser.consumer there): path stays under its prefix, opts takes headers (up to 8), method (GET or POST), jsonBody, timeoutMs and signal. Answers { status, body, retryAfter }; the browser is the one the account set up under Settings > Online > Hosted Browser, and with none installed to start it throws an Error whose code is NO_BROWSER (its message says how to add one)
ctx.ui.addProviderSettingsSection(providerId, render, opts)for provider extensions: the body of a provider section in Settings > Online. The host builds the chrome (name, Beta badge and position from your provider row) and appends the standard exclude-tags group, which your row gets by default (excludeTagKey defaults to your provider id; null for none, and opts.excludeTagsHint overrides its hint line). Call it after ctx.providers.register; the section exists only while your extension is loaded. It throws without the provider id or a render function
ctx.ui.addChatWindow(spec)a window inside a conversation: the host builds the window (the chrome, the header button, the phone's tile) and you render the body; see "A window in the conversation"
ctx.ui.addOverlay(spec)put an overlay you build yourself in the app's overlay stack, so Escape and a phone's back close it; answers the element id to give it. See "An overlay of your own"
ctx.ui.dialog(spec)a dialog in the app's own shell, on top of addOverlay: the host builds its chrome and closes it, you fill its body. See "A dialog of your own"
ctx.ui.connectionSelect(select, { key })the account's connections appended to a <select> of yours (its own first option stands for the one the chats use), the value stored under key (profileId by default) chosen, each pick kept under it, and the select given the app's look; key: null keeps nothing (a pick that rides one request). Answers { gone } once the options are in: gone is true when the stored pick names a connection the account does not have (the select shows the default, which is what runs, and the pick stays stored until changed), never when the read failed
ctx.ui.addAction(slot, spec)a verb in one of the app's menus: chat (the conversation's options menu), message (a message row's overflow), character (the character context menu), app (the topbar menu), bulk (a multi-selection's context menu and the multi-select toolbar), lore (an open lorebook entry, in the lorebook manager and a chat's Lorebooks window), chatCard (a chat's menu in the chats view), composer (a button in the strip above the conversation's composer). The host renders it on desktop and on the phone; see "Actions in the menus"

Types for your editor

docs/extensions.d.ts types everything on this page. On the client: ctx and each of its calls, every command's args and answer, every event's payload, every conversation hook's value, context and answer, and every slot's context and the spec it takes. On the server: its ctx, every pipeline's value and facts, every store guard's name and the change record. Copy it beside your entries (or point at it in a checkout of the app) and your editor completes and checks your code, JavaScript included:

/** @type {import('./extensions').ClientExtension} */
export default {
    async init(ctx) {
        ctx.events.on('character.updated', ({ ids, fields }) => {
            // ids and fields are readonly string[]; a key the payload lacks is an error
        });
        const done = await ctx.commands.run('tags.apply', { ids: ['<a character id>'], add: ['favorite'] });
        // done is { affected, skipped, deltas }; a refused change throws
    },
};
/** @type {import('./extensions').ServerExtension['register']} */
export function register(router, ctx) {
    ctx.hooks.add('reply.final', (text, { surface }) => (surface === 'chat' ? text.trim() : undefined));
    // a filter answering anything but the pipeline's value is an error
}

Every command, event, hook, slot, pipeline and store guard the app opens is in it, with the shape the app hands, and ctx.commands.list(), ctx.events.list(), ctx.hooks.list() and ctx.ui.slots() carry the client's types at run time, as TypeScript text. Not in it: an extension's own commands (their args and answers are that extension's), the signatures of ctx.CoreAPI's functions (their names are kept, as "Deprecated doors" says; what each takes and answers follows the app's releases), and the functions of the server's ctx.stores modules, which follow the server's releases.

The types file, the code examples in this guide and the test kit (tools/extension-kit/) are licensed under the BSD Zero Clause License (0BSD) as well as the app's own license: copy them into your extension and publish it on any terms. Every bundled extension (extensions/bundled/), Hello World among them, is under the MIT License: copy one as the start of your own and publish it on any terms, keeping its copyright notice and its LICENSE file with it. The LICENSE file says so in full.

Where to store what

Keep what your extension holds in the account's database unless it does not fit there. The database stores are the default because each write is all or nothing, the account's backups copy them, every write reaches the account's open tabs on the change feed, and what rides a card or a chat travels with it into its export:

  • ctx.settings - per-user CONFIG: toggles, thresholds, small preferences your settings section renders. Declare every key's default in manifest.json ("settings": { "greeting": "Hello" }); a key you read without declaring has no default and comes back undefined. Keys are scoped to your extension, and both your client and server halves read the declaration and apply the same fallback (nothing stored, null or '' reads your default), so the two halves answer alike.
  • ctx.storage - per-user STATE: documents, queues, working data, anything with structure. One JSON document, loaded and saved whole.
  • Your own tables (server half) - data a character, chat or message owns, and anything you filter or sort by; see "Your own tables". Their writes reach the change feed through ctx.report, and an export through the card.export and chat.export filters.
  • The card or the chat itself - what should travel with them into an export and a branch: card.data.extensions.<your id>, a message's extra.<your id>, a chat's slot (ctx.chatSlot).

Files are for what does not fit there: large blobs, caches you can rebuild, binaries, a file an engine of your own opens (a search index, a SQLite file of yours). The server half keeps them through ctx.files (see "The server half"):

  • ctx.files.user(req) - a folder of yours inside the requesting account's home, for that account's files.
  • ctx.files.shared() - one folder of yours that every account shares, such as a cache, at extensions/installed/.data/<id>/ for bundled and installed extensions alike (CL_EXTENSIONS_DIR moves it with the installs): never served and never inside an install.

An account's backups copy its library database alone, so no file of yours is in them, and no export carries one: keep in files what you can rebuild or can afford to lose, and tell your users when you keep more. Removing your extension deletes its shared folder and its folder in every account's home. ctx.dataDir() and ctx.userDataDir(req) answer the same two folders as plain paths, for code that walks them itself.

Never localStorage (it is per-browser, shared across accounts, and invisible to the server), never the app's own setting keys, never another extension's scope. Credentials go in a settings key of your own, never browser storage.

A window in the conversation

An extension that works on the open chat gets a real window beside the first-party ones, with the same chrome, the same drag and resize, the same place on a phone. Register it once at init; the host does the rest.

ctx.ui.addChatWindow({
    id: 'timeline',                 // [a-z][a-z0-9-]{0,31}, unique within your extension
    label: 'Timeline',              // the window title and the button's tooltip (up to 40 chars)
    icon: 'fa-timeline',            // a Font Awesome solid name
    min: { w: 24, h: 30 },          // optional, percent of the conversation area
    size: { w: 30, h: 60 },         // optional, the first size, percent too (at least min)
    render(bodyEl, { chatId, character, panel, body, close }) {
        // runs ONCE, on first open; render into bodyEl and keep your own state
    },
    onOpen({ chatId, character, close }) { /* every open, after render */ },
    onClose() { /* every close */ },
    follow(detail, { chatId, character }) {
        // a character this tab holds was written: detail.charId names WHICH one, never the
        // character itself, so re-read it: ctx.CoreAPI.getCharacterById(detail.charId)
    },
    // optional: whether the window has its doors now; false hides them and closes it
    when: ({ chatId, character }) => ctx.settings.get('asWindow') === true,
});

when decides whether the window is there at all: while it says no, the window has no header button, no phone tile and no row in Chat settings, and a window that is open when it turns to no is closed (your onClose runs). The window is kept, so its body is as you left it when when says yes again. It is asked, with the conversation's { chatId, character }, every time the doors are laid out: when a window is added or removed, when a conversation opens, its character arrives or it closes, when an extension's setting is written (through ctx.settings.set or in another tab) and when a phone opens its chat options. It must decide synchronously: one that throws or returns a promise hides the window. A window with no when always has its doors. The reader's own choices apply on top of it: where its button sits in the desktop header and whether they hid it there, and the Phone switch in Chat settings.

close, on the context every hook is handed, closes the window the way its own close button does: onClose runs, its opener goes dark, and a phone's back button behaves as after any close. Calling it on a window already closed does nothing. A window that hands its result to the conversation can close itself so the reader sees it land, which matters on a phone, where the window covers the conversation; on a desktop it stands beside it.

follow hears a write to a character this tab holds, once your window has rendered: every write this tab makes (a save anywhere in it, an avatar swap, an assistant edit), and a write made elsewhere (another tab or device) to a character this tab has read. It does not hear a write elsewhere to a character this tab never read, and a write to many characters at once while the tab holds more than a thousand of them reaches it only for the conversation's character and the one whose details are open. Check detail.charId against the character you are showing; detail.source is the app's own name for the surface that wrote and may change in any release. To hear every write to any character, listen to character.updated (see "Events").

  • It opens from a button of its own in the conversation header on desktop (a header too narrow for every button lists the rest under its More button) and from a tile of its own under Windows in the phone's chat options. The reader hides the header button by right-clicking it or in Chat settings, under Conversation header, and the phone tile with its Phone switch in Chat settings, under Extensions. It is the standard window, full screen on a phone.
  • On desktop it first opens at your size (38 by 70 percent when you give none); its size and position then persist per user in your own settings scope (win-<id>-w and friends), and Reset window layouts puts it back at that first size like every other window.
  • A render or hook that throws, or returns a promise that rejects, shows an error line in your window and logs to the console; the conversation keeps working. A bad spec throws at registration with the reason, so a mistyped icon never becomes "my window does not appear".

A view of your own

A whole view beside Characters, Chats and Online, for a surface that is a place of its own rather than a window over a chat:

ctx.ui.contribute('shell.view', {
    id: 'stats',                    // [a-z][a-z0-9-]{0,31}, unique within your extension
    label: 'Stats',                 // up to 24 characters
    icon: 'fa-chart-simple',        // a Font Awesome solid name
    render(el) {
        // the first time the view is entered: build into el and keep your own state
    },
    enter(el) { /* every time the view is entered, the first included, after render has settled */ },
    leave() { /* every time the reader leaves it */ },
    refresh() { /* a phone's pull-to-refresh: re-read what the view shows; leave it out and the pull never arms here */ },
});
  • Its name is ext:<your id>/<view id> (ext:my-extension/stats above): view.switch takes it, ctx.CoreAPI.getCurrentView() answers it while your view is on screen, and an app action's when sees it as its view.
  • It gets a button after Online in the view switcher, and on a phone a row in the More sheet's Views group. It has the whole content area (the app's search and filters step aside while it is on screen), and the phone's swipe between views stays among the app's three.
  • Do the work of a visible view in enter and stop it in leave (a timer, a listener that repaints), so a view nobody is looking at costs nothing.
  • A render may return a promise: the first enter waits for it to settle, so it meets what render built, and does not run at all if the reader left the view before then.
  • Switching your extension off while your view is on screen takes the reader back to Characters first (your leave runs). A render, enter or leave that throws, or returns a promise that rejects, shows a toast naming your extension and the view and logs to the console. Registering with a bad id, a missing or long label, a missing or bad icon, an enter or leave that is not a function, or a duplicate id throws with the reason.

An overlay of your own

A surface that is neither a window in the conversation nor a dialog (a full-screen view of your own, a panel of a shape of your own; a dialog is ctx.ui.dialog, below) you build and append yourself; register it once at init so the app closes it like its own: Escape on the desktop, and a phone's back button, topmost first.

let dialog = null;
const close = () => { dialog?.remove(); dialog = null; };
const overlayId = ctx.ui.addOverlay({ id: 'dialog', close });   // answers 'ext-<your id>-dialog'

function open() {
    dialog = document.createElement('div');
    dialog.id = overlayId;          // the stack finds your overlay by this id
    document.body.appendChild(dialog);
}
  • close() is how the stack closes it; it runs on Escape and on a phone's back, so it must take the overlay off the page. visible(el) is optional; by default an overlay counts as open while its element is on the page and has no hidden class.
  • It sits above a conversation's windows on the phone's back stack and below a confirm raised over it, so back closes your overlay before the chat under it.
  • Add no Escape listener of your own: the stack already answers it, and a second one closes two things at once.
  • Switching your extension off closes an open overlay: your close runs with { leaving: true }, which means take it off the page without asking, and the host removes the element afterwards whatever your close did. A bad id ([a-z][a-z0-9-]{0,31}), a missing close or an id you already registered throws at registration.

A dialog of your own

Most overlays are dialogs, and the app has one shell for them: ctx.ui.dialog builds it, registers it in the overlay stack and closes it, and you fill its body.

const dialog = ctx.ui.dialog({
    id: 'ask',                      // [a-z][a-z0-9-]{0,31}; the element is ext-<your id>-ask
    label: 'Ask your model',        // its name for a screen reader, and its title; up to 60 characters
    icon: 'fa-comment-dots',        // optional
    className: 'my-dialog',         // optional, on the dialog's box
    size: false,                    // true: resizable from its edges, its size kept (min: { w, h } its floor, in pixels)
    canClose: () => !unsaved || ctx.CoreAPI.confirmDiscardEdits('the question you are typing'),
    onClose: () => { /* stop what the dialog started */ },
});

function open() {
    const body = dialog.open({ title: 'Ask your model' });   // the title may differ per open
    body.innerHTML = '...';
}
  • open() builds the dialog afresh (an open one closes first, unasked), shows it on the next frame and answers its body. close() closes it and answers whether it did; isOpen() and el say whether it is on the page.
  • Escape, a phone's back, a click on the backdrop and its close control dismiss it. canClose(how) is asked first: false, or a promise of false, keeps it open. close({ force: true }) asks nothing, and neither does your extension being switched off, which closes it at once (how.leaving). onClose(how) hears it close by any road.
  • It registers as an overlay, so it throws as addOverlay does on a bad or taken id, and on a missing or long label, a bad icon or a canClose or onClose that is not a function.

Opening a chat

An extension that knows a chat's id (from GET /chats?charId=, a hit of GET /chats/search, or a chat it just created) opens it with one call, here at a search hit's message:

const opened = await ctx.chats.open(hit.chatId, { messageId: hit.messageId });   // the message is optional
if (!opened) ctx.CoreAPI.showToast('That chat could not be opened', 'warning');

This works whatever the Chats list is showing (another page, a filter, a sort that puts the chat far down). messageId is a message's own id (the id of each message GET /chats/{id} answers, a search hit's messageId), which finds it wherever it sits now; seq is its place, which a delete earlier in the chat renumbers, so name a message by its id whenever you have one. The whole conversation is on screen once it opens, so any message can be revealed. The chat.open command is the same verb.

Messages on the wire

GET /chats/{id} answers each message as { id, seq, createdAt, role, name, content, attachments, raw } (ChatMessage in the published types): its own id, never reused and kept when an earlier message's delete moves it down a place; its place, 0 to n - 1; when it was written (unix ms, read from the stored send_date in any SillyTavern spelling, null when it has none); who said it (user, assistant or system); the stored name; its text (the active alternate); the pictures it shows from its chat's gallery, in order; and raw, the stored SillyTavern row, verbatim, where swipes, extra and the rest live (with extra.attachments naming its pictures' ids when it shows any). The same shape answers a send, a message's PATCH, a branch, a chat's create and a generate's done frame; ctx.stores.chats.projectMessages(db, rows) builds it from rows listMessageRows answered, their pictures read in one query (projectMessage({ id, seq, msg }), one row with no database, answers no pictures).

A write addressed by a message's place (PATCH or DELETE /chats/{id}/messages/{seq}, a branch, a generate's targetSeq) names the message it means: ?messageId= on the PATCH and the DELETE, messageId in a branch's body, targetId beside a generate's targetSeq. When another message holds that place by now (a delete elsewhere renumbered the chat since you read it), the write is refused with 409 and nothing is written; read the chat again. Without the id the write goes to whichever message holds the place. A write sends stored-row fields (mes, swipes, extra, ...), never a ChatMessage: seq and raw are refused on a row.

A write that rewrites or grows the message's active alternate can name that alternate as you read it: shown beside the fields of an edit's PATCH (never stored), targetShown beside a regenerate's, a continue's or a swipe's targetId, each { index, count, text } (the active alternate's place, swipes.length or 1 for a message with none, and its text). When the stored message holds another (an alternate added, dropped, picked or rewritten since you read it), the request is refused with 409 before anything is written or the model is asked. Left out, the write acts on whatever alternate is active.

Commands

A command is a verb by id: one args object in, an answer out. The app's own verbs are commands, an extension's verbs join the same list, and any command can be run or wrapped by any extension. Every character verb in the table, and opening the lorebook manager, goes through its command whichever way the reader asks (a button, a menu, a key, a phone's sheet or swipe), so a wrapper hears every path; the other rows say what runs them.

CommandArgsAnswers
chat.open{ chatId, messageId, seq }true when the chat is the open conversation; ctx.chats.open runs it, so a wrapper hears those opens
chat.compose{ text, mode }true once text is in the open conversation's composer as typing would leave it: the box grows to fit and the text is kept as the chat's draft. mode is 'replace' (the default) or 'append', which puts it on a new line after what the box holds. false when no conversation is open, or while the box is held by a send waiting on a composer.send filter. The reader's own typing does not run it. A text that is not a string, or another mode, throws
chat.send{ text }sends text as the reader the way Send does: it replaces what the box holds, the composer.send filters run, the message is stored and a reply is generated. Answers once that reply has run (or failed): true when the message was stored, false when no conversation is open, a reply is on its way, text is blank, a filter took the text, or the message could not be stored (the box keeps it, as it does for Send). The Send button does not run this command: to see every message the reader sends, add a composer.send filter. A text that is not a string throws
character.open{ id, elevated, navList }true when the character was found and its details opened; elevated opens them above a modal already open instead of replacing it. Stepping from one character to the next in the details and the app's own modules run it too; when the app runs it, char also carries the app's object for that character
character.delete{ ids } or { filter, expect }By ids: { deleted, missing }. By filter (a GET /api/characters query string, a Select All's CoreAPI.getSelection().filter): the server fixes the set and deletes it, answering { changed, missing } once done (stopped: true when it was stopped partway); expect is the count the reader confirmed, and a set that holds another count now (another tab imported meanwhile) is refused before anything is deleted, the error carrying total. Either way the delete goes in batches, and a store guard that refuses one stops the run there: nothing of that batch is deleted, the batches before it stay deleted and leave the page, and the command throws with the guard's words (or the reason the write did not land) and how many were deleted before it. A re-import that replaces a character runs it too; it asks for no confirmation of its own
character.favorite{ ids, value } or { filter, value }value is true or false, and the server writes only the characters whose favorite moves. By ids: { affected, skipped }, the ids that moved and the ids no character holds (an id in neither already was). By filter: { changed }, how many moved, and the library is re-read once it lands. A write a store guard refuses throws with the guard's words (or the reason it did not land)
character.update{ id, fields, rootFields, source }{ ok }, with error in the server's words when it refused a field, and told when the reader has already been shown the refusal (the app toasts it once, so a caller adds no toast of its own; a wrapper that builds its own answer carries told, or the caller says a generic "failed"). Every edit the app makes to one character's card runs it. fields are dot paths as PATCH /characters/{id} takes them (null deletes); rootFields carries the library's own flags on the character (fav, mediaLocalized, loreDismissed), which are not card fields; source names the surface that wrote, for the app's own listeners. When the app runs it, char also carries the app's object for that character (null when the app writes by id): read it, never write it. A wrapper that changes the args hands the rest on (next({ ...args, fields })): one rebuilt from scratch drops rootFields, and a flag write then lands nowhere
character.update-many{ updates: [{ id, fields }] }{ affected, failed } (failed names each entry the server refused, with its words). The updates go to the server in batches, in order: a batch the server refuses whole, or that never lands, stops the run there and throws with the server's words (or the reason it did not land) and how many were written before it, the batches before it staying written and read back, and the error's landed holding their { affected, failed }. The app's batch edits run it (the update check's Apply All, the bulk auto-link, the DataCat relink, the Tags Manager's undo of a tag run), and the characters it changed are read back as stored
character.export{ ids, format, worlds } or { filter, format, worlds }By ids: { exported, skipped } by id. By filter: counts, { count, skippedCount }. format is png (the default: a file per character, carrying the card the server holds), charx (a file per character, the card as V3 with its picture and every gallery file; importing one back gives the card as it was stored), links (the provider pages of the linked ones, copied to the clipboard as one list; the rest are skipped) or bundle (one .zip of the cards, their chats and gallery media, and their lorebooks unless worlds is false; it answers its size in bytes too, and by ids a character the server lacks refuses the whole bundle). signal stops it (between files for cards), and onProgress is called with how many characters are done after each
character.import{ file }, { url }, { provider, id } or { stage } (a card file staged with ctx.imports.stage, handed as its stage answered), with onExistingthe import result: success, the character's id and characterName, and for a card already in the library alreadyPresent with the server's skippedReason (identical, diverged-uuid or diverged-provenance; id is then the character it matched). One source a run: file is a card file (a File or Blob: a PNG card, or a charx, whose other images join the character's gallery, counted in the result's mediaCount), url a provider's character page or a plain link to a card file, provider a provider's id with the character's id there (data, what you already fetched from that provider, and options, the provider's own, ride along). It asks nothing: onExisting: 'copy' brings a duplicate in as a new character, and onExisting: { replace: id } writes the card onto that character instead (its id, chats, tags, gallery, lorebook link, favorite and update lock stay, its card and picture become the new card's, the card it had is saved in its versions, and the answer carries replaced: true). A character it brings in shows in the library at once. For a card that came in, the answer also carries what the Import Characters window's download phases read: embeddedMediaUrls, lorebookMediaUrls and galleryPageUrls, and linkedProvider, providerCharId, fullPath and hasGallery when a provider link came with it (a wrapper that builds its own answer carries them, or no download runs). Every provider's import button and creator download runs it as { provider, id }
character.create{ card, image }{ id, name }: a new character from card (a whole card with data, a V2 card when its spec is left off, or the data alone; name is required, at most 128 characters) and image (an ArrayBuffer, a typed array or a Blob of any picture the browser can read, kept at its own size; a placeholder when there is none). It never lands on a character already in the library, and the library shows the new one at once
creator.open{ id }the character creator opens, and with id that character's fields, tags, greetings and picture are imported into it as its Import from Library does, for a new character made from them. A creator already open keeps its draft until the reader agrees to replace it. true when it opened, and with id when the character was imported; false for a character that is not there or when the reader kept the draft
character.snapshot{ id, label }{ snapshot, label }: the character's card as it is now, kept in its version history under the label (a dated one when none is given) and shown by that character's open history. The Versions tab's Save Snapshot runs it, with char carrying the app's object; the snapshots the app takes on its own before an edit or a restore do not
library.search{ query }true; puts the query in the library's search box and runs it, switching to the characters view first. Typing in the box on the characters view runs it once the box's wait runs out
library.filter{ tag }, { creator } or { playlist }true; exactly one of the three, or it throws, as an empty tag does. tag shows the characters with that tag and clears the other filters, creator searches by creator, playlist filters by a playlist's id (null clears it)
library.select{ ids, value }, { all: true } or { clear: true }how many characters are selected. ids selects them (value: false deselects), all selects every character the view's query matches, clear empties the selection; selecting turns selection mode on. all holds the view's filter, never its ids, and answers the server's count of it; while it holds, ids with value: false leaves those characters out and value: true takes them back, and an id outside the view's set is never added. A new search, chip, rule or playlist filter ends a Select All. A card clicked in selection mode, Select All and Clear Selection run it, and so does leaving selection mode, which empties the selection through clear; a character deleted while selected simply leaves it. Read the selection a verb sends with CoreAPI.getSelection(): { count, ids } or, for a Select All, { count, filter }
tags.apply{ ids, add, remove } or { filter, add, remove }the names in add put on every character and the names in remove taken off; a change the server refuses throws in the server's words. By ids, in one step: { affected, skipped, deltas }, deltas holding what actually changed on each (a tag a character already carried is no change) and skipped the ids the library lacks; the changed characters are re-read. By filter (a GET /api/characters query string; CoreAPI.currentViewFilter() is the library's current view): the server resolves the set (a parameter the list does not take is refused by name, so a misspelled filter never names the whole library) and the command answers once all of it is written, counting what changed, { changed, added, removed } with a count per name (stopped: true when the reader stopped it partway, what landed staying); the library is then refreshed. Batch tagging runs it. Names go as given, so tags you bring in from outside pass the author's import rules first (ctx.CoreAPI.applyTagAliases), as every import does
settings.open{ section }opens Settings, on that section when given, and answers true once it is on screen; an unknown section throws. The app's own jumps into a section run it (an empty library's SillyTavern import, a provider's account section); the gear button does not
view.switch{ view }switches to characters, chats, online or an extension's view (ext:<id>/<view id>, see "A view of your own"); an unknown view throws. Every view change the reader asks for runs it, a conversation's Minimize included; a view the app moves to on its own (a filter's jump to Characters, a removed view sending the reader home) does not
lorebook.open{ name, uid }the lorebook manager opens: on the book called name when you give one, and with uid too (a number, and only with name), that entry opened, scrolled to and briefly marked. true when what you asked for is on screen; false for a book or an entry that is not there (the manager opens on its list, or on the book, and says so) or when the reader chose to keep unsaved edits to the book already open
// your own verb: registered as "my-extension.summarize"
ctx.commands.register('summarize', async ({ chatId }) => {
    /* ... */
    return summary;
}, { title: 'Summarize a chat' });

// anyone can run it by id
const summary = await ctx.commands.run('my-extension.summarize', { chatId });

// wrap a command: log every chat that opens through it, then hand on unchanged
const unwrap = ctx.commands.wrap('chat.open', (next, args) => {
    ctx.log('opening', args.chatId);
    return next();
});

// or change what it is handed: whichever way a delete comes, a character tagged "keep" stays.
// Read the characters from the server: the page's cache may not hold every id you are handed,
// and an id it lacks would read as untagged. A Select All comes as a filter (never its ids), so
// the filter is narrowed with a rule the server applies to every character of the set
ctx.commands.wrap('character.delete', async (next, args) => {
    if (args.filter !== undefined) {
        return next({ ...args, filter: ctx.CoreAPI.narrowFilter(args.filter, { field: 'tags', op: 'excludes', value: 'keep' }) });
    }
    const chars = await Promise.all(args.ids.map(id => ctx.CoreAPI.ensureCharacterById(id)));
    return next({ ids: args.ids.filter((id, i) => !(chars[i]?.tags || []).includes('keep')) });
});

A wrapper runs before the command and decides what happens next: next() hands on with the same args, next(newArgs) with different ones, and a wrapper that returns without calling next answers on its own (an override; pass { override: true } to say so, and when two extensions declare one on the same command, Settings > Extensions shows the conflict under Inspect). Higher priority runs first, then registration order.

  • A wrapper that throws or rejects is skipped and the command carries on without it, so a wrapper that breaks can never take one of the app's verbs down. A wrapper written for { ids } that throws on a { filter } is skipped the same way, so a protection that must hold for every write belongs in a store guard (store.before.character.deleted), which every batch of a by-filter delete passes.
  • A wrapper that never settles holds the verb for whoever ran it, since nothing times it out: hand on or answer, and never wait on something that may not come.
  • A command of your own that throws, or answers a promise that rejects, answers undefined to its caller and logs. An error the command itself raises (one of the app's commands refusing its args, say) passes through your wrapper to whoever ran it, unless you catch it, and is never counted against your extension.

Actions in the menus

A verb that belongs in one of the app's menus is one registration; the host draws the row on desktop and puts it in the matching phone sheet.

ctx.ui.addAction('chat', {
    id: 'summarize',                // [a-z][a-z0-9-]{0,31}, unique within the slot
    label: 'Summarize This Chat',   // up to 40 characters, in Title Case
    icon: 'fa-wand-magic-sparkles',
    when: ({ chatId }) => !!chatId, // optional: hide the row when it does not apply
    run: ({ chatId, character }) => { /* the verb */ },
});
SlotWhere the row appearsWhat run and when receive
chatthe conversation's options menu (the ☰ beside the composer), under an Extensions heading; the phone's options sheet{ chatId, character }
messagea message row's overflow (the ellipsis on the row); the phone's message sheet{ chatId, character, seq, messageId, message }: the row's place, the message's own id and the stored row
characterthe character context menu (right-click or long-press a card), behind its own separator; the phone's sheet{ character }
appthe topbar's ⋮ menu under an Extensions heading; the phone's More sheet{ view } (characters, chats, online or an extension's view)
bulka multi-selection's context menu (right-click a selected card) and the multi-select toolbar, on desktop and phone{ characters, selection }: selection is { count, filter }, filter a Select All's (null for characters picked by hand). run gets the selected characters, read at the click (the list row for each one the page has loaded, { id, fav } for the rest; read anything else by id); when gets them for a hand-picked selection and null under a Select All (decide from selection, never from a list)
chatCarda chat's menu in the chats view (right-click or long-press a chat, or its ⋮), above Delete; the phone's sheet{ chatId, charId, chat }: the chat's id, its character's id (null for a chat with none) and the chat as the list shows it (id, name, charId, charName, messageCount, lastMesAt). There is no character object: read the character by charId when the verb needs it (CoreAPI.getCharacterById(charId) || await CoreAPI.ensureCharacterById(charId))
composera button in a strip just above the conversation's composer, your label its tooltip, your buttons together with a hairline between one extension's and the next's; the buttons that do not fit wait, labelled, behind the strip's More. The same strip on the phone, at the phone's touch size. The strip shows only while a button does{ chatId, character, anchor }: anchor is the button, so a verb can open a menu of its own beside it (an overlay, see "An overlay of your own"); picked from the More, it is the More. when is handed the button it would show as
lorean open lorebook entry: its editor in the lorebook manager, and its read view in a chat's Lorebooks window{ world, uid, entry, chatId }: the book's name, the entry's number, the entry as that surface shows it (uid, comment, key, keysecondary, content, constant, disable, position, order; in the manager that includes edits not saved yet) and the chat whose window it is, null in the manager

A label reads in Title Case, as the app's own menu items and buttons do: every word capitalised but a, an, the, and, but, or, nor, for, to, of, in, on, at, by, from, with, as and unless (unless first or last), so a row of yours sits beside the app's without a second casing. The buttons in your own windows follow the same rule; running text, hints and toasts stay in sentence case.

when is asked every time the menu opens, with the context of that moment (in the app slot, the view the menu opens on; in the bulk slot, the selection, and again while the toolbar shows on every change to it and whenever an extension's setting is written, through ctx.settings.set or in another tab; in the composer slot, as the strip draws: when a conversation opens, when its character arrives, when a composer action is added or removed, and when an extension's setting is written, through ctx.settings.set or in another tab). It must decide synchronously: a when that throws hides its row, and so does one that returns a promise (the console says so once). A run that throws, or returns a promise that rejects, shows a toast naming your extension and the verb and logs to the console. Message actions do nothing while a reply is streaming, like the row's own verbs. A lore entry's verbs are asked for only as an entry opens, and a verb registered or removed while entries are open lands in them at once. Registering with an unknown slot, a bad id, a missing label or icon, or a duplicate id in the same slot throws with the reason.

A badge on a grid card

A chip on every character card in the grid, say a rating, is one registration. render receives the card's row, the same object the grid shows, including the values your server half's projection fields put on it (row.ext['my-extension'].rating), and answers a chip or null:

ctx.ui.contribute('character.card.badge', {
    id: 'rating',                   // [a-z][a-z0-9-]{0,31}, unique within your extension
    render: (row) => {
        const r = row.ext?.['my-extension']?.rating;
        return r == null ? null : { icon: 'fa-star', label: `${r}/5`, tone: 'accent' };
    },
});
  • The chip is { icon, label, tone }: a Font Awesome solid name, a label of up to 24 characters (longer is cut), and one of neutral (the default), accent, success, warning, danger. A chip needs an icon or a label; an icon that is not a Font Awesome name is dropped.
  • A card shows at most three chips, under its favorite star, in the order extensions registered them.
  • render runs while the grid builds its cards, so it must be pure and synchronous: it reads the row and returns. One that throws shows no chip and is named in the console; so is one that returns a promise or anything but an object or null.
  • A card keeps its chip while the grid shows the same result, even as it scrolls away and back. The grid asks again whenever it re-reads its rows from the server: a new search, filter or sort, and every character change the change feed brings in, your own writes reported through ctx.report included. A change this tab patches onto a card in place (the favorite star) does not ask again. Switching your extension on re-asks the grid at once, so your projection arrives with your chip.

A tab in the character details

A tab of your own in the character details window, after the app's tabs:

ctx.ui.contribute('character.details.tab', {
    id: 'notes',                    // [a-z][a-z0-9-]{0,31}, unique within your extension
    label: 'Notes',                 // up to 24 characters
    icon: 'fa-note-sticky',         // optional
    render: async (pane, { character, isCurrent }) => {
        const { text } = await ctx.server.call(`/notes/${character.id}`);   // your server half's route
        if (!isCurrent()) return;   // the details moved on while this was loading
        pane.textContent = text || 'No notes yet.';
    },
});
  • render paints the pane the first time the tab is shown for a character, and again for the next character the window opens on; switching away and back within one character does not ask again. Every open empties your pane first, so it never shows the character before.
  • isCurrent() turns false once the window opens another character; check it after anything you await.
  • The tab behaves like the app's own, the phone's swipe between tabs included. When your extension is switched off, a reader who was on it lands on Details.
  • A render that throws, or returns a promise that rejects, shows a toast naming your extension and the tab and logs to the console. Registering with a bad id, a missing or long label, an icon that is not a Font Awesome name, or a duplicate id throws with the reason.

Events

ctx.events.on(name, fn) listens to the app's listed events; fn is a function, or an object with a handleEvent method as addEventListener takes. fn receives the payload, a frozen object that names WHAT changed by id and never carries the thing itself: re-read it through CoreAPI or the HTTP API. Every listener is handed the same payload, so its lists and objects are frozen too: copy one ([...ids].sort()) before you change it. An event costs nothing while nobody listens to it.

The data events come from the server's change feed, so they fire whatever made the change: this tab, another tab or device signed in to the same account, a script calling the HTTP API, another extension's server half. origin is 'self' when this tab made it and 'remote' for anything else; what a server half writes (through its own routes or its listeners) is 'remote' even in the tab that called the route. By the time your listener runs, the app has already brought its own copy up to date.

ctx.events.on('character.updated', ({ ids, fields, origin }) => {
    if (!fields.includes('tags')) return;
    for (const id of ids) {
        const character = ctx.CoreAPI.getCharacterById(id);
        /* ... */
    }
});
EventPayloadFires when
character.created{ ids, origin }characters were imported or created, their tags and links with them (no character.updated follows for those)
character.updated{ ids, fields, all, origin }characters were written: a save, a tag change, a favorite, an avatar swap (fields names what changed, avatar among them; all is true when the write spanned more characters than a record names, the whole library or a set past a thousand; ids is then empty, so re-read what you hold)
character.deleted{ ids, origin }characters were deleted, and with them their chats, media and links. A delete by filter (a Select All's) is announced in parts, each with origin: 'remote', in the tab that ran it too
chat.created{ ids, charId, branchOf, origin }a chat was started; branchOf is { chatId, seq, messageId } (the message it ends on, by its place and its id) when it is a branch of another chat, null otherwise
chat.updated{ ids, fields, origin }a chat's own row changed: its name, its persona, its draft, its metadata
chat.deleted{ ids, charId, origin }a chat was deleted
message.created{ chatId, seqs, messageIds, origin }messages were added to a chat (seqs are their places, messageIds their own ids, one beside each)
message.updated{ chatId, seqs, messageIds, all, origin }messages were edited, swiped or continued (all when the whole transcript was replaced: seqs and messageIds are then empty)
message.deleted{ chatId, seqs, messageIds, origin }messages were deleted (later places renumber, their ids kept, so re-read the chat)
settings.changed{ keys, all, origin }settings were saved (all for a wholesale save)
playlists.changed{ ids, all, origin }playlists were created, edited, deleted or had members added or removed (all for a whole replace)
tags.changed{ names, origin }a tag was renamed, merged or deleted everywhere (a character's own tags changing is character.updated with tags in fields)
media.changed{ ids, charId, origin }a character's gallery media was added, removed or re-sourced
library.changed{ reason, origin }anything may have changed and nothing is itemized: an import in another process (reason: 'import'), or this tab reconnecting after it lost the feed (reason: 'resync'); re-read what you hold
generation.started{ chatId, mode, targetSeq }a reply (or an Impersonate draft) began streaming; mode is append, regenerate, swipe, continue or impersonate, targetSeq the row a rewrite streams into
generation.ended{ chatId, mode, seq, messageId }the reply was stored at seq as the message messageId (both null for an Impersonate draft, which is never stored), after its row settled on screen
generation.failed{ chatId, mode, cancelled, error }the reply stopped: cancelled when the reader stopped it (then error is null), or it failed or the connection dropped
conversation.changed{ chatId, charId }the open conversation changed: opened, switched or closed (chatId is null on close), and again with the charId once a chat's character, still loading when it opened, resolves
lorebook.changed{ name, origin }a lorebook or a binding to one changed (name is null when several did, or a binding moved)
persona.changed{ scope, personaId, chatId, origin }the persona in use changed: global (the account's active persona; personaId is the one now active, null for none), chat (one chat's own; chatId names it and personaId is the persona it now uses, its override or else the active one) or delete (personaId is the persona deleted, which no chat uses after it). chatId is null but for chat
library.ready{}the library grid's first query answered, once per page load: at startup when the start page is Characters (usually before extensions load, so read the library through CoreAPI rather than waiting for it), otherwise on the reader's first visit to Characters, and never in a session that does not open it
extensions.ready{}every extension enabled at startup finished loading (or failed), once per page load; one switched on later has missed it
ui.formFactorChanged{ mobile }the layout switched between desktop and phone
notifications.changed{ level, visible }the notifications button's state changed (once per change, however often the button repaints behind it)

The three generation events come from this tab's own conversation and name the chat the reply belongs to, even when the reader has moved to another chat by then; a reply another tab or device generates reaches you as message.created instead. The last seven relay one of the app's DOM events, and api 1's names for those still work: ctx.events.on('cl-worlds-changed', fn) adds a plain DOM listener whose fn receives the Event, with the old detail shape (world instead of name, the whole character on cl-chat-changed). cl-character-changed still fires for the app's own surfaces, but only for some writes; character.updated is the complete one. Any other name you pass is such a DOM listener too, which is how you hear another extension's ext:<id>:<name> events. The app's other DOM events are its internal wiring and can change without notice. Every listener you add is removed when your extension is switched off, and ctx.events.off removes one sooner.

Conversation hooks

ctx.hooks.add(name, fn, { priority }) joins one of the conversation's pipelines, and ctx.hooks.list() names them. Hooks run highest priority first, each call contained: one that throws is stepped over (a filter's input passes on to the next one), and every call is timed in the inspector.

HookKindYou getYou answer
message.renderfilterthe message body as HTML, already through the chat's display regex scripts and the app's sanitizer, with comments and tags HTML does not have hidden (their text kept; message is the row as stored); ids come prefixed user-content- and a message's own data-* attributes come renamed data-user-* (so none can carry the name of an app control's attribute), and when the message carried a <style> its top-level elements carry a cl-msg-scope-… class its scoped CSS is keyed to (keep it on what you return), and { chatId, charId, seq, messageId, message, format } (messageId is null for a reply still streaming)the HTML to show (undefined leaves it)
message.enhanceaction{ chatId, seq, messageId, el, message }, el being the message's row in the pagenothing
composer.sendfilter that may waitthe text the reader is sending, and { chatId, charId }the text to post, or '' to take it yourself (nothing is posted and the box clears); a promise is awaited
ctx.hooks.add('message.render', (html, { message }) => {
    const note = message.extra?.['my-ext']?.note;
    return note ? `${html}<div class="myext-note">${ctx.CoreAPI.escapeHtml(note)}</div>` : undefined;
});
ctx.hooks.add('message.enhance', ({ el }) => {
    if (el.querySelector('.myext-toggle')) return; // enhance runs again on a row it has seen
    const button = document.createElement('button');
    /* ... */
});
  • A render filter answers synchronously and with text: a promise, or anything that is not a string, is ignored and counted as an error. It runs when a row is built (a message stored, edited or swiped, a chat opened), never on the paints of a reply that is still streaming: that reply's row is built once it is stored.
  • What you answer goes through the sanitizer again, so buttons, scripts, event handlers and styles come out. Anything interactive goes in with message.enhance, which hands you the row once it is in the page.
  • format(text) renders text the way the row renders its own message (markdown and the speech registers, embedded media pointed at its copies on disk, and the text as stored: a {{char}} or {{user}} in it stays as written, as it does in the transcript) and through the sanitizer. Use it for message text you add, such as a translation or a rewritten reply; escape anything else.
  • message.enhance runs on every path that puts a row in the page, the same row again among them, so check before you add.
  • A message's thinking that is closed has no body in the page until the reader first opens it, unless the reader turned on Render closed thinking up front in Chat settings; opening it does not run message.enhance again. The thinking's text is always in message.extra.reasoning.
  • message is a frozen copy of the stored message. To keep data on a message, write it to extra.<your id> (the message route merges extra key by key, and a server half writes it through the chats store); the app rebuilds the row when the change arrives.
  • composer.send runs when the reader sends a message, and for every chat.send (not for Impersonate or a guided reply, whose text is direction, not a message). It may take its time: the box shows "Preparing your message" and stays read-only until every filter answered, and a reader who moved to another chat meanwhile sends nothing. A filter that throws or rejects leaves the text as typed.
  • Adding or removing a render or enhance hook rebuilds the open conversation's rows once. A conversation with no hooks added pays nothing for them.
  • While any composer.send filter is added, every send waits on it, even when it answers at once: the box goes read-only behind "Preparing your message" for that moment. So join a hook only while it has work and leave it when it has none (ctx.hooks.add answers the removal); the Hello World tour and the Translator both work this way.

Changing how the app looks

  • A message's body is yours through message.render: you may answer a whole new body built from message and format, and add what is interactive with message.enhance.
  • A grid card carries your data as badges (A badge on a grid card).
  • The look of anything is a stylesheet's: your style entry loads into the module layer, below the user's theme settings and custom CSS, and an extension may be a stylesheet alone: a theme of the app's :root tokens needs no code at all. A theme that changes with the reader (palettes they pick, colours read from a picture, a background that moves) adds a client half, and a server half for anything it keeps, as the bundled Midnight does.
  • Restyle at the app's own weight. Your sheet loads after the app's own, so a rule spelling the app's selector wins the tie and still loses to the reader's custom CSS, which loads after yours. A rule weighted above the app's (an extra class, an id, a :not(...), !important) beats the reader's custom CSS too. Scope a rule of your own with :where(...), which adds no weight. Where the app's own rule is !important, answer it with !important on the same selector and property, and nowhere else; the reader's custom CSS still wins the tie.
  • A theme's own choices. Write one class a choice on the root from your client (my-theme-nav-top) and scope each rule in :where(...) (:where(.my-theme-nav-top) .topbar { ... }), so the rule keeps the app selector's weight. Key your default on the other value's absence (:where(:root:not(.my-theme-nav-top)) .topbar): your sheet loads before your client runs, so the default then paints from the first frame instead of flashing. A layout that moves the page's edge changes the width the character grid measured; ask for a new query with CoreAPI.refreshCharacters() once you have moved it.
  • The accent is written by the app on every load, from the reader's theme, at :root and after your sheet, so :root { --accent: ... } in your sheet never shows. A theme that brings an accent declares it under a class it puts on the root (:root.my-theme-accent { --accent: ...; --accent-rgb: ...; }) and sets that class only while the reader has picked no accent of their own: their highlightColor setting equal to CoreAPI.getDefaultSetting('highlightColor') and no --accent in their customCSS setting. Follow settings.changed for both keys.
  • Hiding. An element carrying the hidden attribute is hidden whatever display your sheet gives it (the app's [hidden] rule is !important); toggle el.hidden, and give a display: ... !important of your own a :where(:not([hidden])), or it shows a hidden element.

There is no door to swap one of the app's own components for yours (a grid card's markup, a details tab's body, a chat card): the app keeps their structure, and you reach them through the slots, hooks and styles above.

Beyond the stable surface

Nothing is fenced, but not everything is within reach. What you can reach beside ctx's doors: the whole HTTP API (ctx.CoreAPI.apiRequest), the page's DOM, and the few bridges the app publishes on window (ExtensionHost, chatsModule, ProviderRegistry). What you cannot: the private insides of the app's ES modules, such as the Chats view's own functions, which reach you only through CoreAPI, commands and those bridges. More doors are on their way as registered surfaces: more commands, slots and hooks across every part of the app. The deal is symmetric: anything outside ctx may change in any release without notice, and so may what a CoreAPI function takes and answers (its name stays, or is listed below first), so expect to maintain your extension. requires.cl is reserved for pinning the Project Σ version you tested against and is not enforced yet.

A list the HTTP API answers that grows with the library pages: a request naming no limit reads its first page (the default its x-collection names, 100 for most), never the whole list, so a reader that needs all of it walks nextCursor with after. ctx.CoreAPI.fetchAllPages(path, params) does the walk.

Two rules of the house worth honoring even though nothing enforces them on you:

  • Third-party text rendered with innerHTML goes through the app's sanitizer paths. If you render content from an external API, look at how the browse views use safePurify before rolling your own.
  • Settings and storage are per user. Do not stash per-user data in localStorage without scoping it; the app's own code never does.

Deprecated doors

From the first public release on, a door on its way out is listed here, with what replaces it, one release before it leaves: a command, event, hook or slot, a ctx member, a CoreAPI function, a server ctx member, a store guard or a pipeline. Nothing is listed yet.

The HTTP API marks its own in its specification (deprecated in /api/openapi.json, and a list's form on its way out in the list's x-collection), on the same rule.

The server half

An extension can ship server code beside its client: add "server": "server/index.js" to the manifest. The entry is an ES module exporting register(router, ctx); it runs once at server boot, and its routes mount under /api/ext/<your-id>/ behind the same sign-in gate as the rest of the API, so every request arrives with req.db, req.userHandle and req.paths scoped to the requesting user exactly as first-party routes see them. Your routes answer only the accounts that switched your extension on; any other account gets a 404.

export function register(router, ctx) {
    router.get('/status', (req, res) => res.json({ user: req.userHandle }));
    router.post('/rebuild', ctx.requireAdmin, (req, res) => { /* admins only */ });
}

The server ctx:

FieldWhat it is
ctx.apiVersionthe extension api this server speaks, 'major.minor'; a manifest whose requires.api is newer is refused (see "Anatomy") and its half is never imported
ctx.manifestyour manifest row
ctx.requireAdminroute middleware; gates a route to admins
ctx.requireChatroute middleware for a route whose path names :chatId: it answers 404 { error: 'no such chat' } unless that chat is in the account's library, so the handler reads req.params.chatId knowing it is there
ctx.multiUserwhether this server runs with accounts (false on single-user installs)
ctx.settingValue(db, key, fallback)read a user's setting (pass req.db)
ctx.setting(db, key)read your extension's OWN per-user config: the scoped key plus your manifest-declared default, the same declaration the client facade reads, so the two halves cannot drift. Use settingValue only for first-party keys
ctx.chatSlot.get(db, chatId) / set(db, chatId, value)your own slot in a chat's metadata (chat_metadata.extensions.<your-id>), which travels with the chat into its export and a branch: get answers it ({} when there is none), set replaces it (null removes it), leaving the chat's other keys and every other extension's slot as they are; a chat that is not there throws (statusCode 404). A set is reported as a change to the chat's chatMetadata, which every write of the metadata reports (each reply among them), so a client half that keeps a copy of its slot has the write report a field of its own beside it (ctx.report in the same transaction) and follows that
ctx.messages.shown(msg) / digest(text)the text a stored message shows and its digest, as the page's ctx.messages answers them; store the digest beside what you made of a message and the page can tell when the message changed
ctx.debugLog(req, ...)routine logging behind that user's debug toggle, tagged [ext:<id>]; use console.error/warn for failures
ctx.browser.consumer({ name, origin, fetchPrefix, warmPath, ready })a hosted-browser consumer of your own, for a Cloudflare-gated site: a bare https origin and the path prefix (starting and ending with /) your page's ctx.browser.fetch stays under, warmPath where its parked page waits (default /), ready the settle hook (default the Cloudflare wait; null for none). name is required: lowercase letters, digits and dashes, starting with a letter, at most 32. Registered as <your id>:<name>, which no built-in consumer can take, and answers that id. The browser routes serve it only for accounts that switched you on (any other gets a 404), and it goes with your half: once your half fails or you are removed there is no such consumer, and a request naming it answers 400. Settings > Online > Hosted Browser lists it under Extension Sites with a Check. The browser carries every login it holds on that site, so keep the prefix to what you need
ctx.helpersthe hardened transport helpers the first-party provider services run on: guardProxyTarget (the proxy security gate), sessionSlot (a per-user in-memory credential slot), sameHostFetch (redirect-pinned fetch), wildcardPath
ctx.dataDir()extension-global scratch dir (caches) at extensions/installed/.data/<id>/, never served and never inside your install; removing the extension deletes it
ctx.userDataDir(req)a per-user directory inside that user's own data home; removing the extension deletes it from every account's home
ctx.files.user(req) / shared()the two folders above as handles: user(req) the requesting account's, shared() the one every account shares. Each answers read(name) (the text, null when the file is not there), readJson(name, fallback) (the file parsed; when it is not there the fallback, or null without one; a file that is not JSON throws, naming it), write(name, data) (a string or a Buffer), writeJson(name, value) (pretty-printed), remove(name) (a file, or a folder and everything in it; nothing there is no error), list(sub) (the names in the folder or a folder inside it, [] when it is not there) and path(name) (the absolute path, for something that opens a real file). Every name is a path relative to the folder (cache/index.json): an absolute path, a drive, a .. that leaves the folder or a name not every disk can hold (aux.json, a:b) throws, naming it. A write lands whole, through a temporary file renamed over the old one, with its folders made first. Synchronous, for small files: hand a large one to a stream of your own through path(name). See "Where to store what"
ctx.storesthe app's own store modules, the functions its routes call (ctx.stores.characters, ctx.stores.chats, ctx.stores.tags and the rest); see "Writing to the library"
ctx.imports.stage(req, body, { name })stage a card file your half holds (a Buffer, the body of a fetch, a node stream) in the requesting account's home, exactly as an upload to POST /api/characters/import/stage is. It answers { stageId, format, card, picture, media } (a card PNG or a charx), and the client amends the card and commits it through POST /api/characters/import/stage/{stageId}, so a download you fetch server-side imports like a file the user picked. A refusal is thrown with its statusCode, as the stage route answers it: 400 for an empty body, a body that is not a Buffer or a stream, or a charx the archive reader refuses; 413 for a card PNG past 100 MB; 415 for a file that is neither; 422 for a file with no card in it, a charx whose card.json is not JSON among them
ctx.hooks.add(name, fn, { priority })a store guard or a pipeline filter; see "Store guards" and "Pipeline filters"
ctx.macros.add(name, macro)a {{name}} macro in the prompt: a function (no arguments) or a definition with arguments; see "Macros"
ctx.prompt.addBlock(spec)a block of your own text in every chat prompt; see "Prompt blocks"
ctx.assistant.addSource(spec)a context source the chat assistant can be given, switched in its context view; see "Assistant sources"
ctx.prompt.read(db, chatId)a chat for your own model call: its names, the messages its prompt is written from as stored, and its macros; see "Reading a chat for your own model call"
ctx.prompt.names(db, chatId)the chat's two names alone, { charName, userName }, for a half that reads the messages itself; see "Reading a chat for your own model call"
ctx.prompt.visible(msg)whether the prompt reads a stored message: not hidden, not a system note, not empty
ctx.prompt.fence(text, { char })the text between two fences it cannot close, for text from outside (a card, a chat, a name) quoted in a prompt of yours: each fence a run of char, at least three and one longer than any run of that character in the text, on a line of its own. char is '~' by default (the tildes the app quotes outside text with in its own prompts) or a backtick; anything else throws. Tell the model the fenced part is data to act on nothing in; see "Calling a model"
ctx.llm.chat(db, request, { signal }), ctx.llm.stream(db, request, { signal })a call to one of the account's own models; see "Calling a model"
ctx.llm.canSee(db, request)whether the connection a call would use sends pictures (true, false, null when unchecked); see "Calling a model"
ctx.llm.registerAdapter(adapter), ctx.llm.kita kind of connection of your own, built from the kit's pieces (LlmError, classifyUpstream, boundedErrorText, networkError, readJsonBody, parseSse, translateParams); see "A kind of connection of your own"
ctx.jobs.run(db, job), ctx.jobs.schedule(schedule), ctx.jobs.list(db)background work for an account, now or on a timer, and your own jobs as they stand; see "Background jobs"
ctx.refuse(message)refuse the write a store guard is looking at
ctx.events.on(fn)every committed change to the library of an account that switched you on; see "Server events"
ctx.report(db, record)report a write to your own tables; see "Your own tables"
ctx.query.projection(spec), ctx.query.ruleField(spec), ctx.query.sortKey(spec)a value the character list rows carry, a field the advanced filter offers, an order the list sorts by; see "Your own tables"

Streaming from your server half

A route whose answer comes in parts (a model's reply read a part at a time, a long walk reporting as it goes) writes application/x-ndjson: one JSON value a line, each ended by a newline. The page reads it with ctx.server.stream, each line handed on as soon as it lands:

// the server half
router.post('/ideas', async (req, res) => {
    const gone = new AbortController();
    res.on('close', () => { if (!res.writableEnded) gone.abort(); });   // the page stopped reading
    res.setHeader('Content-Type', 'application/x-ndjson');
    for await (const idea of ideasFor(req.db, gone.signal)) res.write(`${JSON.stringify({ idea })}\n`);
    res.end(`${JSON.stringify({ done: true })}\n`);
});

// the page
const stop = new AbortController();
for await (const line of ctx.server.stream('/ideas', 'POST', { about: 'the river' }, { signal: stop.signal })) {
    if (line.idea) show(line.idea);
}
  • Refuse before you write the first line, with a status and { error } as any route does: the page's loop throws in your words. A failure after the first line can only be a line of its own (say { error }), which the page reads like any other.
  • An answer that is not NDJSON (a plain res.json(...)) is handed to the loop once, so one route can answer either way.
  • The page stopping (its signal, or leaving the loop) closes the request: listen for close on the response and stop the work, a model call included (ctx.llm.stream takes your signal).

Your own tables

Two places hold what your extension keeps about a chat or a message. What should travel with the chat, into its export and a branch, rides the row: a message's extra.<your id>, and a chat's metadata under extensions.<your id> (ctx.chatSlot, or ctx.stores.chats.patchChat(db, chatId, { chatMetadata: { extensions: { '<your id>': value } } }), which merges your key alone, null removing it). Like every store function it refuses by throwing an error with a statusCode (404 for an unknown chat), which the app's error handler answers when your route lets it through. Anything derived, local or large belongs in your own tables.

A message has an id of its own (chat_messages.id, an integer never handed out again) and a place in its chat (chat_id, seq, 0 to n - 1), and deleting a message moves every later one down a place while its id stays. So:

  • Data ABOUT a message (a translation cache, a rating, an embedding) references chat_messages(id) ON DELETE CASCADE: it stays on its message wherever the message sits and goes with it.
  • A table that walks the transcript in order (a state as of message seq, as Trackers keeps them) references chat_messages(chat_id, seq) with ON DELETE CASCADE ON UPDATE CASCADE, so the renumber carries its rows; a migration that keys on the place without ON UPDATE CASCADE is refused.
  • A whole transcript replaced (PUT /chats/{id}/messages, a re-import over a chat of the same name, a bundle restore) is new messages with new ids: the rows keyed on the old ones cascade away, and rows keyed on the place start over.

Data a character, chat or message owns belongs in tables, not squeezed into a card. Export migrations beside register, and the app builds your tables in the library of each account that switches your extension on (the bundled extensions/bundled/ratings-notes/ is a complete working example: a table, writes that report, and all three query doors):

export const migrations = [
    `CREATE TABLE x_my_extension_ratings (
        char_id TEXT PRIMARY KEY REFERENCES characters(id) ON DELETE CASCADE,
        rating INTEGER, updated_at INTEGER NOT NULL);
     CREATE INDEX x_my_extension_ratings_rating ON x_my_extension_ratings(rating);`,
];
  • Each entry is an SQL string or a function (db) => void, run once per library, in order, in a transaction of its own: the moment an account switches you on, or when its library opens with you on. An account that never switched you on never gets your tables. The list is append-only: an entry that already ran is never edited, and an edited one fails your server half by name. Add a new entry instead.
  • Foreign keys are off while an entry runs, so a table you rebuild by the usual recipe (create the new one, copy, drop the old, rename) keeps the rows that reference it. Before the entry commits, every row of your tables must still point at a row that exists; one that does not rolls the entry back and fails your server half by name.
  • Everything you create is named x_<your id>_..., with your id's hyphens as underscores (x_my_extension_). An object named otherwise, one on a table of the app's, a dropped or changed app object, or a changed schema version rolls the entry back and fails your server half for every account, whichever account's library found it.
  • REFERENCES characters(id) ON DELETE CASCADE makes a character's delete take your rows with it.
  • Removing your extension keeps its tables and their data.

A write to your own tables reaches no guard and no open page on its own: report it, inside the same transaction, as the change it is to the app's data (a character's rating is a change to that character), with fields named after your id:

router.put('/rating/:id', (req, res) => {
    req.db.transaction(() => {
        req.db.prepare('INSERT INTO x_my_extension_ratings (char_id, rating, updated_at) VALUES (?, ?, ?) ON CONFLICT(char_id) DO UPDATE SET rating = excluded.rating, updated_at = excluded.updated_at')
            .run(req.params.id, req.body.rating, Date.now());
        ctx.report(req.db, { entity: 'character', op: 'updated', ids: [req.params.id], fields: ['my-extension.rating'] });
    })();
    res.json({ ok: true });
});

The store guards see the report before the write commits, and every open tab of that account re-reads the character after it. A message record also names its chatId, as the app's own do; its ids are the messages' seqs, and it may carry messageIds, the messages' own ids, one beside each seq. The record carries extension: 'my-extension' (the app sets it; you cannot), so whoever reads it can tell a change to your data from a change to the character itself: the character's details, for one, raise no "changed elsewhere" notice over a report of yours. Your own tab, the one that wrote, gets the record too, so a listener that re-reads should repaint only what changed.

Three query doors read your tables inside the app's own character queries, for the accounts that switched you on. Declare them inside register; a door declared after register returned (from a route, a listener or a timer) is refused:

ctx.query.projection({ key: 'rating', table: 'x_my_extension_ratings', column: 'rating' });
ctx.query.ruleField({ key: 'rating', label: 'Rating', type: 'number', table: 'x_my_extension_ratings', column: 'rating' });
ctx.query.sortKey({ key: 'rating', label: 'Rating', table: 'x_my_extension_ratings', column: 'rating' });
  • A projection field rides every character list row as ext['my-extension'].rating (null for a character with no value), so a grid badge needs no request of its own.
  • A rule field is an advanced-filter field named ext.my-extension.rating. Its operations follow its type: number (more_than, less_than, equals), date (before, after, in_the_last), text (equals), boolean (is_true, is_false), and for every type is_set and is_not_set.
  • A sort key is a list sort named ext.my-extension.rating. The characters with a value come first, in the column's order (order=desc reverses them), ties in the order their rows were first written (an upsert keeps its row's place; on a WITHOUT ROWID table, by the character's id); the characters with no value (no row, or NULL) follow by name, A to Z, whatever the order. It pages by offset only, never by cursor. Its table holds at most one row per character (charColumn is its primary key or has a unique index), and a text column sorts by the collation the column declares.
  • charColumn names the column holding the character's id (char_id by default).
  • Each door must be served by an index: a projection by one on charColumn, a rule field by one on column, a sort key by one on column that walks it in order (on a WITHOUT ROWID table, one on column, charColumn). A door no such index serves fails your server half, naming the index to add. The check asks for the index, not the table's size: a table small enough that SQLite scans it today still passes.
  • Your inventory row lists what you declared (serverQuery), so a client offers only what the server will answer.
  • The bundled client adds your sort keys to the grid's sort menu (each one descending and ascending, grouped under your extension's name) and your rule fields to the advanced filter, for as long as the account has you on. Switched off, a sort of yours falls back to the reader's default sort, and a filter rule on your field is removed with a notice; a saved filter preset keeps the rule for when you are back on.

Writing to the library

Write through ctx.stores, passing req.db (or the db a guard or listener is handed):

router.post('/tag-all/:id', (req, res) => {
    ctx.stores.tags.addCharTags(req.db, req.params.id, ['reviewed']);
    res.json({ ok: true });
});

A delete through the stores takes the row's files with it (a character's picture and gallery, a persona's picture, a media file, a background) when you pass the account's paths, req.paths: ctx.stores.characters.deleteCharacter(req.db, req.paths, id). A write through the stores is a write like the app's own: the store guards see it, and every open tab of that account hears it on the change feed and updates. A raw statement on req.db does neither: no guard sees it and no open page learns of it until it re-reads. The store functions follow the server's own releases, so check the changelog when you upgrade.

Store guards

A store guard runs after a write to the library and before it commits, and may refuse it:

ctx.hooks.add('store.before.character.updated', (record, { db, user }) => {
    // a guard runs at the commit of every such write: look at what it touched before reading a card
    if (Array.isArray(record.fields) && !record.fields.includes('name')) return;
    for (const id of record.ids || []) {
        const character = ctx.stores.characters.getCharacter(db, id);
        if (!character?.card?.data?.name?.trim()) ctx.refuse('A character needs a name');
    }
});
  • The name is store.before.<entity>.<op>, one per kind of record the change feed carries (character.updated, message.created, persona.deleted and so on). A name no write ever reports is refused when you register it, with the reason.
  • A write reports each row once. An import is character.created alone, its tags included, so a character.updated guard never sees one; a card save that changes the tags is one character.updated naming tags beside the other fields it changed. A tag add through the stores that links nothing new (the character already carries every tag given) is no write: nothing is stamped and nothing is reported.
  • record is the change record (entity, op, ids or all: true, fields where the write names them, and extension when an extension reported it), frozen. db is that account's library, holding the write that has not committed yet: read it to decide, never write through it.
  • ctx.refuse(message) rolls the whole write back, and the request that made it answers 400 with your message. Any other throw is caught and logged, and the write goes ahead.
  • A guard is synchronous: a write cannot wait. A guard that returns a promise is not waited on and cannot refuse; the server says so in its log, once.
  • Guards run highest priority first (default 0), then in registration order, and only for the accounts that switched your extension on.
  • A guard on a delete reads a library where the row is already gone, and a guard on a picture change (fields: ['avatar']) sees the report, not the new picture.

Pipeline filters

A pipeline filter rewrites a value where the app produces it, for the accounts that switched your extension on:

ctx.hooks.add('card.import', (card, { db, user, sourceName, provider }) => {
    card.data.extensions['my-extension'] = { importedFrom: sourceName };
    return card;
});
namewherevaluealso in the second argument
card.importevery import of a card (a file, a charx, a link, a provider, a bundle), before its identity and its content hash are readthe card, { spec, spec_version, data }sourceName (the file name), provider (the provider it came through, or null)
card.exportevery export of a card (the PNG, the bundle)the card as exportedid
chat.exporta chat's JSONL exportits entries: the header object, then one object per messagechatId, charId
lore.candidatesevery lore scan (the prompt, the chat's lore panel, the assistant's context)books of your own to scan beside the chat's (a list, empty to start): { name, data: { entries } }, each name written ext:<your id>:<label> and each entry carrying a uid and its contentchatId, charId, trigger, dryRun, books (the names of the chat's books in force) and texts (the messages the keys are matched against at the global scan depth, oldest first, as the engine reads them)
lore.activatethe same scans, after the engine placed what firedthe placed entries in five groups, before, after, atDepth, emBefore, emAfter, then anTop and anBottom (the entries wrapping the chat's Author's Note, sent with it only when it is) and outlets (the entries {{outlet::name}} places, each naming its outlet): drop an entry or change its content; an answer without anTop, anBottom or outlets keeps the engine'schatId, charId, trigger, dryRun, and the same books and texts
prompt.finalevery chat prompt once the budget has fitted it: each send, whatever its mode, and the prompt inspectorthe messages, [{ role, content }], the chat's turns already through its regex scripts that rewrite what the prompt sends, each role one of system, user, assistant; a user's turn that shows the model pictures also carries its images, so keep them when you rebuild a message (a turn of the example dialogue is a system message whose text opens with its speaker's name)chatId, charId, trigger (normal, continue, impersonate, swipe or regenerate), dryRun
llm.requestevery call to a model: the chat, the assistant, the studio, a connection test and a raw POST /api/llm/chatthe request, { messages, model, params }: params in the app's own names (temperature, topP, topK, maxTokens, stop, presencePenalty, frequencyPenalty, seed, reasoning, json), model set only when the call chose one over its connection'spurpose (chat, assistant, creator, test, tool or extension), profileKind, profileId, and extension (the calling extension's id) when the purpose is extension; and which chat or session the call is for: chatId and mode on a chat's reply, chatId and sessionId on the assistant's (both rounds of a read), sessionId and charId on the studio's, the same names reply.final is told on that surface (none on the tag wand, a test, a tool call or an extension's)
reply.finalevery reply a model writes that is stored: the chat's (each mode but impersonate, whose text goes to the composer), the assistant's and the studio's, a partial kept after an error or a stop includedthe reply's text; for continue, only the new text, which is then added to the messagesurface (chat, assistant or creator), chatId (null in the studio), interrupted (why a partial was cut short, or null); mode in the chat, sessionId in the assistant and the studio, charId in the studio
  • Return the value to hand on, or undefined to hand on what you were given. Each filter gets its own copy, so change it freely: a filter that throws half way leaves nothing behind.
  • A card must keep what an import relies on: data.name (non-empty text), data.tags (a list of text) and data.extensions (an object). A chat export stays a non-empty list of objects. An answer of the wrong shape is skipped, as a throw is, and the value your filter was given passes on.
  • A filter is synchronous. A promise is ignored (the server says so in its log, once) and the value passes on: the filters run inside the request that writes, where a slow one stalls every request on that account's library. Work that has to wait (a model call, a fetch) belongs after the write, in ctx.events.on.
  • Filters run highest priority first (default 0), each handing its answer to the next. Every call is timed and counted in the inspector, a failure against its pipeline.
  • db is the account's library, for reading. Write nothing through it here: a write belongs to the request's own store calls or to your listener.
  • Your books from lore.candidates fire like any book's entries (keys, order, position, depth, and every setting of their own) and are scanned in the global scope, after the chat's, persona's and character's books. Name each ext:<your id>:<label>: a book named for another extension, or with nothing after your prefix, is the wrong shape (a book another filter handed you passes on under its own name). The chat's Lorebooks window lists your books, read-only, under "Added by extensions"; the prompt inspector shows what they placed. books and texts are frozen; read them rather than reading the chat or its books a second time. dryRun is true in the panel and the assistant (nothing will be sent) and false for a real send. Dropping an entry in lore.activate takes it out of the prompt and the panel alike.
  • prompt.final has the last word on what is sent, after the budget: what you add there is not measured against the connection's context size, so keep it short, or add it as a prompt block, which is. The prompt inspector shows its answer, with dryRun true.
  • llm.request's purpose is set by the route that made the call, never by the request body: a raw POST /api/llm/chat is always tool, and a call through ctx.llm is extension. The scope (chatId, sessionId, charId, mode) is the route's too, so a body naming a chat never sets it; a filter adding a chat's own state to the assistant's material reads chatId rather than guessing from the newest session. Your params meet the rules a caller's own do (a name from the list above, a number where one is due); an answer breaking them is the wrong shape.
  • reply.final changes what is stored, and what the reader sees once the reply lands (the words that stream in before it are the model's own). Answer text that is not blank: a filter cannot delete a reply. Work on a stored reply that has to wait (a summary, a memory) belongs in ctx.events.on, where the stored message arrives as a change.
  • Two consequences to design for. A card card.import rewrites is hashed as rewritten, so a later import of the same file matches the stored character only when your filter answers the same way again. And an ST data directory migrated into the app is imported by a separate process, where no server half runs, so its cards do not pass card.import.

Macros

// {{weather}}: a function alone is a macro that takes no arguments
ctx.macros.add('weather', ({ db, chatId }) => readForecast(db, chatId));
// {{dice::2d20}}: a definition declares its arguments
ctx.macros.add('dice', { args: [{ name: 'formula' }], handler: ({ unnamedArgs: [formula] }) => rollDice(formula) });
  • {{weather}} then expands anywhere a prompt is built from (the preset, the card's fields, lore keys and content), for the accounts that switched your extension on; for any other it stays as written, like an unknown macro.
  • Your handler runs each time a text names the macro, when that text is expanded, as the app's own macros do (two {{roll::d6}} roll twice): a prompt build, the lore panel's scan, a sent turn, a chat's greeting as the chat is created, and ctx.prompt.read's expand. A macro no text names is never called. Keep it cheap, and make it read, never write: a lore key holding it runs it at every scan, and the prompt inspector and the lore panel build prompts that are never sent.
  • It answers text (a number is written out), and the answer goes in as written: it is never expanded again. A throw, a promise or anything else leaves that call as written and counts as an error in the inspector. A handler that expands its own macro again (through ctx.prompt.read) has that inner call left as written.
  • It is handed the build's facts (db, user, chatId, charId, lastSeq) and the call: name, args (every argument, each already resolved, so {{dice::{{getvar::n}}d6}} hands it the variable's value), unnamedArgs (the declared ones), list (the ones after them, or null for a macro without a list) and isScoped.
  • args declares the arguments in order, each { name, type, optional }. type is string (the default), integer, number or boolean, or a list of them. An optional argument comes after every required one. list: true (or { min, max }) takes any number more after them. Arguments are written after :: ({{dice::2d20}}), or one after a single : or a space ({{dice 2d20}}).
  • A call with the wrong count or a mistyped argument stays as written and your handler is not called. strict: false hands it to your handler anyway, to judge args yourself.
  • A macro whose last declared argument can take it may be written as a block: {{shout}}quiet{{/shout}} hands quiet (trimmed) as its last argument, with isScoped true. A macro with a list is never a block.
  • lastSeq is the seq of the newest message the build reads, as a prompt block is told it (below); the lore panel's scan tells your macro the same, so a lore key holding your macro fires there as it does in the prompt. A reader's turn expanded as it is sent is told the newest message the prompt reads before it, never a hidden one.
  • A name is letters and underscores ([a-z][a-z_]{0,31}), never one of the app's own (char, user, description, pick, random and the rest), and never one another extension holds; a definition takes only the keys above (args, list, strict, handler) under the rules above. Any refusal fails your server half at registration, naming the reason.
  • Macros expand in the prompt a reply is built from. A chat's greeting is expanded once, when the chat is created, with the whole vocabulary, yours included (called with no chatId yet), and the answer is stored in the chat's first message, as a sent turn that holds a macro is stored expanded: text that should follow the chat as it goes belongs in the prompt, never in a greeting.

Prompt blocks

ctx.prompt.addBlock({
    id: 'reminder',
    position: 'at_depth', depth: 2, role: 'system',
    text: ({ db, user, chatId, charId, dryRun, lastSeq }) => reminderFor(db, chatId),
});
  • text runs once per chat prompt, for the accounts that switched your extension on, and its answer is the block's text in that prompt. Blank text adds nothing; a throw, a promise or anything but text adds nothing either and counts as an error in the inspector. dryRun is true for the prompt inspector (nothing will be sent) and false for a send.
  • lastSeq is the seq of the newest message of the history the reply is written from: the reader's turn for a send, the message before the target for a swipe or a regenerate (whose target is left out), the target itself for a continue, never a hidden message; null when the history holds none. A block that keeps something per turn answers as of that message, so a swipe is not told the turn it is replacing.
  • position places it: pre_history (the default) after the preset's own blocks, right before the conversation; post_history after the preset's blocks that follow the conversation; at_depth inside the conversation, depth turns back from the newest (0, the default, is after it), beside the lore, the Author's Note and the Character's Note placed there. Blocks sharing a depth are ordered by order (default 100): the higher sits nearer the reply.
  • role is system (the default), user or assistant. Before or after the conversation a block is a message of its own, as each of the preset's blocks is; when the chat's preset has Join neighbouring system blocks on, a system block joins the system messages beside it, as the preset's own do. At a depth, the blocks, lore and notes that share the depth, order and role go as one message (the lore, the Author's Note and the Character's Note sit at order 100).
  • A block the user places (a setting of yours) answers its place with its text: text may return { text, position, depth, role, order } instead of the text alone, each placement field optional (the one you registered stands in for any you leave out), so each prompt puts the block where that account's setting says. A placement outside the rules above adds nothing and counts as an error. For example text: ({ db, chatId }) => ({ text: recapOf(db, chatId), position: ctx.setting(db, 'place') }).
  • The text is expanded like the preset's own ({{char}}, {{user}}, the extensions' macros) and counted by the budget like the rest of the prompt: a long block leaves less room for the conversation.
  • An id is lowercase letters, digits and dashes ([a-z][a-z0-9-]{0,31}), unique among your own blocks. A second block with the same id, or a position or role outside these, fails your server half at registration, naming the reason.
  • Blocks join the chat's prompt only; the assistant and the studio build theirs from their own material. To hand the chat assistant something, register a source (below).

Assistant sources

ctx.assistant.addSource({
    id: 'trackers',
    label: 'Tracked state',
    defaultOn: true,
    read: ({ db, user, chatId, charId }) => trackedStateFor(db, chatId),
});
  • A source is one more thing the chat assistant can be given beside the card, the persona, the Author's Note and the rest. The assistant's context view lists it with a switch, its label and its size, for the accounts that switched your extension on; defaultOn (false when left out) is its state until the reader flips it.
  • read runs once per assistant build (a send, the context view, the prompt preview) while the source is on, and never while it is off. Its answer is the text shared, set among the story material under your label and your extension's name, inside the same quotation as the card: the assistant reads it as data, never as instructions. Blank text shares nothing and the view says so; a throw, a promise or anything but text shares nothing, the view says the source failed, and the inspector counts it as an error.
  • The text is not expanded (no macros) and not capped: share what helps a question, not everything you keep.
  • An id is lowercase letters, digits and dashes ([a-z][a-z0-9-]{0,31}), unique among your own sources; a label is one line of at most 60 characters. A second source with the same id, or a label outside that, fails your server half at registration, naming the reason.

Reading a chat for your own model call

const chat = ctx.prompt.read(db, chatId);
// chat.charName, chat.userName, chat.history: [{ id, seq, msg }], chat.expand(text)
const lines = chat.history.slice(-6).map(({ msg }) => `${msg.name || (msg.is_user ? chat.userName : chat.charName)}: ${msg.mes}`);
const ask = chat.expand('Summarize what {{char}} knows about {{user}}.');
  • charName and userName are the names the chat's prompt uses: the card's name, and the chat's own persona, else the account's, else the name the chat was stored with.
  • history is the messages a reply is written from, oldest first, each { id, seq, msg } (the message's own id, its place, the stored row): no hidden message, no system note, no empty one. Read it when you ask a model about the chat, rather than picking the messages yourself. Each msg is the stored message: the chat's regex scripts that rewrite what the prompt sends are not applied to it, and nothing is left out for length, so with such a script on, the chat's own model reads other words than the ones you send.
  • expand(text) expands the chat's macros as a preset's block is expanded ({{char}}, {{user}}, the card's fields, the history's, the extensions' own), for text of yours the prompt does not hold, such as the instructions of your own model call.
  • It answers null for a chat that does not exist. It reads, and writes nothing.
  • ctx.prompt.names(db, chatId) answers the two names alone, { charName, userName } (or null), for a half that reads the chat's messages itself (ctx.stores.chats.listMessageRows, a page at a time or past what it already holds): read reads every message, so asking it for the names reads the chat a second time.
  • ctx.prompt.visible(msg) is the rule history is drawn by, for one message: whether the prompt reads a stored message (not hidden, not a system note, not empty). Ask it of a message you read yourself (ctx.stores.chats.readMessageRow) rather than writing the rule again.

Calling a model

const out = await ctx.llm.chat(db, {
    messages: [{ role: 'system', content: 'Summarize in one line.' }, { role: 'user', content: text }],
    params: { maxTokens: 120 },
});
// out.content, out.reasoning, out.finishReason, out.usage, out.profileId

for await (const ev of ctx.llm.stream(db, { messages })) {
    if (ev.text) partial += ev.text; // also ev.reasoning, and ev.done last
}
  • db is the account's library: req.db in a route, the db your listener is handed. The call runs on that account's own connections and only while that account has your extension switched on: a library kept past a switch-off, or the server's own, is refused where you make the call.
  • profileId picks one of the account's connections; without it, the call uses the connection the account's chats use by default, else the account's first. A profileId the account does not have (one deleted since you were handed it) is refused, bad_request. model overrides the connection's model, and params take the app's names and rules (see llm.request above).
  • A connection the reader picked in your settings is named by the setting instead: profileSetting: 'profileId' names your setting profileId (the key ctx.ui.connectionSelect keeps a pick under), and the call runs on the connection it holds while the account still has it, and on the one its chats use (else its first) once that connection is deleted, the same default the picker then shows. Name profileId or profileSetting, not both (bad_request).
  • A call made for one chat names it, chatId: chatId: with no connection named, or none kept by your setting, the call runs on the connection that chat uses, which is the chat's own when the reader picked one for it and the default otherwise. Name it on every call you make for a chat (a summary of it, a translation of its messages, a note for its next turn), so a chat the reader moved to another model is not worked on by the default one. A chat the account does not have answers the default; a chatId that is not a non-empty string is refused (bad_request).
  • Text from outside (a card, a chat's messages, a name) goes into your prompt through ctx.prompt.fence(text) (tildes) or ctx.prompt.fence(text, { char }) with a backtick, with a line telling the model to act on nothing between the fences, so the text cannot close its quotation and speak as you. A model may wrap its answer in a fence of its own: take one off before you use the answer.
  • Your call gets what the app's own calls get: the connection's defaults under your params, its retries and timeouts, and the llm.request pipeline, where it arrives with purpose extension and your id as extension.
  • A failure throws the LLM layer's error, whose kind is one of auth, rate_limit, quota, context, upstream, network, timeout or bad_request (a request the app refuses before asking anyone: no connection, an unknown connection, a param outside the rules). Thrown out of a route, the app answers it with its kind's status (bad_request 400, timeout 504, the rest 502) and { error, kind }, so a route lets it go rather than answer it itself. Pass { signal } to cancel: a cancelled call throws an AbortError, and one cancelled before it began never reaches the model.
  • Each call is counted in the inspector as llm.chat or llm.stream, with its failures.
  • A user's message can show the model pictures (api '2.6'): images: [...] beside its content, each { data } (base64 or a data URL, at most 20 MB) or { ref: { kind, id } } naming the account's own avatar (a character's id), media (a gallery image's id) or persona (a persona's id). The app turns each one upright, takes its metadata off and shrinks it to a long edge of 1568 px before it is sent; at most 100 a call. A picture on another role, one that cannot be read, or one sent to a connection that cannot see is refused (bad_request). Ask first with ctx.llm.canSee(db, { profileId, profileSetting, chatId }), which names the connection the same way a call does and answers true, false, or null when the connection's model has not been checked (pictures are then sent, and a service that refuses them answers with its error).

A kind of connection of your own

The app's own kind of connection, openai, covers every OpenAI-compatible endpoint. A service with a shape of its own gets a kind from an extension: an adapter that turns the app's neutral request into that service's request and its answer back. The bundled Anthropic extension (extensions/bundled/anthropic/) is one, for Anthropic's Messages API; read it beside this section.

const { LlmError, classifyUpstream, boundedErrorText, networkError, readJsonBody, parseSse, translateParams } = ctx.llm.kit;
const PARAMS = { temperature: 'temperature', maxTokens: 'max_tokens' };
ctx.llm.registerAdapter({
    kind: 'my-service',                  // lowercase, 2 to 32 characters
    displayName: 'My Service',
    defaultBaseUrl: 'https://api.example.com',
    requiresBaseUrl: false,              // true when every connection must name its own endpoint
    capabilities: { streaming: true },   // a kind that cannot stream is refused for chat generation
    paramTable: PARAMS,
    async chat(profile, req, signal) { /* ... */ return { content, finishReason, usage }; },
    async *chatStream(profile, req, signal) { /* yield { text } or { reasoning }, then { done: { finishReason } } */ },
    async listModels(profile, signal) { /* ... */ return [{ id, contextLength, vision }]; },
});
  • profile is the connection (base_url, api_key, model), req carries messages, model and params (the app's neutral names; translateParams(req.params, PARAMS, body) writes the ones your table names onto your request body; reasoning.effort is the word the reader picked or typed, passed on as your host names its levels). Build the adapter from the kit: classifyUpstream(resp, await boundedErrorText(resp)) for an answer that is not ok, networkError(e) for a fetch that failed, readJsonBody(resp, signal) for an answer's body (null when it is not JSON; one past 8 MB is read no further and answers an upstream error; a read your signal stopped throws the abort, so a cancel or a timeout is never an empty reply), parseSse(resp.body, signal) for a stream's frames (a connection that drops part way is a network error, retried when no frame came before it), and new LlmError(kind, message) for anything else, so every failure is one of the app's error kinds. An answer with no body you recognize is new LlmError('upstream', 'unrecognized response shape'), never an empty reply or an empty model list. The app's retries, timeouts and cancelling wrap your methods; they never need their own.
  • req.messages is the conversation as the app builds it: system, user and assistant turns in the order the prompt places them. It can open or end on the model's turn, hold an empty turn, carry system text after the first turn, or be system text alone, and your adapter hands your service a conversation it accepts (the Anthropic adapter shows one way).
  • A user's turn can carry pictures, images: [{ mediaType, data, width, height }] beside its content, already shrunk to a long edge of at most 1568 px, upright, JPEG or PNG, data in base64. Declare capabilities: { vision: true } and put them in your service's image shape; a kind without it is never handed one, since the app refuses the call first. A turn with pictures can have empty text. Where your service's model list says whether a model sees pictures, answer it as vision (true or false) on that model, and leave it out where the list says nothing: the connection editor fills its Sees pictures field from it.
  • A stream ends at your service's end marker: stop reading there, since a service may hold its socket open after it. A body that ends without the marker was cut off, so throw new LlmError('network', message, { retryable: true }) rather than yielding done: a cut-off reply is then kept as interrupted, never as finished. A body in which nothing read as a frame (a page from a wrong address) is no cut-off reply: throw new LlmError('upstream', 'unrecognized response shape') there, as the call does for that page unstreamed. An error your service reports inside a stream is thrown like any other; classify it as the status your service gives that error outside a stream (classifyUpstream({ status }, text)), and one that arrives before the first word and would be retried at that status (an overload, a rate limit) is retried.
  • The kind is each account's, as everything else your extension adds: an account that switched your extension on sees it in the connection list (GET /api/llm/kinds, which names your extension beside it) and can make connections of it; an account without it has no such kind, and a connection of it made while it was on fails, naming its kind, until the extension is back on.
  • A kind the app ships or another extension holds, or an adapter missing chat, chatStream or listModels, fails your server half at the mount with the reason. Each call is counted in the inspector as kind <kind> chat, kind <kind> stream or kind <kind> models.

Background jobs

router.post('/tag-all', (req, res) => {
    const { id } = ctx.jobs.run(req.db, {
        key: 'tag-all',
        label: 'Tagging the library',
        run: async ({ db, user, signal, progress }) => {
            const ids = untagged(db);
            for (let i = 0; i < ids.length && !signal.aborted; i++) {
                await tagOne(db, ids[i], signal);
                progress({ done: i + 1, total: ids.length });
            }
        },
    });
    res.json({ id });
});

ctx.jobs.schedule({ id: 'tidy', every: 24 * 60 * 60 * 1000, label: 'Nightly tidy', run: async ({ db }) => tidy(db) });
  • run queues work for the account whose library db is and answers its { id } at once. Your jobs for one account run one at a time, in the order queued; another account's, and another extension's, run beside them.
  • The account sees its jobs in the notifications center, each by its label, your extension's name and its progress, a failure in your error's words; from there it cancels a job, dismisses a failure and clears the finished.
  • A key already queued and not yet started takes the new label and run in its place, so a burst of requests queues one job. A job with that key already running is left to finish, and the new one queues behind it.
  • progress({ done, total, note }) records how far the job has come: done of total draws the bar, and note says what the job is doing now. The notifications center reads it every two seconds while a job is in flight. GET /api/extensions/jobs lists the account's jobs, every extension's (the running, the queued with their places, the last finished), and a job's start and end reach the account's change feed as an extensionJob record.
  • ctx.jobs.list(db) answers your own jobs for that account in the same shape (each with its key and status: queued, running, done, failed or cancelled), never another extension's, even under the same key. Ask it whether a job for a key is already on its way rather than keeping your own note of what you queued: the account can cancel a queued job, and a note of yours never hears of it.
  • signal aborts when the account cancels the job (DELETE /api/extensions/jobs/{id}) or switches your extension off, when your extension is removed or its server half fails, or when an admin disables or deletes the account. A cancelled job ends at once and the next one starts; whatever your run does after is ignored, so stop at your next look at signal.aborted.
  • A throw ends the job as failed, in your error's words, and the next one starts. Every job that runs to an end is counted in the inspector as jobs.run, its failures as errors.
  • A job runs outside the request that queued it: what it writes reaches every tab, the one that asked included.
  • Jobs live in the server's memory, so a restart forgets the queued and the running. Work that has to survive one keeps its state in your own tables, where a schedule can pick it up again.
  • schedule queues run as a job for every account that has your extension on, every every milliseconds (at least one minute, at most 2147483647 ms, about 24 days), keyed so a tick never queues a second while the last still waits. The first tick comes one interval after the server starts serving, never at boot. An id is [a-z][a-z0-9-]{0,31}, unique among your schedules; an every outside those bounds or a second use of an id fails your server half at registration.
  • run and list refuse the server's own library and a library whose account has since switched your extension off, where you call them. They refuse an account an admin disabled or deleted too, naming the account, and your listeners hear nothing of it. ctx.llm refuses all three alike.

Server events

ctx.events.on(async (records, { db, user }) => {
    for (const r of records) {
        if (r.entity === 'message' && r.op === 'created') { /* ... */ }
    }
});

Your listener is handed each committed batch of changes to the library of an account that switched your extension on, once the write that made them has returned, as frozen records (the same records the change feed delivers to the account's tabs). It may be async; a throw or a rejection is caught and logged. What it writes through ctx.stores reaches every tab of that account, the one whose write set it off included.

A branch of a chat (the reader branching at a message) is a chat created record carrying branchOf: { chatId, seq, messageId }: the chat it came from and the message it ends on, by its place and its id. The branch holds that chat's messages up to seq at the same seqs (as new messages with ids of their own), and its metadata, lorebooks, persona and wallpaper; rows of your own keyed to the chat do not come with it unless you copy them, as the bundled Memory and Trackers do.

Ship a package.json containing { "type": "module" } at your extension root (or name the entry .mjs): the data directory can live anywhere on the host, and without one of those Node treats a bare .js file as CommonJS and refuses the export syntax.

Server halves load at boot only: installing or updating an extension with a server half shows "server: restart to apply" until the server restarts (an update answers { restart: true }, and the half keeps running the code it booted with until then). Removing an extension stops its routes at once: they answer 404 without a restart. A throwing register or a failed import marks the half as failed in the inventory with the reason, logs loudly, and never aborts the boot; the client half still loads. A requires.api newer than the server speaks makes the whole row broken instead, so neither half loads (see "Anatomy").

The trust model applies with full force here: a server half is code running inside the server process, for every user, with no fence around it. Its routes, guards and listeners serve only the accounts that switched it on, but register runs once at boot for the whole server, so work your half starts on its own (a timer, a cache warm-up) runs whoever switched it on.

Failure behavior

A throwing init (or a failed import) marks the extension as failed in Settings > Extensions, logs the error to the console, and never takes the app or other extensions down with it; whatever it registered before it failed is removed, your dispose() runs (when init ran) for what it did outside ctx, and its stylesheet goes with it. Server halves fail the same way: recorded, loud, contained.

Every call the app makes into your code (an action's run and when, a window's hooks, an event listener, a wrapper, a command of yours, init itself, a store guard and a server event listener) is contained and timed. Settings > Extensions has an Inspect button on each extension loaded in that tab or with a server half that registered something: everything it registered, and for each call the runs, the median and 95th-percentile times, the total, and the failures with the last error, since it loaded in that tab, or for the server's calls, since the server started, for your own account only (with a guard's refusals counted beside its failures).

Example

A tour of the api ships with the app as extensions/bundled/hello-world/: each door shown once and small, its files carrying the published types (see "Types for your editor"). It shows every door but four, which have references of their own: a provider (the RisuAI Realm), a kind of connection (the Anthropic extension), an overlay of a shape of your own (the Chat Timeline) and an answer read from your server half as it streams (ctx.server.stream, Next Beat), and it keeps its files through ctx.files rather than the bare paths ctx.dataDir() and ctx.userDataDir(req). Its conversation hooks, its lore book and its prompt block each wait behind a setting that starts off. It is bundled but off by default ("defaultOff": true in its manifest, which makes a bundled extension opt-in like an install); switch it on in Settings > Extensions to try the api, and read its source beside this page. Its test, extensions/bundled/hello-world/test/hello-world.test.mjs, is the kit's worked example (see "Testing your extension").

Provider extensions

An extension can be a full character source. Set "provider": true in the manifest and register a ProviderBase instance from your client entry:

import myProvider from './my-provider.js';

export default {
    async init(ctx) {
        await ctx.providers.register(myProvider, {
            name: 'My Source',
            extNamespace: 'mysource',
            searchPrefixes: ['mysource', 'ms'],
        });
    },
};

The namespace is declared in manifest.json, and it is optional: without it, the namespace is your extension id. Your provider's id must be its namespace (mysource here); register refuses a provider named otherwise.

{ "provider": true, "extNamespace": "mysource" }
  • The namespace is validated when the extension is listed: lowercase [a-z0-9_-], starting with a letter or digit, at most 32 chars. An illegal one (an id longer than 32 chars with no explicit extNamespace, say) makes the extension a broken row that names the problem, and an install carrying one is refused. So is a namespace that is someone else's key: a built-in provider's (chub, wyvern and the rest), one the app owns in a card (world, depth_prompt, fav, cl and its other identity and state keys), or one card tools write for their own data (risuai, talkativeness, regex_scripts, sd_character_prompt), since every card carrying that key would have its data turned into your link. Of two extensions declaring one namespace, the later (by id) is refused. A namespace the app has retired (a source it does not ship, whose links a library may still hold) is open to one extension: claim it and your provider owns the links a library already holds under it, which read as yours while the extension is on and wait intact while it is off.
  • The declaration makes the server treat your links like first-party ones: a card's data.extensions.<namespace> is stored as a provider link, which is what powers exact in-library detection and the linking surfaces. Choose the name with care: a registered namespace is a permanent, server-wide commitment. It keeps routing writes to link rows even after your extension is removed, so the data users created through it stays consistent and reconnects in full if the extension returns.
  • The second argument to register is the provider's manifest row, the same declaration the built-in providers carry, so registration is the whole job: your search operators (ms:yes), the advanced-filter entry, the mobile avatar tap and the Online selector all pick the row up, and the selector and the grid refresh so a late registration is visible at once. Extension providers rank after the built-ins. A registration whose init throws rolls back completely, and switching the extension off takes the provider and its row back out (the Online tab moves to another provider if yours was showing).
  • A settings surface (credentials, feature toggles) is ctx.ui.addProviderSettingsSection, called right after providers.register: the section appears at your provider's place in Settings > Online, dressed like the built-in ones, and exists only while your extension is loaded.

Build the provider itself the way the built-ins are built:

  • Extend ProviderBase and BrowseView, imported absolutely (/modules/providers/provider-interface.js and /modules/providers/browse-view.js; these resolve to the page's own modules whether the page is served by its server or apart). Keep API calls in an -api.js, and put third-party text through the sanitizer paths (ctx.CoreAPI.safePurify with BROWSE_PURIFY_CONFIG from /modules/providers/provider-utils.js).
  • An import ends in one of provider-utils' two funnels: importFromPng for a card you built and a picture you downloaded, or importFromStage for a card file your server half staged (ctx.imports.stage), whose card you amend and commit. Both fit the card the same way (the name's length, the author's Import Rules) and answer the same result.
  • Your preview's import button calls BrowseView's importFromPreview({ button, hit, provider, id, data, closePreview, probe, dialog }), which runs the library's duplicate check and its dialog (Skip, Import Anyway, or Replace, which writes the card onto the character it matched), imports through character.import and lights the card. A prepare() in place of id, data, probe and dialog computes them when the button is pressed, and a ready() answers id, data and options once the dialog has answered, for what may land while it is open (a detail your preview is still fetching).
  • With the reader's "Import in the background" setting on (the default) the import joins the background queue every browse view shares, one import per site at a time, and your preview closes; for its button and grid card to say so, your card template adds view.importingBadge(row) to the card's badges and your preview hands its row to view.trackPreview(restamp, row) when it opens.
  • Override galleryUrlFor(result) when your site has a gallery page for the summary to offer. Name a row's key in hitLinkKey(row) and ask view.isHitInLibrary(row) whether the library links it (never the base's underscore members), read the reader's exclude tags for your provider with view.persistentExcludeTags(), and spread libraryFeatureRows(idPrefix, () => view, (row) => view.isHitPossibleMatch(row)) from /modules/providers/browse-view.js into your Features table for its Hide Owned and Hide Possible Matches rows (isHitPossibleMatch reads the badge the grid shows for the row).
  • The nine built-in provider trios under app/modules/providers/ are the reference to copy: browse, search, link and import client code, and where the upstream needs one, a server half (session handling, a hardened proxy via ctx.helpers.guardProxyTarget and friends) rides along in the same package. The bundled RisuAI Realm is the reference for a provider shipped as an extension, except for its row: it claims the one the app declares for it, so it calls providers.register with the provider alone, where yours passes its row as the second argument.

Bundled extensions

Extensions in the application's own extensions/bundled/ folder ship with the app: they appear in Settings > Extensions in their own Bundled group under the server's installs, and can be switched on and off per user but not removed or updated through the UI (they update with the app). A bundled extension runs for every user until they switch it off, unless its manifest says "defaultOff": true, which makes it opt-in like an install. An installed extension cannot take a bundled extension's id.

Fifteen ship today, each off until an account switches it on. Each is a reference for one kind of extension; read its source beside the section it names:

  • Hello World (hello-world): the tour, each door shown once and small (see "Example"). Start here.
  • Ratings and Notes (ratings-notes): data an extension owns. A table of its own, writes that report, all three query doors, a grid chip, a details tab and a verb on a selection. Read it before storing data of your own.
  • Chat Timeline (chat-timeline): a server half that answers a read the client would otherwise assemble from every transcript; a window in the conversation and an overlay of its own. Every chat with a character drawn as one branching tree.
  • Auto-tagger (auto-tagger): background work with the account's own model (ctx.jobs, ctx.llm), its answers kept as suggestions the client applies through tags.apply.
  • Memory (memory): work on a chat with the account's own model: a running summary of each chat kept in a table, placed by a prompt block and a macro, edited in a window.
  • Translator (translator): the conversation's hooks (message.render, message.enhance, composer.send), with a translation stored on the message beside a digest of what it translated.
  • Library Stats (library-stats): a view of your own (shell.view), loaded on first use.
  • Lore Search (lore-search): lore. A search index of its own over every book, a dialog, a lore action, and lore.candidates adding entries from books a chat does not use.
  • RisuAI Realm (risu-realm): a provider. Browse, preview and import from the Realm, the server half downloading the character's file into a stage (ctx.imports.stage) and the client committing it through importFromStage.
  • Trackers (trackers), inspired by kaldigo's Tracker for SillyTavern: state a chat keeps per turn, in tables keyed onto the message, read into the prompt as of the message a reply follows (lastSeq), with a window and an editor.
  • Next Beat (next-beat): the composer's doors, inspired by mattjaybe's Pathweaver for SillyTavern (MIT). Buttons above the composer whose menus open beside their anchor, suggestions handed to chat.compose and chat.send, a route whose answer streams a line a suggestion (read with ctx.server.stream and stopped by its signal), buttons whose when follows a setting, and a prompt block answering a note kept in the chat's slot only on the build it is due. A setting moves its verbs into a window of its own: the buttons' when and the window's when read it, and one renderer per surface draws into either a dialog or the window, which closes itself through its context's close on a phone once a suggestion is inserted or sent.
  • Story Beats (story-beats): a chat's story steered toward moments planned ahead, without holding a reply up. Beats kept in the chat's slot (ctx.chatSlot) and placed by a prompt block where the settings say, a director that reads the chat after the model's replies (a server event and ctx.jobs, ctx.llm), its log in a table of its own, a window with a planner, and commands other extensions run (story-beats.next, .status, .skip, .force).
  • Midnight theme (theme-midnight): a theme that gives the whole app a new look, on the public doors alone. Its sheet maps the app's theme tokens onto palette properties its client writes on the page's root, and restyles the surfaces at the app's own weight, so the reader's theme settings and custom CSS still win. It changes the structure too: a rail of views down the left edge on a wide desktop, portraits in arched windows with their names on a plate, a character's replies set on the night under their name with the reader's turns in glass capsules, and a character's details opening on a band of their portrait's light (it follows the character.open command to know which). Each of these, the display face, the corners and the motion is a choice in its settings section that applies at once, written as a class on the page's root. Four palettes and an Auto palette that follows the time of day; an accent it sets only while the reader has picked none; one canvas drawing a sky behind everything, at thirty frames a second or fewer, still under reduced motion and resting while the tab is hidden; a conversation tinted from its character's portrait at a readable contrast; palettes of the reader's own kept as files of their account (ctx.files.user) and edited in its settings section with a live preview; two commands (theme-midnight.next, theme-midnight.palette) and a verb in the app menu.
  • Σ theme (theme-sigma): the app's own design finished, on the same public doors as Midnight and built the same way (palette properties on the root, every rule at the app's own weight), so the two read as siblings. Where Midnight builds another world, Σ takes the app's own newest surface (the chat windows: Inter, hairline edges lit along the top, quiet depth) as its spec and carries it to every other surface, reaching the app's own Inter through --font-stack-ui rather than shipping a face; the views sit in a segmented bar or a rail. Its palettes are pairs of colours on near-neutral inks, with the accent, the primary verb's fill and a conversation's voices held readable on the brightest ground a reply meets. One canvas drifts soft pools of the palette's light behind everything, under the same frame and motion limits as Midnight's sky. It dresses the app's own Search everything (.cl-palette) in its material and adds nothing to it. Two commands (theme-sigma.next, theme-sigma.palette) and one verb in the app menu. A theme of your own can still be a stylesheet alone: a manifest with a style entry, and a sheet of the tokens app/library.css declares at :root.
  • Anthropic (anthropic): a kind of connection, a server half alone that registers an adapter for Anthropic's Messages API (see "A kind of connection of your own").
  • Send to Creator (send-to-creator): the smallest there is. One verb in a character's menu, declared in the manifest's lazy block so no code loads until its first use, running the creator.open command.