Use case · Games & companions

Characters that remember the player

A character that forgets you betrayed it last night is a vending machine with dialogue. Players notice within one session.

The mixture

01 · Persistent memory
Leads
02 · Current context
Uses
03 · Traceable decisions
Light
04 · Shared context
Uses
05 · Scoped retrieval
Uses
01 · What breaks

The world forgets on logout

Generative dialogue makes characters sound alive. Memory is what makes them feel alive, and it is usually the missing half.

  1. 01

    Choices do not carry

    The player spared the smuggler in chapter two. In chapter four the smuggler greets them as a stranger, because the choice lived in a save flag nobody wrote into the character's context.

  2. 02

    Lore drifts

    Writers updated the faction history in the bible. The dialogue agent still answers from the old draft, and the community wiki notices before the studio does.

  3. 03

    Every player gets the same character

    Without per-player memory, a companion cannot grow a relationship. It can only replay a script with more expensive text.

02 · What it's made of

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.

Leads · Persistent memory

What the user told you once stays told

Each player has a durable memory per character: what they did, what they said, what the character thinks of them. It is written as it happens and read at the start of every conversation.

  • Choices shape later dialogue.
  • Relationships persist across sessions.
  • Memory is per player, per character.

Uses · Current context

The canon in force

Superseded lore drafts are subtracted, so characters speak from the current bible.

Uses · Scoped retrieval

What this character would know

Retrieval is scoped to the character's faction and location, so the blacksmith does not know the king's secrets.

Uses · Shared context

The party remembers together

In multiplayer, a shared event is written once and read by every character who witnessed it.

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.

03 · What feeds it

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.

Lore bible (Google Docs)Quest scriptsPlayer eventsDialogue logsGame telemetryDiscord
  1. 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.add
    import AlchemystAI from "@alchemystai/sdk";const client = new AlchemystAI(); // reads ALCHEMYST_AI_API_KEYawait client.v1.context.add({  context_type: "resource",  scope: "internal",  source: "lore-bible",  documents: [{    content: "The Harbor Guild controls the eastern docks. Its leader, Mara Venn, distrusts anyone carrying a Crown seal.",  }],  metadata: {    fileName: "factions-harbor-guild-v3.md",    groupName: ["lore", "harbor_guild"],   // the sets this belongs to  },});
  2. 02 · Write

    Write what the player did

    The relationship is built from moments. Write each one against the player and the character, and the next conversation starts from where they left it.

    context.memory.add
    await client.v1.context.memory.add({  sessionId: "player_90412:mara_venn",  contents: [    { role: "user", content: "I'll keep your secret. I never saw the ledger." },    { role: "assistant", content: "Then you have a friend on the docks. Do not make me regret it." },  ],  metadata: { groupName: ["lore", "harbor_guild", "player_90412"] },});
  3. 03 · Search

    Search before the character speaks

    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.search
    const { contexts } = await client.v1.context.search({  query: "Player returns to the docks after siding with the Crown",  scope: "internal",  mode: "fast",  similarity_threshold: 0.8,  minimum_similarity_threshold: 0.5,  metadata: { groupName: ["lore", "harbor_guild"] },   // ∩ 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.

04 · Where it runs

Latency is the budget

Dialogue has to land inside a budget players will not forgive. Use fast search mode for in-conversation lookups, keep scopes tight, and keep per-player memory deletable when an account is closed.

Security & compliance
Deployment
  • Managed cloud

    Encrypted in transit and at rest, isolated per organization, and scoped at write time.

  • Dedicated infrastructure

    Enterprise

    Single-tenant, with VPC peering when your data cannot share a network boundary.

  • Self-hosted

    On-premise

    Run the context layer on your own infrastructure, with OpenTelemetry for observability.

Talk to us

Bring the character players say feels hollow.

The one that forgot what happened an hour ago.