✦ Kiori

Self-hosting

Kiori is one Node.js process and one SQLite file. No other services, no dependencies to install.

Requirements

Configuration (.env in the project folder)

The older PSYCHE_* names are still read, so an existing .env keeps working.

VariableDefault
KIORI_LLM_KEY—model provider key
KIORI_LLM_BASE_URLhttps://openrouter.ai/api/v1any OpenAI-compatible endpoint
KIORI_ORGANIZER_MODELanthropic/claude-haiku-5.5writes brains (build, scenes, learning)
KIORI_AUDITOR_MODELanthropic/claude-haiku-5.5checks (drafts, sleep)
KIORI_FALLBACK_MODELdeepseek/deepseek-v4.1-flashlast attempt when the main model refuses or answers badly
KIORI_PROVIDER_SORTthroughputon OpenRouter, pick the fastest provider of a model (price, latency, or empty)
KIORI_EMBED_MODELopenai/text-embedding-3-smallrecall by meaning; KIORI_EMBED=0 turns it off
KIORI_PLAYGROUND_MODELz-ai/glm-5.3the console's playground only
KIORI_LEARN_EVERY20events waiting before learning starts by itself
KIORI_LEARN_HOLD4newest events that learning on its own leaves for later (they're still being rerolled or edited)
PORT7700
KIORI_HOST127.0.0.1the address to listen on; 0.0.0.0 in a container or behind a reverse proxy on another machine
KIORI_PUBLIC_URL(this machine)where customers reach this Kiori, e.g. https://api.kiori.io: sign-in links point here
KIORI_SECRET(a random key in data/local/secret.key)seals customers' provider keys in the database; keep it with your backups, a database without it can't open them
KIORI_PROXY_ALLOW_LOCAL01 lets the drop-in chat endpoint pass requests on to a model on this machine or the local network (otherwise only https addresses on the internet)
KIORI_DATAdata/localwhere the database (kiori.db, or psyche.db on installs from before the rename) and admin.key live

Commands

node bin/kiori.mjs serve                          # API + console + docs (bin/psyche.mjs still works too)
node bin/kiori.mjs project create "Studio"        # a project and its first key (shown once)
node bin/kiori.mjs key create --project prj_...   # another key
node bin/kiori.mjs import ./vault --project prj_... # import a markdown brain vault (character or world)
node bin/kiori.mjs embed --project prj_...        # fingerprint imported memories
npm test                                           # unit tests (no model calls)

Data and backups

Everything is in data/local/kiori.db (psyche.db on installs from before the rename) (SQLite, WAL mode). Back it up like any SQLite file. Events are the source of truth: a story's learning can always be rebuilt from them.

What it costs to run

Measured on the default models (Claude Haiku 5.5 through OpenRouter):

OperationWhenMeasured costTime
Build a characteronce~$0.012~1.5 min (background)
Place people in scenesper ~60 events sent without present~$0.002seconds
Learnper character, per stretch of events they were in~$0.0015seconds
Context (recall)every turnone embedding, ~$0.00001milliseconds
Check a draftoptional, per reply~$0.0006–0.002a few seconds
Sleepoccasionally~$0.001seconds

A 100-event story with three characters costs about $0.04 in learning; checking every reply adds about $0.05. Building a cast of ten characters costs about $0.12.

Limits of v1