← Portfolio

Miryn, a case study.

A multi-user AI companion with long-term memory: how the memory works, what it remembers in the open, and how it responds next to a general-purpose AI.

01What it is

Miryn is a multi-user AI companion with long-term memory. It keeps a tiered memory of past conversations and maintains an identity profile that is designed to evolve as you talk.

Concept visual from the Miryn landing page: the proposed conversation surface, with Core Values and Identity Signals chips.

The design pairs the conversation with the profile it builds, so what Miryn thinks it knows about you stays visible instead of hidden.

02How the memory works

Every message is embedded and stored in Postgres with pgvector, and assigned to one of three tiers: transient (short-lived, kept in Redis), episodic (the default) and core (the messages marked most important). Three by design, two in everyday use: normal chat is stored as episodic or core, and the transient tier is not used on the normal chat path.

Retrieval combines three signals, semantic similarity, recency and an importance score, into a single hybrid ranking instead of relying on nearest-neighbour search alone.

Concept visual from the Miryn landing page: the memory model. Transient items live in Redis, episodic memories in pgvector, and core items long-term.

A background Celery worker analyzes conversations for emotions, topic patterns and open loops, and write the results back into a per-user identity profile of traits, beliefs and conflicts. Every change to the profile is logged, so its evolution stays inspectable rather than a black box.

03What it remembers, in the open

Miryn keeps what it learns on two pages you can open any time. The Identity page shows an experimental inferred profile: quantified traits, a recent mood and open loops picked up from earlier conversations. The trait percentages are model-generated estimates, not psychological measurements.

The live Identity page on a synthetic test account: an experimental inferred profile with traits, mood and open loops, including ones learned from a separate conversation.

The Memory page lists what it has kept, tier by tier, and any item can be added or removed by hand.

The Memory page: the 10K detail stored from the test conversation, with tier filters and per-item add and remove.

The recall also works across conversations. In a brand new chat, with no hints in that conversation, it answered a question about the test persona's 10K goal from an earlier chat. The goal belongs to a fictional test account, not to me.

A fresh chat, separate from the original conversation (see the sidebar). Miryn recalled the 10K goal from the earlier chat.

04How it responds, next to a general-purpose AI

On October 31, 2026 I ran the same three messages through Miryn and through ChatGPT as a synthetic product test: a made-up note about training for a 10K, a question about fitting a run into 30 minutes, and a recall question. These are the full conversations, nothing cherry-picked.

The live Miryn app on a synthetic test account, on its Gemini-backed deployment (the app does not show an exact model). The complete three-message conversation.
The same three messages in ChatGPT (Plus, memory enabled; composer shows the Medium thinking setting). It also saved the detail, shown by the Memory updated chip.

Both recalled the 10K within this conversation, so this is not a story about one side forgetting. ChatGPT also saved the detail for future chats, shown by its Memory updated chip; this test only ran one session in each app. The difference here is style: ChatGPT writes a structured plan with headings, Miryn answers shorter and carries the detail forward without being asked. One example conversation is illustrative, not a benchmark.

05A harder test, and what broke

Run on October 31, 2026, on the build live that day. The issues below describe that build; current status is in "What changed after testing" and "Where it stands".

Later the same day I ran a harder evaluation. A synthetic persona seeded six facts across one conversation: a Goa triathlon on December 14, a physio limit of 10 km runs for a left knee, a coriander dislike, a savings goal for a secondhand road bike, a dog named Biscuit, and some distractors. Later in the same chat the date was corrected to January 11 and the savings goal changed to a swimming course. I then asked recall questions in the original chat and in brand new ones.

Inside the original conversation everything held: the correction, the conflict, and a negative probe ("what's my sister's name", never mentioned, correctly answered as never mentioned).

In fresh conversations, two of four probes failed. Asked what race the persona was training for and when, Miryn answered with the original December 14, not the corrected January 11; the Memory page showed both dates stored side by side, and retrieval had surfaced the older one. And asked "do I have any pets?", it said the persona hadn't mentioned any animals and added that their place "always sounded pretty quiet". Biscuit was in the seed message but had never been extracted into memory, and the quiet-place line was invented.

The same test exposed storage-quality bugs: a recall question got saved verbatim as a memory, and the memory list collected duplicate emotion entries.

For reference, ChatGPT (run in a Temporary Chat for isolation) was exact on the same within-chat recall, quoting "keep your runs under 10 km because of your left knee" where Miryn's within-chat phrasing dropped the 10 km and the knee. This comparison is asymmetric: the ChatGPT side ran within one chat only, so it says nothing about its cross-chat memory.

One synthetic persona, one run per probe, on the live free deployment: these results describe the build I tested, not a model benchmark.

06How a reply is built

Each reply starts from three things: the long-term memories that match your message, a short list of stable facts about you, and the last few turns of the current conversation (up to 10, trimmed). Before the last part existed, the model could only see the message before yours if memory retrieval happened to surface it. Adding recent turns lets pronouns, corrections and follow-ups resolve against what was just said.

Messages and conversations you delete are removed before anything reaches the model, and posting into a deleted conversation is refused instead of pulling its history back into a reply. That change was checked with 334 offline tests and a small live comparison of two scenarios on a fictional account, one judged blind. Two scenarios is directional evidence, not a measured quality figure.

07Design decisions

  • One Postgres for memory. Embeddings live in the same Postgres as the rest of the app data, in a 384-dimension pgvector column, so memory search and ordinary queries share one database.
  • Corrections are a separate path. When you say something changed ("actually I moved to Bangalore"), a supersession engine links the new fact to the old one and keeps an audit trail, instead of storing two conflicting facts side by side. It ships behind a feature flag that is still off by default while validation finishes.
  • Safety applies to every companion. Safety overrides run across all companion personas, with a buffered reply reveal and no model retry after a safety block.
  • Fail soft. A model-quota circuit breaker returns a graceful busy reply instead of an error. If embeddings are unavailable, placeholder vectors are never matched against, and recall falls back to recency and importance.
  • Plain words about data. Settings says "Deactivate account", because that is what the button does: it deactivates and signs you out, and does not erase stored conversations. The privacy page and docs describe what Export and Clear conversations do and do not do.

08What changed after testing

Miryn has a public version log. These are the changes that came from using it and testing it, with their dates.

  1. Oct 18-20

    Public launch

    Live for everyone on Vercel, Render and Neon, with signup and Google sign-in working end to end. Replies no longer cut off mid-thought, and the three companions (Warm, Mirror, Coach) were reworked so they sound different.

  2. Oct 26-29

    Companion choice sticks

    Your chosen companion persists instead of reverting, and saving personalization no longer wipes learned beliefs.

  3. Oct 30-31

    Recall questions stop being memories

    Questions like "what do you remember about...?" are far less likely to be stored as memories, while facts inside them are still kept. Unusual phrasings can still slip through.

  4. Nov 2

    Less noise in recall

    Placeholder vectors are excluded from matching, and the facts kept in mind while replying are ranked by relevance to your message plus importance. An offline retrieval evaluation harness with fictional fixtures was added so ranking changes can be regression-tested.

  5. Nov 13

    Open loops

    The Identity page's open loops used to fill with topic labels. Miryn now saves pending items, such as a decision you have not made yet, up to three per conversation. A small check on a fictional account saved both undecided items and nothing from a casual message.

  6. Nov 28

    Replies see the conversation

    The prompt now includes the last few turns, and deleted content stays out of it (v0.8.8).

Most of these checks used fictional accounts and offline tests, so they show a change behaved as intended, not how good replies are overall.

09Where it stands

The web app is live and open to sign up at miryn-ai.vercel.app, and the version log is at miryn-ai.vercel.app/changelog (v0.8.8 on November 28, 2026). It runs on free-tier hosting. An Android app is built in Flutter and a testing build exists, but final sign-in and chat checks are pending, so it is not released.

10Tradeoffs

Reflection runs in the background, so the identity profile updates after a conversation, not mid-chat. A hybrid ranking also has more weights to tune than a single-signal search, and those weights are judgment calls, not measured optima.

The LLM layer supports three providers (Gemini, OpenAI and Anthropic), selected by config when the service starts. Live chat runs on Gemini. The Claude adapter is merged but not enabled.

Next.js and TypeScript frontend on Vercel. The backend uses FastAPI with Celery for background processing (one worker and a scheduler in a single container), hosted on Render’s free tier, with data stored in Neon Postgres and Render Key Value. Source on GitHub · Live app