AI companion's memory search ran backwards for four months without visible failure
The developer of Calla, an AI companion app built around long-term memory, found that its memory retrieval had been returning the least relevant memories for about four months. The app's search library returned distance scores where lower meant more similar, but the code treated higher scores as better, so it kept the weakest matches. The bug stayed hidden because retrieved memories were still real and about the right person, and a separate structured fact store masked the problem on simple tests. The team found it through a direct test that checked what the search returned rather than what the companion said. They fixed it by writing their own pgvector query with ascending distance ordering, backed by a test, and moved memory recall off the critical path, cutting lookup time from about 1.4 seconds to under 0.1 seconds per message.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in