
Persistent Memory per User Without Managing a Database
November 8, 20269 min read1,924 words
Text: Derek Tran
Per-user agent memory is a product requirement, not an add-on.
Persistent memory per user is a product delivery requirement, which is the problem Agent37, a managed hosting platform that provisions an isolated, persistent agent for each customer with a single API call, was built to solve. The right architecture gives every customer an isolated agent sandbox and a namespaced memory layer that provisions automatically at onboarding. For a per-user AI agent sandbox provisioned via a single API call, the essential requirement is what comes with that call, including persistent storage, enforced isolation, retrieval, and memory lifecycle rules.
Why agents forget between sessions, and why that is a product problem not an engineering one
The prototype works, the demo is clean, and then the agent meets a returning user. It cannot remember what happened last week. LLMs are stateless between calls, and most agent frameworks provide session-only memory that resets when the session ends. Without a persistent layer built to keep them, facts, decisions, and past interactions are lost between sessions and when the system restarts. That is an architectural gap.
Users experience that gap as broken trust. A support agent forgets the issue the user already reported, a sales assistant asks for information the user already gave it, and a research agent re-summarizes documents it already read. The Mem0 2026 memory report describes how, in roughly three years, memory became a core part of the architecture, with its own benchmarks, published research, and differences between approaches that can be measured. Builders should treat continuity like onboarding or pricing, as part of delivering the product.
Why dumping full conversation history into the prompt fails at scale
Putting the entire conversation history into every prompt is the simplest way to give an agent access to its past. It also offers the highest potential accuracy. That makes it attractive in a demo, where one user's history can look like a manageable amount of text. But in production, thousands of users each have a history that keeps growing, and the system pays to process it again and again. Cost and latency grow with both adoption and use.
The problem goes beyond the size of the bill. As the agent accumulates supposedly important information, searching or injecting memory can take longer than the task itself. Old decisions, repeated facts, and superseded preferences remain in the material the model must consider. More history is not necessarily more useful context. Without a way to select and reconcile memories, the noise grows.
Larger context windows make more text fit, which can help with moderate-length conversations, and leave the cost and latency curve unchanged. The same report says temporal reasoning, memory staleness, and cross-session identity are the hardest problems still to solve. Full history supplies past statements without solving which statements are current or how identity persists between sessions. A larger window also leaves users' histories unseparated, so full-context prompting does not provide the memory architecture needed for production at scale.
What a memory layer actually is, and the four things it has to do simultaneously
A persistent memory layer stores, indexes, and retrieves information across agent sessions. It is outside the model's temporary context window. It is also distinct from the application's operational database, which is not structured around an LLM's retrieval and reasoning needs. Cognee's 2026 persistent memory guide names three kinds of information this layer must handle, which are episodic memory of past conversations, semantic memory of facts, and procedural memory of how to do tasks. The architecture determines how reliably the agent can recover each kind.
Storage is the first problem, but only the first. Vector databases, key-value stores, graph databases, and SQLite files are different ways to keep and index information. Curation decides what happens when that information disagrees with itself. An agent that only appends memories can retain duplicates, outdated facts, and contradictory beliefs about the same subject.
Retrieval must then find what the task actually needs. Textual similarity alone is not enough to decide that. A memory from five minutes ago and a semantically identical one from five weeks ago can look the same to a cosine distance function, despite having very different relevance. Lifecycle management addresses what happens over time, including which memories are consolidated, promoted, demoted, or retired. These four jobs must work together because a system that only stores information leaves the product team with more curation and lifecycle work to catch up on as use grows.
Namespaced memory scopes: how the right architecture maps memory to users, sessions, and agents
A shared memory store breaks as soon as the agent serves different users if it has no rules to keep their memories apart. User A's memories must not enter user B's queries. The namespaced design that has taken hold in 2026 makes ownership part of the memory structure, using user_id for information that belongs to one user across sessions. Isolation is therefore a correctness requirement.
An agent_id separates memories belonging to a particular agent instance, while a run_id or session_id confines information to one conversation or workflow. Without that distinction, there is no clear line between temporary task context and knowledge about the user that should last. An app_id or org_id provides a scope for shared organizational context. The design can then distinguish information intended for a group from information belonging to an individual.
Composio's user and session model applies this principle to connections. A user is an identifier supplied by the application, every connection sits under that user's ID, and connections are isolated between users. The same agent code can then serve many users while keeping their connections separate. Credentials need the same boundary as memory. With per-user OAuth, each user grants a scoped, revocable token tied to their own account.
These scopes also make memory decay manageable in practice. A short-term scratchpad belongs to run_id and is wiped per task, while medium-term task memory belongs to user_id and decays unless re-access reinforces it. Long-term memory requires explicit promotion. Without these boundaries, deciding what to discard or preserve becomes a manual curation burden.
What production storage actually looks like across different memory approaches
Storage choices follow from those boundaries and the agent's retrieval needs. They do not start with a framework popularity contest. The 2026 market spans zero-dependency, in-process retrieval through fully managed graph-native systems, with different operational demands at each point. A single agent retrieving simple facts has a different problem from one reasoning across connected information for many users. The namespace model gives those storage decisions a structure that can survive a change of backend.
Hermes Agent from Nous Research illustrates an approach that builds persistent memory into the agent's core. Its documentation describes bounded, curated memory that persists across sessions, while its site describes a model of the user that develops over time. It runs under the MIT license on hardware the builder controls. That is a different ownership model from managed infrastructure. Built-in memory removes an add-on requirement, but it is not the same proposition as a platform provisioning isolated environments for each customer.
Graph-based memory addresses the need to reason across connected information. Its supporters argue that vector-only retrieval will need to be replaced when those relationships become key to the work at scale. Other practitioners point to the operational complexity graphs introduce. The practical consensus in the notes is to start with managed infrastructure and design for graph, rather than force every simple agent into a graph system. A vector store such as Chroma or pgvector can serve a single agent with simple retrieval needs, provided the namespace and schema design do not block a later migration.
Why memory handled at the platform layer is a different product than memory handled at the application layer
With application-layer memory, the builder is in charge of the whole system. That includes choosing storage, writing curation logic, enforcing namespace isolation, managing lifecycle, encrypting stored data, and recovering from corruption. Those jobs still have to be done even when a database is easy to start. The product team owns their interaction as well as their implementation. A memory feature can leave the team with infrastructure to keep running long after it would have hoped to finish that part of the product.
The builder declares the namespace, and the platform enforces isolation, handles storage, and exposes a retrieval interface. Memory provisions with the user, in the same way a per-user agent sandbox should. This is more than hosting the same database elsewhere. The platform either delivers the complete per-user capability or leaves the application to assemble and operate it.
Credentials make that distinction especially important in an agent system. Tokens must be encrypted at rest and kept separate for each tenant, and must never go into logs or LLM context. A refresh token in the prompt can be exfiltrated through prompt injection. Enterprise procurement adds another operational burden. Customers expect SOC 2 Type II for deals of any real size, while getting it on their own takes teams months and costs a lot each year after that.
Managed infrastructure does not remove the need for scrutiny. The Composio security incident in May 2026 illustrates the breadth of the attack surface. A compromised employee Gmail OAuth token allowed an attacker to abuse magic-link sign-in on auxiliary systems. Separately, the attacker used LLM-generated exploit patterns to gain a foothold in an internal monitoring agent, register malicious tool definitions, and reach the execution sandbox and credential cache behind it. The incident compromised 5,001 OAuth tokens, primarily GitHub tokens, with a large number of API keys likely exposed from an auxiliary cache.
A system holding credentials and exposing agent actions has a large security surface, whether a platform team or an application team operates it. Building it in-house does not prove that it is better protected. A team choosing managed infrastructure should ask which platform has the security posture and audit history to earn that trust. The platform model transfers operational work while leaving the responsibility to choose carefully with the team.
How do you provision each user's persistent agent automatically at onboarding?
The unit of scale for this model is one isolated, persistent agent per customer. It provisions automatically when the customer arrives. With memory namespaced by user_id, a new agent starts with an empty but structurally correct memory store. The namespace exists, isolation is enforced, retrieval is available, and lifecycle rules are already in place. The agent has no history yet, but the system is ready to retain the right history.
That is the standard behind the single-API-call requirement. A call that creates an execution environment answers only part of the buyer's question if the application must separately build persistent memory and its boundaries. A memory service on its own also leaves the isolated agent environment to be supplied. The complete platform-layer model meets both needs at onboarding. No named implementation here establishes support for that entire provisioning contract, so built-in memory or isolated connections should not be mistaken for proof of it.
The memory layer is namespaced under the operator's brand, and the OAuth consent screen shows the operator's credentials. The underlying infrastructure is hidden from the customer. It puts the memory and credential relationship in the hands of whoever delivers the product, while the platform runs the machinery underneath.
The Mem0 report shows production memory architectures increasingly combining semantic, keyword, entity, and graph-based retrieval. Engineering cycles can go toward reconciling memories, maintaining retrieval, enforcing tenant boundaries, and operating the storage behind each new account. Or they can go toward the support, sales, or research product those accounts signed up to use, with a trusted platform provisioning the memory and sandbox.


