Ridwan HamidBack to the journey

Case study 02

Llongterm

Giving stateless AI a memory.

A plug-and-play memory layer for AI developers, turning stateless LLM interactions into context-rich, long-running exchanges. Llongterm was a startup and is no longer active; this page describes what I built there.

Role
Full-Stack Engineer
Dates
Nov 2024–Dec 2025
Status
Company no longer active

The problem

LLM applications forget their users between sessions. Retrieval over raw message history finds what was said, but it loses what changed: updates, corrections and contradictions.

Minds

I engineered the core abstraction, the Mind: a persistent entity that takes in what it is told, structures it, and recalls it across sessions. A Mind organises its knowledge as a human-readable tree, so what an application remembers can be inspected, not just searched.

Agentic memory

I designed and implemented agentic workflows in which agents decide for themselves, during a multi-turn task, when to query their memory, when to write something new and when to revise what they already hold. Memory stops being a single retrieval pass before each answer and becomes stateful context management.

How a Mind gives a stateless model a memoryThree conversations, weeks apart. In the first, the user says they are vegetarian and training for a half marathon in May: the agent writes two memories, under Diet and Training. In the second, it is now the 10K in May and their knee has been sore: the agent revises Training and writes Health. In the third, asked to plan a training week, the agent queries the Mind first and plans for the 10K, the knee and the diet. The Mind is a tree a person can read: Diet, Vegetarian; Training, 10K in May; Health, knee has been sore.CONVERSATIONS, WEEKS APARTSESSION 1“I’m vegetarian, and I’m trainingfor a half marathon in May.”→ writes Diet and TrainingSESSION 2 · TWO WEEKS LATER“Now it’s the 10K in May.My knee’s been sore.”→ revises Training, writes HealthSESSION 3 · A MONTH LATER“Plan my training this week.”← queries first, and plans forthe 10K, the knee and the dietAgentdecides, turn by turn,when to use its memorywriterevisequeryMinda tree a person can read, kept across sessionsDietVegetarianTraining10K in MayHealthKnee has been soreHow a Mind gives a stateless model a memoryThree conversations, weeks apart. In the first, the user says they are vegetarian and training for a half marathon in May: the agent writes two memories, under Diet and Training. In the second, it is now the 10K in May and their knee has been sore: the agent revises Training and writes Health. In the third, asked to plan a training week, the agent queries the Mind first and plans for the 10K, the knee and the diet. The Mind is a tree a person can read: Diet, Vegetarian; Training, 10K in May; Health, knee has been sore.CONVERSATIONS, WEEKS APARTSESSION 1“I’m vegetarian, and I’m trainingfor a half marathon in May.”→ writes Diet and TrainingSESSION 2 · TWO WEEKS LATER“Now it’s the 10K in May.My knee’s been sore.”→ revises Training, writes HealthSESSION 3 · A MONTH LATER“Plan my training this week.”← queries first, and plans forthe 10K, the knee and the dietAgentdecides, turn by turn, when to use its memorywriterevisequeryMinda tree a person can read, kept across sessionsDietVegetarianTraining10K in MayHealthKnee has been sore
An illustration of the idea, with made-up memories: not Llongterm’s code, data or design. Weeks apart, an agent writes, revises and queries the same Mind, so the third conversation starts from what is true now, not from everything that was said.

Evaluation

Memory quality is easy to claim and hard to measure. I built an evaluation framework for recall accuracy, retrieval relevance and context fidelity. Memory-quality scores improved from 65% to 90%, and the team gained a repeatable benchmark for regression testing.

About this page

Llongterm’s code, prompts and internal tools aren’t shown. The pictures of Minds in the journey are original illustrations of the idea, not the product.