One memory per user, many AI apps
AI features arrive in a product one at a time. A support chatbot comes first, then an automation built in n8n, then an assistant inside the app itself. Each is built with the tools at hand, and each gets its own way of remembering things, such as a table, a vector store or the memory feature of a framework. The product ends up with three memories because it has three features, without anyone having decided that it should.
The cost of separate memories
The user notices the problem first. They tell the chatbot that deliveries should come on Saturdays. The workflow that schedules the next delivery never hears about it, and the in-app assistant asks the question again a week later. For the user it is all one product, and that product keeps forgetting what they told it.
The team notices later, when someone asks what the product stores about a user or asks to delete one. Each store has to be queried, exported and cleaned separately, and each has its own format. We cover those questions in what does your AI store about our users.
One memory per end user
The alternative is to key the memory on the person and let every feature read and write the same one. In CrystalBrain the structure is workspace, then user, then brain, then memory. A user is one of your customers, named by the ID or name it has in your own app. A brain is a topic of that user, such as orders or a project. Each call your apps make can name a user and a brain (the MCP tools call the brain a space). A call that omits user applies to your own account.
- A user is created on its first save. A search never creates one.
- A search is bounded to one user: it reads that user’s brains and the brains opened to that user’s groups, described below.
- When no brain is named, a search reads all the user’s brains, and a save lets CrystalBrain pick one of the user’s brains or create one.
Three of our demos show the same setup with a team’s tools: an AI support assistant that applies your policies, an AI IT helpdesk that follows your own procedures and an AI SDR that remembers your ICP and opt-outs.
Two ways to connect an app
MCP for Claude and other MCP apps
Apps that speak MCP connect with one link and a sign-in. They get tools to search the memory, save to it, and update or archive a memory when the user corrects something. Each of these tools takes an optional user. The Connections page gives the steps for Claude, Gemini and ChatGPT. Two caveats apply today. The Gemini and ChatGPT steps were checked on the web and have not been tested by us. And claude.ai does not apply a server’s instructions by itself, so you paste the instruction shown on the Connections page into your Claude preferences for the memory to be used without asking. Connecting Claude, ChatGPT or Gemini has the details.
REST API and SDKs for everything else
Workflows and your own code use the REST API with an API key: one endpoint to search, one to save, and others to list brains and users or correct a memory. There is a TypeScript SDK (npm install crystalbrain) and a Python SDK (pip install crystalbrain), both typed from the API’s OpenAPI document. The “Other apps” tab of the Connections page has the settings for an n8n HTTP Request node, and snippets for both SDKs, curl and JavaScript. Make and Zapier use the same plain HTTP calls. The full list of endpoints is in the API reference.
POST /api/v1/save
Authorization: Bearer YOUR_API_KEY
{ "user": "cus_123",
"brain": "Orders",
"app": "support-bot",
"model": "your-model-id",
"type": "preference",
"title": "Delivery on Saturdays",
"content": "Prefers Saturday mornings." }The app and model fields
Once several apps write to the same memory, the first question about a strange entry is which app wrote it. Two optional fields answer it. app is the name of the calling app. It is stored on each memory the app saves and on each search it makes. A REST search that omits it is logged as api. A REST save that omits it stores no app name, and Insights counts that memory under “API”. For MCP calls, CrystalBrain uses the name the connecting app registered with when it can identify it.
model is the AI model the app used. Over the REST API your app sends it. Over MCP the AI names itself, because the protocol does not tell a server which model is calling, so the value can be approximate.
Both appear on the Edit memory screen, on each request in Usage history, and in the “Apps & tools” tab of Insights, where the Apps table has one row per app with its searches, hit rate, tokens per search and memories written. That table is how you see that one app writes a lot and another reads little. We describe these figures in measuring an AI memory.
Several writers also means more overlap. Two apps will save the same fact in different words, and one of them will sometimes save the opposite. Near-duplicates within the same brain are refused at save time and the memory checks handle the rest, as described in how an AI memory ends up contradicting itself.
Sharing a brain with a group
Some knowledge belongs to several users at once: the delivery rules of a customer company that all its employees should get, or a product glossary. Copying it into each user’s memory creates as many versions as there are users.
Groups solve this. You put users in a group in the Groups tab of the End users page, then open a brain to one or more groups from the Members tab of the brain’s own page. The members’ searches then read that brain in addition to their own brains. The sharing is read-only: the AI never writes to a brain a user reads through a group, and a save always goes to one of the user’s own brains. In the list of a user’s brains that the API and the MCP tools return, a shared brain is marked read-only, with the names of the groups it comes through. Sharing a brain with a group gives the steps.
What to decide before connecting a second app
Three decisions make a shared memory work. They are easier to take before the second app is connected than afterwards.
- Use the same user identifier everywhere. If the chatbot sends an email address and the workflow sends a customer number, you get two users and two memories.
- Agree on brain names, or name none. Two apps that write to “Orders” and “orders and deliveries” split the topic in two.
- Give each app a name in
app, so that the activity of one can be told from the others.