Cr. — Claudette Raynor

Case study · 2026

Oread Stories

An AI story engine where every character has its own memory, mood, and personality that changes because of what you go through together.

View on Github (opens in a new tab) github.com

Role
Design, front end, back end, security
Platform
Web app, installable as a PWA; runs locally or hosted, invite-only
Models
Claude, OpenAI, Gemini, AWS Bedrock, Featherless

The story engine

The story engine lets you steer the story in real time by adjusting personality and mood mid-scene or rewriting the system prompt and watching the token cost and dynamics update as you write.

Story settings

Story settings hold the shape of the story itself such as plot, theme, conflict, rules, point of view, and opening scene. You can also choose a reply style, either short spoken conversation or full narrated prose.

World Settings

World settings let you define places, geography, customs, and history. As the story plays out, Oread keeps a record of lasting facts about places and things across the whole world.

Character Settings

You shape each character through personality, prompt, backstory, abilities and skills. Skills work like a tabletop RPG: they improve as the character uses them, so a character grows through what they actually do in the story. You can also see and edit everything each character remembers, so the story's memory stays in your hands.

The problem

Characters that remember, change, and live their own story

Most AI roleplay apps are a chatbot in a costume. The character has a description and nothing else. It has no mood that carries over, no history that is it’s own, and no reason to act differently tomorrow than it did today. They “remember” by rereading the whole conversation every turn, which gets slower and more expensive as the story grows until the beginning quietly falls off the end.

I wanted characters that work more like people. In Greek myth an oread is a mountain nymph, a spirit shaped by the place she lives and everything that happens there. That’s the idea with Oreads, that an Oread has a temper, a mood, things it’s good at, a memory of its own, and it changes because of what you go through together. You play one part in the story. The Oreads play everyone else.

A memory that belongs to the character

This is the heart of Oread, and in Oread, nothing depends on the full transcript, so a story can run as long as you want. Each turn is built from four things.

Right now

Where everyone is, what’s within reach, and what just happened which is refreshed every turn.

The last few minutes

The most recent messages, word for word.

How the world stands

Lasting facts stored in world memory from each turn.

What each character remembers

What happened and what it meant to them.

The world knows the window is broken. Only the characters remember who broke it and they might not agree.

Everyone remembers it their own way

Each character writes its own memories in its own words. In the same tavern scene, one remembers sending a stranger over, another remembers a stranger who bought his ale without being asked, and a third missed it entirely. Big moments are remembered by everyone who was there and small things nobody cared about fade.

Identity and unfinished business

Every Oread carries a sense of who it is, who it wants to be, and who it used to be, plus what it’s in the middle of such as what it’s doing, who it’s waiting on, what it has decided, but not done yet. That is what keeps a plot moving between sessions.

Recall by meaning

A small embedding model (all-MiniLM-L6-v2 via transformers.js) runs on the server and finds memories by meaning, not keywords, so “the night of the fire” brings back “the barn burned down.” Places and objects trigger memories too. Walk back into the old house and the old house comes back.

Open and editable

Every memory shows where it came from, and the person can fix, remove, or add anything.

The story engine

Personality you can shape

Oread contains a custom story engine where each character starts from a personality model grounded in personality psychology. Nine trait sliders cover things like how warm a character is with people, how driven, how honest and how secure they feel in relationships. Above them sit two larger dials that govern the rest and control how steady the character is and how open they are to change. Nudge any slider and you’ll hear the difference in the very next reply.

Appraisal without an AI call

Every message is read for emotional weight by a local GoEmotions classifier. The engine itself is pure functions, tuned from a static config:

  • Mood shifts with each scene and sensitive characters take things harder than steady ones.
  • Stress builds over a run of tense scenes and eases with calm ones.
  • Repeated experiences slowly drift personality. Kindness warms someone for good, repeated letdowns make them guarded, and strong personalities resist.
  • Skills improve with use, like a tabletop dice roll.

No extra round trip

While writing each reply, the model also writes hidden notes, memories, world updates, inventory changes, and skill checks. A streaming filter strips the notes out so the reader only sees the story, and parsers that never throw on bad model output apply the rest. “What changed” under any reply shows exactly what moved and regenerating a reply undoes it.

Learning to work across models

Oread runs on Claude, OpenAI and any OpenAI-compatible service, Gemini, AWS Bedrock, and Featherless for open-weight models from Hugging Face. During testing, each model family broke in its own way and most of the engineering time went there. Below are few things that were done to help resolve working across models.

Open-weight models ran past their turn.

Chat-template models played the user’s part and sometimes echoed the hidden scene note. Requests now send common end-of-turn markers as stop sequences and the stream is cut at the first one that slips through.

Roleplay models wrote beautifully, but skipped the notes.

This meant that nothing was remembered and scenes never moved. For those models, a separate memory model writes the turn’s notes first, then the roleplay model writes only the reply, already reading the new memories. The memory model is picked from the person’s catalogue and swapped out if it keeps failing.

Small models lose the thread.

Models under a size and context floor are filtered out and the real size is checked before every reply, so a hand-typed ID can’t slip past.

Sloppy output is still useful.

Memory notes written slightly off-format are kept instead of dropped.

Characters kept parenting the user.

Telling them to eat or sleep, winding the evening down, ending every reply with a question. The conduct rules now forbid that, and the real-world time is framed as background, never as a reason to stop.

Security and hosting

Oread runs locally with no account, everything stored on your own machine, or as a hosted, invite-only site.

Per-user encryption at rest

Every story, chat, setting, provider key and memory vector is sealed with a per-user data key (AES-256-GCM, bound to the row it belongs to). Titles aren’t stored in the clear either. The data key is never stored in the open. It is always wrapped, once by a key derived from the password with scrypt, once by a recovery code shown a single time, and once per session by a key that lives only in that browser’s HttpOnly cookie. Neither the database nor the server’s own secret can open anything on its own.

Prompt-injection guards

The reserved markers the engine relies on (hidden-note tags, reply header, scene note) are neutralized in all story text, memories and messages before they reach the model and the system prompt states the trust boundary.

SSRF protection

Because people can point Oread at any OpenAI-compatible URL, private-address checks are built on net.BlockList (closing IPv4-mapped, NAT64, 6to4 and Teredo bypasses), redirects are refused, and addresses are checked again at connect time to stop DNS rebinding.

The rest

Strict security headers and CSP, per-user rate limits, invite-only sign-up, and an installable PWA whose service worker never caches anything from the API.

Design

I wanted it to feel a little like a quest with the warmth of parchment. It works like a chat, but builds and reads like a story. Replies stream with the first line held in view instead of racing to the bottom. The engine’s workings stay out of the conversation until you open them and the Story, Memory, and Scene tabs sit beside the chat for whenever you’re curious or need to make a quick adjustment. You can test and watch your characters evolve in real time via the story engine panel. There are light and dark themes, seven accent colors, and a layout that works just as well on a phone. Nineteen ready-made stories, from a murder at a manor cut off by a storm to a fae court to a crew alone in deep space, mean nobody has to start at a blank page..

Stack

Client

  • React 19
  • Zustand
  • styled-components
  • Vite
  • Vitest and React Testing Library

Atomic design, with every component built on a small set of React Native–style primitives and browser APIs behind a platform layer, so a native build only swaps two folders. Installable as a PWA.

Server

  • Node, no framework
  • PostgreSQL and Prisma (hosted mode)
  • Better Auth
  • transformers.js running local ONNX models
  • node:test

Layered routes, services, pure story and personality logic, and storage. Deployed on Render.

How Oread evolved

Oread is the project I keep coming back to. It has always been a space for character chat, roleplay, and writing inspiration and each version taught me what the next one needed.

Companion app (Python)

It started as a single companion character to talk to.

Memory experiment

A dedicated repo for working out how a character should remember which became the foundation of everything after.

World and character chat, then a CLI

Multiple characters and a world for them to live in plus a command-line version for working on the engine without a UI.

Oread Studio

A writing app using characters as a source of story and writing inspiration.

Oread Stories

Back to a story engine and companion chat, rebuilt from scratch with everything the earlier versions taught me and per-character memory, a real personality model, multi-provider support, and a codebase clean enough to grow.

What I learned

Ultimately, Oread is one big experiment in steering personality and identity in AI. It taught me how different models behave and how to shape them through prompting. The hardest part wasn’t the code, but making characters feel alive. Most of my fixes were about behavior like having characters ending every reply with a question, mothering the user, forgetting what they’d just done. You only find those by actually playing the stories. Oread is always a work in progress, and it may never be finished, because I keep adding to it as I learn. I built it mostly for fun and learning and I keep it public, so that anyone curious can read it, run it, or contribute to it. Below are some of my important takeaways from this project.

Models are not interchangeable.

A prompt that works perfectly on one provider falls apart on another. Build for that from the start and treat every model’s output as untrusted and possibly malformed. There are also always new models, so I am always having to adjust.

Don’t make the model do what a small local model can.

Emotion appraisal and memory search run locally, for free, and are far more predictable.

Working with every kind of model

Oread started fully private with local models run through Ollama and Python, then transformers.js made it possible to run small models directly in Node, and hosted APIs got good enough for roleplay. Moving from Python and Ollama, to a CLI, then to transformers.js and Node taught me a lot about each technology and about which jobs suit a big hosted model and which suit a small local one.

Rebuilding is fine if each version teaches you something.

Every earlier Oread fed into this one. The rebuild went fast because I finally knew what I was building.

Rules for the AI matter as much as rules for the code.

I kept a strict coding standard in the repo that both I and the AI followed including full names, short single-purpose functions, one concept per file. It kept a large AI-assisted codebase readable.

Context, memory, and working with AI chat.

This was my first time building an AI chat integration and it taught me that models don’t remember anything on their own and context windows run out, so you need memory. There are many ways to integrate memory into a chat context and working through them is how I learned to keep a chat going for hundreds of turns and carry its history from one session to the next.