I built an AI companion with persistent memory across all sessions — here's what that actually required
Eighteen months ago I started thinking about a problem that seemed simple on the surface: what would it take to build an AI that genuinely knows you over time?
Not summarises your last message. Not retrieves a few bullet points from a database. Actually knows you — the way a good therapist or long-term friend accumulates an understanding of who you are, what you keep coming back to, and what you keep avoiding.
I'm not an engineer. I'm a behavioural researcher who has spent three decades studying how people change. I built this using AI coding tools, which meant I had to understand the architecture well enough to direct it precisely even when I couldn't write a line of code myself. That constraint turned out to be clarifying.
The memory problem is not what I expected
The naive version of persistent memory is: store everything and retrieve it. The problem is that a person having their 50th conversation with an AI accumulates enormous context — and most of it is noise. If you inject raw session history into every prompt you hit token limits immediately and the signal-to-noise ratio destroys response quality.
What actually works is a multi-layer consolidation architecture:
- Hot layer: the current session in full
- Warm layer: the last 3–5 sessions as structured summaries
- Cold layer: longitudinal patterns extracted across all sessions — not summaries, but inferred behavioural signals
The cold layer is where the interesting work happens. After each session, a background job runs signal extraction — identifying patterns, emotional tones, avoidance behaviours, contradictions between stated intentions and reported actions. These signals accumulate in a separate table and get injected into the system prompt as a compact behavioural profile rather than a session log.
The result is a conversation where the AI can say "you've mentioned wanting to have a difficult conversation with your business partner three times in the last month and each time you've found a reason to delay" — not because it remembered a specific session, but because the signal extraction caught the pattern.
The three-layer memory architecture. Signal extraction runs on the cold layer after each session.
The ghost problem
One of the hardest product questions was: how do you show someone they've changed?
Most personal development tools are session-local. You feel good in the moment and forget the conversation existed. We built what we call Ghost You — a snapshot system that captures a baseline at Day 1 across four dimensions (self-discipline, emotional openness, consistency, boundary clarity), then captures new snapshots at Day 30, 90, and 180 and generates a scored, narrated comparison.
The technical challenge is that the scoring needs to be consistent across time even as the underlying model improves. We solved this by scoring against the user's own historical baseline rather than any absolute scale, and by grounding every score in specific conversation evidence rather than vibes.
Ghost You captures a baseline at Day 1, then scores the same four dimensions at Day 30, 90, and 180 — always against the user's own baseline.
The relationship layer
The harder version of the memory problem is: what does it mean for an AI to understand a relationship between two people while maintaining strict privacy between them?
Chaegim Together gives two people a shared AI space where each person's private conversations remain completely private, but the AI synthesises patterns at the relationship level — what both people keep returning to, what both avoid, where their perspectives are diverging without either person naming it.
The architecture uses three data layers: private (never shared), contributed (explicitly shared by the user), and synthesised (inferred from patterns across both). The synthesis runs as a background job that never has access to the full text of either person's private conversations — only to extracted signals. This is a meaningful privacy boundary, not a UX fig leaf.
The three-layer relationship architecture. Private conversations never cross. Only extracted signals reach the synthesis layer.
What I got wrong
The signal extraction prompt was the hardest thing to get right. The first 15 versions produced uniformly positive observations regardless of what was actually in the conversation. The AI model defaults to charitable framing — it wants to be encouraging rather than honest. Getting it to reliably identify avoidance, contradiction, and recurring excuse patterns required making the instruction structure explicit and adding a validation step that checks whether the output is suspiciously positive before accepting it.
The second thing I got wrong was underestimating how much the mobile architecture diverges from web when payments, audio, and background processing are involved. Apple's requirement that all in-app purchases go through their billing system while the web uses Stripe means you're essentially maintaining two parallel commerce flows. This is not new information but the operational complexity of keeping them in sync is real.
Where it is now
If any of this resonates, the web app is live at chaegim.com. iOS and Android apps are coming soon. There is a 14-day free trial if you want to see what it actually feels like.
The question I genuinely don't have answered: does longitudinal memory change behaviour over time, or do people engage for two weeks and drift like they do with every other tool? I have early signals that it doesn't drift the same way — the Ghost You comparison creates a different kind of accountability than a streak counter — but I don't have enough data to say that with confidence yet.