Brand Memory — Anomalia Docs
Search docs… &Cmd;K
Docs/Brand Memory

Brand Memory

The shared nervous system between all of Anomalia's AI subsystems. Every fact the chatbot has learned, every constraint the user has stated, every insight from competitor research — they all live here, and every future prompt reads them.

Memory entry structure

FieldWhat it is
categoryvoice · constraint · fact · preference · insight
keyShort snake_case identifier (e.g. brand_tone)
valueOne-sentence fact
sourcechat · research · onboarding · user · analysis
confidence0.0 — 1.0
times_reinforcedHow many times confirmed
layersession · project · global

buildMemoryContext() loads all entries with confidence ≥ 0.4, groups by category, and formats as a ## BRAND MEMORY section appended to every profile's ai_context.

Who writes to memory

SourceWhenConfidence
User (chat tool / Studio)Explicit instruction1.0
Chat auto-extractionEvery chat turn (fire-and-forget)0.5–0.9
Caption edit learningUser edits an AI caption before approving0.8–1.0
Competitor researchAfter strategy report0.7–0.8
Weekly reflectionMonday retrospective0.6
OnboardingAfter context synthesis0.8
Caption edit learning is the purest voice signal. When the user shortens a caption, removes emoji, or changes the tone — that diff is analysed for generalisable rules ("Keep captions under ~3 short sentences"). The edit is the signal, not what the user says they want.

Write behaviour: upsert on (brand_id, key). Same key = reinforce (bump confidence +0.05, increment counter). New key = insert.

Conflicts: when two sources register contradictory info, both coexist. The chatbot surfaces the conflict to the user for resolution.

Dream: weekly maintenance

A weekly cron runs runDream() across all brands:

  • Decay — entries not reinforced in 30 days lose confidence (−0.1, floor 0.3)
  • Archive — entries below 0.3 confidence or expired are deleted
  • Promote — session-layer entries reinforced 3+ times become project-level

This is how Anomalia gets better week after week instead of staying frozen. The user experiences it as "Anomalia knows me" — it remembers their voice preferences, constraints, and what works.