Repository navigation
Oshi Engine 0.14.0
This release finishes milestone 0.14, Contact list. She now keeps one list of everyone she knows: each user, and the people of her own life who have no account. Each person has her notes about them, the relationship, a home, a birthday and the plans she has with them. She can look someone up in a chat, and what she tells depends on who is asking.
- One
contactstable holds everyone. A user's contact has the user's id. The relationship numbers (affection, trust, familiarity, irritation, priority bias) and her notes about a user moved into the contact, so each lives in one place. A contact also holds other names, who the person is to her, how she met them, a home and a birthday, and people with no account get contacts of their own. look_up_persongives her a card about someone. The owner in a private chat, the person themselves and whoever told her about someone get the whole card. Everyone else gets what she would say about a friend: the name, who they are to her, how she knows them and the plans with them, never her notes, the relationship, memories or a user's apps and home. People she heard about in one user's chats do not exist for anyone else, and in a group chat nobody gets more than the short card.- After a private conversation, a second background call (
people_extract.md, on the background model) lists the people named in it. The engine drops names that are not in the messages, and one conversation adds at most 3 new contacts. People a user names are recorded as learned from that user. Group chats add nobody. - Memories are tied to people by name, in the engine and without a model call: a memory is tied when every word of a contact's name or other name appears in it. The links are kept in
contact_memories, so deleting a contact leaves the memory alone. - Deleting a user now offers a choice. The default still deletes their contact, and the people she heard of only from them.
keep_contactkeeps them as someone she knows who is no longer a user, with notes, numbers, home and plans; chats, memories and opinions still go. - Activities and places point at contacts.
withinstart_activitymatches contact names and other names. Place files and API bodies that useuserstill load, and/v1/placesstill returnsuseron a user's home. send_messagehas an optionalto. When the model names someone else, she is told she cannot write to them from there.- The settings UI has a Contacts view next to Users, with search, filters and a card per person showing notes, home, apps, plans together and tied memories. Relationship numbers are bars for users and sliders for her own people. The trash button on a user asks whether to delete everything or keep the contact, and Places picks whose home a place is from the contacts.
- API:
GETandPOST /v1/contacts,GET /v1/contacts/lookup,GET,PATCHandDELETE /v1/contacts/{id},GETandPUT /v1/contacts/{id}/notes,GETandPOST /v1/contacts/{id}/memories,DELETE /v1/contacts/{id}/memories/{memory}, andcontact_changedevents. Reading needsusers:read, plusmemory:readfor notes, memories and the look-up. Changing a contact needsusers:write, and its notes alsomemory:write; tying or untying a memory needsmemory:write.DELETE /v1/users/{id}takes?keep_contact=true./v1/users/{id}/relationshipand/v1/users/{id}/profilestill work and read and write the contact, so 0.13 settings UIs and CLIs keep working. CLI:oshi contact list|show|add|notes|lookup|removeandoshi user remove --keep-contact.
Modules in this release
| Module | Version | Needs core | Builds |
|---|---|---|---|
| telegram | 0.2.4 | 0.2.0 or newer | x86_64, aarch64 |
| settings | 0.14.0 | 0.14.0 or newer | any |
| webchat | 0.10.0 | 0.10.0 or newer | any |
| webchat-themes | 0.5.0 | 0.5.0 or newer | any |
| webchat-stickers | 0.5.0 | 0.5.0 or newer | any |
| webchat-attachments | 0.5.0 | 0.5.0 or newer | any |
| novel | 0.11.0 | 0.10.0 or newer | any |
| browser | 0.7.2 | 0.3.0 or newer | x86_64, aarch64 |
settings is the only new version. telegram, webchat, novel, browser and the three webchat extensions are unchanged; the store keeps the artifacts of the release that first shipped them.
Settings 0.14.0 needs core 0.14.0. The Contacts view reads /v1/contacts, which an older core answers with 404, and its text comes from the engine. On core 0.13.0, Places would also drop whose home a place is on the next save, since it sends contact and the older core only knows user, and keeping the contact when deleting a user would delete it anyway. Settings 0.13.0 keeps working on core 0.14.0 until it updates. The unchanged modules do not use the routes or fields that moved.
Upgrading
Run oshi update apply, or in Docker pull the new image. With modules.auto_update on (the default), the next module check installs settings 0.14.0. It waits for core 0.14.0: on an older core the store lists it as "needs core 0.14.0" and settings stays on 0.13.0. No settings or env names were added.
The first start of 0.14.0 migrates the database (step 8), in one transaction. It creates contacts with one contact per user, holding the user's name and the numbers from relationships (a user without a row gets the defaults, as before). It copies the people of each activity from activity_people into activity_contacts, adds an empty contact_memories table, and then drops relationships and activity_people. If a statement fails, the start fails and the database stays as it was.
On the same start the engine moves her notes about each user into their contact: memory/users/<id>.md becomes the notes and memory/users/<id>.md.prev the previous version. Both files are then moved to memory/users/migrated/, so they are kept and a later start does not import them again. A file whose user no longer exists stays where it is, and so does a file that cannot be moved, with a warning in the log.
Every core update (oshi update apply, the settings UI, the automatic check, or a new Docker image) takes a backup before 0.14.0 starts. It holds a copy of the database from before the migration, oshi.toml, character/, memory/, prompts/ and module state. If 0.14.0 does not report healthy within updates.health_timeout_secs, or exits, the launcher restores that backup and starts 0.13.0 again. The database is then the one from before step 8, and the notes files are back in memory/users/. Swapping the binary by hand takes no backup, so copy the data directory first if you update that way.
To go back to 0.13.0 by hand later, putting back the old binary is not enough: 0.13.0 reads the relationships and activity_people tables, which the migration dropped. Find the backup with oshi update backups while the engine runs, then stop the engine and run oshi update restore <home>/backups/<time>-pre-update-v0.13.0. That restores the 0.13.0 binary, the database from before the migration and the whole memory/ directory. Backups include memory/, so the notes files are back in memory/users/ and nothing needs moving by hand. Settings goes back to 0.13.0 with its restored state, since a module keeps its previous version on disk (unless settings has updated again since). In Docker, also go back to the 0.13.0 image, because the launcher runs the newer of the image's binary and /data/bin/oshi.
Restoring loses everything that happened after the update: messages, memories, contacts and notes. Old backups are pruned to updates.keep_backups (3 by default), so copy this one elsewhere if you want to keep the way back open. If you restore a database copy of your own instead, also move the files in memory/users/migrated/ back to memory/users/.
If you keep your own templates in prompts/engine/: people_extract.md is new, and core.md changed in one line. Its Tools paragraph now lists "look up someone you know" among her tools. A core.md in prompts/engine/ replaces the built-in one whole, so add those words to yours; the tool is offered either way, but without them the prompt does not point her at it. No other template or model profile changed.
Coming from 0.9.0 or earlier, the compose service rename described in the 0.10.0 notes still applies.
Downloads
oshi-x86_64-linux.tar.gzandoshi-aarch64-linux.tar.gzcontain theoshibinary. They need glibc 2.34 or newer.- The module tarballs are named
<id>-<version>-<target>.tar.gz. The telegram, webchat, novel, browser and webchat extension tarballs are rebuilds of unchanged versions. - Each tarball has a
.sha256file, andSHA256SUMScovers all of them.store.jsonholds the store index entries for the modules in this release.
The Docker image is ghcr.io/oshiengine/oshi-engine:0.14.0 (also 0.14, beta, stable and latest) for amd64 and arm64.
Getting started
tar -xzf oshi-x86_64-linux.tar.gz
./oshi init
./oshi serve
With the engine running, ./oshi module install settings and ./oshi module install webchat add the settings and the chat. Open http://127.0.0.1:7420/settings and create the owner login with the setup code from oshi init. Before talking to her, set llm.providers.local.base_url and llm.chat.model in oshi.toml (or the env file) to an OpenAI-compatible server.
With Docker, docker-compose.yml starts the engine with the web chat and its extensions, novel mode and the settings; the setup code is in the log (docker compose logs oshi-engine). docker-compose-full.yml adds every module, SearXNG and the headless Chrome, with SEARXNG_SECRET set in .env.
All changes: v0.13.0...v0.14.0