Commerce agents that remember what the customer actually buys
A good store clerk remembers the shopper who returns everything in medium. A shopping agent without memory recommends medium again, with confidence.
The mixture
- 01 · Persistent memory
- Leads
- 02 · Current context
- Uses
- 03 · Traceable decisions
- Light
- 04 · Shared context
- Uses
- 05 · Scoped retrieval
- Uses
Every visit is a first visit
Personalisation usually fails in the same three places, and all of them are visible in your returns data.
- 01
Returns never become preferences
The customer returned two jackets because the sleeves ran short. The reason sits in the order system. The shopping agent never reads it, so the third recommendation has the same sleeves.
- 02
Segments stand in for people
Without per-shopper memory, the agent personalises from a segment. "Women, 25 to 34, urban" is not the person who said last week she is shopping for her father.
- 03
Stated constraints expire with the chat
"Nothing with wool" was said in chat on Monday. On Thursday the email agent sends a wool edit, because the constraint never left the conversation it was spoken in.
Mostly persistent memory. Then three others.
Every application on Alchemyst is a different mixture of the same five jobs. That mixture is what makes this a different piece of software from the one next to it, even though the API underneath is identical.
What the user told you once stays told
Each shopper gets a durable memory: sizes that fit, reasons for returns, stated constraints, the person they are buying for. It is written as the conversation happens and read before every recommendation.
- Constraints persist across channels.
- Returns become signal, not noise.
- The shopper is a person, not a segment.
Uses · Current context
The price and stock in force
Last season's catalogue is subtracted, so the agent never recommends what you no longer sell.
Uses · Shared context
Chat, email and checkout agree
Every commerce surface reads the same shopper memory.
Uses · Scoped retrieval
The right products in the window
Catalogue, size and constraint scopes are intersected before ranking, not after.
That is four of the five. The fifth, traceable decisions (every answer carries the exact context it was served, and why), is what leads in Customer support, IT & incident response and Compliance & audit instead. Same API, different mixture.
The sources you already have
Bring sources in through the data-source integrations (PostgreSQL, MongoDB, Google Docs, Google Sheets, Amazon S3), an n8n workflow, or a direct context.add call. Each one lands scoped, so retrieval can intersect it with everything else.
01 · Ingest
Scope what you ingest
Every document lands with a groupName: the sets it belongs to. Those sets are what retrieval intersects later, so the structure you choose here is the precision you get there.
context.addimport AlchemystAI from "@alchemystai/sdk";const client = new AlchemystAI(); // reads ALCHEMYST_AI_API_KEYawait client.v1.context.add({ context_type: "resource", scope: "internal", source: "catalogue", documents: [{ content: "Field jacket JK-2291. Sleeve runs 2cm longer than standard. Sizes S to XL. In stock.", }], metadata: { fileName: "sku-JK-2291.json", groupName: ["catalogue", "outerwear", "fw26"], // the sets this belongs to },});02 · Write
Write the constraint, wherever it was said
A constraint said once in chat should hold in email, in search and at checkout. Write it against the shopper the moment it is said.
context.memory.addawait client.v1.context.memory.add({ sessionId: "shopper_77120", contents: [ { role: "user", content: "I returned the last two because the sleeves were short. And nothing with wool.", }, { role: "assistant", content: "Noted: longer sleeves, no wool." }, ], metadata: { groupName: ["commerce", "shopper_77120"] },});03 · Search
Search before recommending
Search intersects the scopes, subtracts superseded and duplicate content, and ranks what survives. Only that reaches the model, and the whole decision is recorded as a Context Trace.
context.searchconst { contexts } = await client.v1.context.search({ query: "Suggest a winter jacket for me", scope: "internal", similarity_threshold: 0.8, minimum_similarity_threshold: 0.5, metadata: { groupName: ["catalogue", "outerwear", "fw26"] }, // ∩ narrow scope});// − superseded, deduplicated → ranked → into the window// Every search is recorded as a Context Trace.const reply = await llm.respond(message, { context: contexts });
npm install @alchemystai/sdk or pip install alchemystai, both ship the same client. Full reference in the docs.
Shopper memory is personal data first
Purchase history, sizes and stated preferences are personal data in every market you sell into. Keep them scoped per shopper, exportable on request, and deletable when the customer asks, without rebuilding your recommendation stack.
Security & complianceManaged cloud
Encrypted in transit and at rest, isolated per organization, and scoped at write time.
Dedicated infrastructure
EnterpriseSingle-tenant, with VPC peering when your data cannot share a network boundary.
Self-hosted
On-premiseRun the context layer on your own infrastructure, with OpenTelemetry for observability.
The same API, a different mixture
Each of these leads with a different job, pulls from a different set of sources and needs a different call. All of them, by job.
Bring the recommendation that keeps missing.
The one that suggested the thing the customer already returned.