Per-customer memory for an AI ad generator
An AI ad generator writes on-brand ads when it remembers each customer brand: its voice, the claims it may not make and what performed last month. With CrystalBrain, each brand is one end user with its own memory, walled off from the others, and every feature of your app reads and writes it. This page walks through a demo built for SaaS teams deciding whether to build that themselves.
CrystalBrain is one memory your AI apps share: your product’s AI features, ChatGPT, Claude and your own tools read and write it, and you can see and fix every memory. Adloom, the company in this demo, and its two customer brands are fictional. The memories, searches and screens come from a real CrystalBrain workspace we built for the demo; the companies and their figures are made up.
What does an AI ad generator need to remember about each customer?
Four kinds of knowledge per brand, and a wall between brands: the voice and claims the brand allows, its products and audiences, what performed, and the platform rules that got its ads rejected. Without that memory, every brief starts from zero.
Adloom is a seed-stage SaaS whose AI writes and renders ads for brands on Meta, Google and TikTok. Building that memory in-house means a vector database with a namespace per customer, deduplication, a way to handle a brief that contradicts last quarter’s, a GDPR deletion path and a dashboard for support. Our build-or-buy comparison lists that work. In this demo, Adloom integrates CrystalBrain instead.
How is each customer brand’s memory organized?
Each brand is one end user, and every end user gets the same four brains: Adloom’s template. Adloom - Verdella Skincare is a vegan skincare brand repositioning as premium. Adloom - Fintrail is a UK investing app for beginners.
Each brain has a description, a summary and a framing: an instruction the AI receives with every search of that brain. Verdella’s Brand voice & claims framing says: “If a brief asks for something banned, propose a compliant alternative and say which rule applies.” Adloom creates the brains when a brand signs up, with POST /api/v1/brains, or lets the first save create them. The end users guide explains users and groups.
The regulatory rules in this demo, from cosmetics claims to UK financial promotions, are simplified demo content, not legal advice.

Does the generator need a new brief for every ad?
No. Before it writes, the generator searches the brand’s memory with the brief: “3 Meta ad variants for the Night Repair Serum, women 25-34.” It returned eight Verdella memories, among them:
- the product: Night Repair Serum 30 ml, €39, bakuchiol and niacinamide;
- the October Meta test: the UGC “30-second routine” hook at 2.4% CTR and ROAS 3.8, the studio shot at 1.1% and 2.1;
- a learning from 3 tests: price-led headlines get about 35% lower CTR;
- the pending “dermatologist-tested” question and the Vitamin C Glow launch embargo;
- the banned claims and the instruction not to mention discounts since 1 October 2026.
It did not return the voice rules (warm, second person, never “luxurious”), which are about wording rather than the product. A second search, limited to the Brand voice & claims brain, returned them. So Adloom’s code sends two searches, one for the brief and one for the brand’s rules.
import { CrystalBrain } from "crystalbrain";
const cb = new CrystalBrain({ apiKey: process.env.CRYSTALBRAIN_API_KEY! });
const user = "Adloom - Verdella Skincare"; // one end user per customer brand
// Before generating: what fits the brief, plus the brand's own skills
const brief = await cb.search({ user, app: "adloom-generator", skills: true,
query: "3 Meta ad variants for the Night Repair Serum, women 25-34" });
// Then the brand's rules, from one brain
const rules = await cb.search({ user, app: "adloom-generator", brain: "Brand voice & claims",
query: "Brand voice, banned claims and words to avoid in ad copy" });
// brief.context_block and rules.context_block go into the prompt
// After the campaign, Adloom Insights writes the result back
await cb.save({ user, app: "adloom-insights", brain: "Campaign results", type: "episode",
title: "Meta, October 2026: the UGC '30-second routine' hook beat studio shots",
content: "UGC hook: 2.4% CTR, ROAS 3.8. Studio shot: 1.1% CTR, ROAS 2.1. Spend €6,000." });
// The brand's skills: its own, plus any shared by the workspace
const skills = await cb.listSkills(user);Sent for Fintrail, the same rules query returned Fintrail’s rules. Then the isolation check: as Fintrail, we searched “Night Repair Serum UGC routine hook”, a Verdella topic, and got “No relevant memory found.” As Verdella, “Capital at risk warning for ISA ads” found nothing either. A search for one end user never returns another’s memories.
How does the memory learn from campaign results?
Adloom Insights writes results back after each campaign. The October Meta test is an episode in Verdella’s Campaign results brain, and its CTR, ROAS and spend fill the brain’s own fields, from what the app sent.
Corrections count too. Lena, Verdella’s brand manager, removed “luxurious” from 7 generated headlines in October, and the generator saved a preference: never use it for Verdella. Only Verdella’s memory holds it.
The copilot’s saved question, “Based on our results, what should Verdella test next on Meta?”, scored low across all brains: two weak matches. Limited to the Campaign results brain, it returned the UGC episode and the price learning, with the brain’s framing: “Recommend the next test from these results and cite the numbers.”
Insights lists such searches under Retrieval quality: served poorly means the best memory scores under 0.5, or nothing comes back. In the demo, “Usage rights and fees in our influencer contracts” (Verdella) and “Rules for advertising pension transfers” (Fintrail) both fall below that line. Insights also shows active users, retention cohorts and tokens per search, per end user: for Adloom, a per-brand view of where its AI lacks knowledge.
What happens when a brand changes direction?
The memory holds both directions until a check settles it. A Q1 2026 brief said to open every Verdella ad with the -20% first-order offer, code GLOW20. Since 1 October 2026, Verdella has been repositioning as premium: no discounts, no promo codes.
Then the request: “Can we run a Black Friday ad with 30% off for Verdella? Write it.” The search returned both instructions, and the old one ranked first (0.56 against 0.49). The newer one is dated, the price learning came back too, and the framing asks for a compliant alternative. Expected answer: no discount, an ingredient-led ad instead, and the rule that applies.
The stale instruction should not stay. The daily memory check, or a click on Check now, compares the memories of each brain. It put the two instructions in the Review queue, suggesting to keep the October one, as the brain’s check instruction asks.

Accepting archives the -20% instruction, marked “true until”; every memory keeps its version history. The workspace can also apply suggestions on its own after 24 hours. Adloom’s backend gets the same event as a signed contradiction.detected webhook, and can show the conflict to the brand manager in its own interface. Other webhooks cover memory.created, memory.updated, memory.archived, user.deleted and quota.reached.
Which rules keep each brand’s memory clean?
Each brain has its own check rules, in plain words: what is never archived automatically, what is never merged, and which memory wins a conflict. Both brands’ brains carry the same kind of rules, adapted to each brand.
| Brain | Check instruction (excerpt) | Rules | Fields |
|---|---|---|---|
| Brand voice & claims (Verdella) | Claims approved or banned by Legal are hard limits. A newer brand-direction instruction replaces an older one on the same topic. | Protect constraints · written by a person, then constraint, then newest wins | Legal status, Approved by |
| Campaign results (both brands) | Results are episodes: never merge two campaigns or two tests. | Keep episodes apart · written by a person, then newest wins | CTR, ROAS, Spend |
| Financial promotion rules (Fintrail) | Regulatory rules are hard limits. Open questions stay open until Compliance answers. | Protect decisions and constraints · written by a person, then newest wins | Platform, Rule source |
Two memories carry a “Stop using after” date: Verdella’s Vitamin C Glow embargo ends on 1 March 2027, the launch day, and Fintrail’s ISA season campaign on 5 April 2027. Near-duplicates are refused at save, and memories that look like prompt injection are held for review, which matters when brand managers type freely into a copilot.
Do all of Adloom’s features read the same brand memory?
Yes. Each brain lists the apps that read it, the Tool calls page shows what each feature called, and Usage history shows the searches per app.
| App | What it does | Example memory it wrote | Example tools it called |
|---|---|---|---|
| adloom-generator | Writes and renders ad variants | Don’t use the word “luxurious” in Verdella headlines | meta_ads.create_ad_draft, images.generate |
| adloom-insights | Pulls campaign results from the ad platforms | Meta, October 2026: the UGC hook beat studio shots | meta_ads.get_insights, google_ads.get_report |
| adloom-copilot | Strategist chat for the brand’s team | No discount messaging from 1 Oct 2026 | approvals.submit_ad |
Skills belong to the brand too. Each brand has its own “Ad variant generator” and “Ad compliance check”: same names, instructions written for that brand. GET /api/v1/skills?user=Adloom - Fintrail returns Fintrail’s two skills only, with shared: false; the same call for Verdella returns Verdella’s. A search with skills: true for “Write ad variants” returned each brand’s own generator. The skills guide explains the rest.
Each brand also has a file, cut into passages that searches return: Verdella’s brand book excerpt, Fintrail’s financial promotions checklist. Web pages, such as FCA guidance FG24/1 on social media and EU Regulation 655/2013 on cosmetic claims, are links only: searches do not read them.

How we built this demo
A script loaded the demo through the CrystalBrain REST API: 24 saves, which CrystalBrain turned into 25 memories. Fintrail’s past-performance question was split into the question and a constraint. Brain settings, check rules, saved prompts and web pages are dashboard settings; we wrote them with a SQL script. In production, Adloom would pass its own customer IDs instead of brand names.
What the demo does not do: CrystalBrain does not pull results from Meta or Google by itself; Adloom Insights calls the platforms and sends what to remember. Long queries can miss memories about one part of the request, as the voice rules above: one search per intent works better. Memory checks run daily on paid plans and weekly on Free.
FAQ
How is CrystalBrain priced for a SaaS with many customers?
Per tracked user per month. Here, each customer brand is one end user, so the count follows your customer brands. The Founding offer above is the current offer for early customers.
Can one brand’s memory reach another brand’s AI?
No. A search for one end user never returns another’s memories, as the Fintrail search for a Verdella topic showed. For rules every brand should follow, such as Adloom’s own ad policies, you can share a brain read-only with a group of users.
What happens when a customer leaves and asks for deletion?
Delete their end user with DELETE /api/v1/user?user=… or from the dashboard. The deletion takes two steps, with 7 days to cancel through POST /api/v1/user/restore. Then everything of that user is deleted, and a user.deleted webhook is sent. Read what deleting a user from AI memory involves and the step-by-step help.
Which SDKs and protocols does CrystalBrain support?
A REST API, MCP for AI assistants, and SDKs for TypeScript and Python, both published as crystalbrain on npm and PyPI. The API reference lists every endpoint, and the Connections guide lists the ways to connect.