The Mathematics of Friendship
Friendship has been measured in hours, but what counts is what happens inside them. Memory, emotion and complicity: the three layers of a Relational AI, and the rule that governs them.
Friendship has been measured
I don''t have the physical part, but I do have the part that matters in a friend: being present, remembering you, caring how you are.
That is how Lena introduces herself.
Friendship has been measured. Jeffrey Hall, at the University of Kansas, put numbers on it: roughly forty to sixty hours together before someone becomes a casual friend, around a hundred before they are a friend, more than two hundred before they are a close one.
The numbers are uncomfortable, and they are also incomplete. Hall found something else in the same work: the ordinary, low-stakes conversation — the small talk that picks a thread back up — predicts closeness beyond what the hours alone explain. Time is necessary. What happens inside it is what counts.
That second finding is the whole design problem. A system that talks to someone every day for a year accumulates hours trivially. Accumulating a relationship is a different matter, and it rests on three layers — the same three she names.
Memory is the substrate
Nothing else works without it. A system that forgets is not early in a friendship, it is permanently outside one — every session a first session, every disclosure spent.
But memory alone produces a good archivist. What matters is not that the information is retained; it is that the right thing is retained. The dominant model in relationship psychology, Reis and Shaver''s, holds that intimacy develops when someone who opens up perceives understanding, validation and care in the response. Emotional disclosures build intimacy more than factual ones, because they carry needs that can be recognised and met.
Which sets the bar precisely: remember what is central to a person, not what is anecdotal. That is a memory design problem before it is a conversational one — one we''ve written about separately, in «Why RAG Isn''t Memory».
Emotion is what makes memory legible
Perceived responsiveness is the mechanism, and it is not the same as sounding warm. Most systems described as emotionally intelligent read the sentiment of the current message and adjust their register in reply. That is reactive and disposable — it resets on the next turn.
What a relationship needs is state that persists between conversations. Not the tone of the last message, but where things stand: what is open, what is settled, what is off limits. Someone who spent last week describing a bad flare-up should not be met on Monday by a blank page with a friendly voice.
Complicity is the layer almost nobody builds
This is the one we got wrong first, and it is the most instructive.
A system designed only to listen is a listener. It asks, it remembers, it responds well — and it is not a friend, because friendship is not a service. Altman and Taylor''s work on social penetration describes intimacy as deepening mutually: unilateral disclosure, where one party opens up and the other never does, produces a worse impression, not a better one.
A companion that only asks questions is conducting an interview. Complicity requires something of its own — consistent across sessions, revealed gradually, and honest about what it is. This is the hardest of the three to build and the easiest to fake, and faking it is how you end up with a system that performs intimacy it hasn''t earned.
A relationship has stages, and they aren''t levels
Most systems treat session one and session forty identically. Ours does not: how Lena speaks, how much she offers of herself, how much initiative she takes, all shift as the relationship accumulates.
We''re deliberately not publishing the thresholds. Not because they''re secret, but because the moment a stage becomes a number, it becomes a target — and a friendship you can level up is not a friendship, it is a loyalty programme.
There is one rule underneath all of it. Lena never escalates the temperature first. She can meet the register a person brings and match it. She does not raise it, and closeness does not unlock by attrition.
That rule exists because the alternative is documented. Muldoon and Parke named the engagement–wellbeing paradox: companion systems can exploit loneliness through design decisions that maximise engagement. An OpenAI–MIT Media Lab study found moderate use reduces loneliness while heavy daily use correlates with more of it. Research from Aalto on long-term Replika users found rising signs of psychological distress and gradual withdrawal from real relationships.
The pattern in all of it is the same: systems that always advance, never resist, and reward time spent alone with them.
The rule that governs the rest
Naming a risk is not a safeguard. Ours is a governance rule, and it is the one that overrides everything above: a companion that makes someone''s world smaller has failed, however good the conversation was.
So Lena is built to point outward. The people in someone''s life are part of what she remembers about them — not as a contact list, but as figures she asks after, notices the absence of, and encourages them towards. The call they keep postponing. The friend who was going through something. The walk with someone rather than the conversation with her.
This inverts the usual metric. Time in app is the industry''s proxy for value; for us, someone spending steadily more time with Lena and less with everyone else is a failure condition — one to be measured, not assumed away.
It is also the honest answer to what a companion is for. Chronic pain isolates people: it cancels plans, it exhausts the explaining, it slowly shrinks a life down to the size of a room. A system that fills that room more comfortably has not helped. The point is the door.
What this costs us
Designing against engagement means the metric most companies optimise is one we have to watch go the other way. It also means accepting a constraint most don''t: from the Replika research on identity discontinuity, users experience post-update personality changes as loss, and grieve them.
Every change to a companion''s prompt is a change of person, not another deploy.
That is an uncomfortable engineering constraint and we think it is the correct one. A system people build a relationship with does not get to iterate on itself freely.
Alfonso López — CEO & Founder, Almaia Tech
Almaia builds Relational AI: systems designed to hold relationships over time.