Context Memory

6 min read

This feature is currently in BETA with release 2026.32. It may change significantly before general availability. Documentation may lag behind feature updates. Use in production environments at your own discretion. Context Memory requires activation via feature flag (see Feature Flags below).

For the end-user explanation of context memory and its behavior in chat, see Context Memory in Unique AI Chat.

Functionality

Context Memory gives every user a single, persistent memory profile shared across all chats and all Unique AI spaces where the feature is enabled. The profile is a compact, structured Markdown file that captures durable user context: identity, communication preferences, work context, skills, recent topics, and open follow-ups.

The Unique AI orchestrator loads the profile before a turn and maintains it after the answer:

  1. Load. A Loading context memory step is opened in the chat, and the orchestrator resolves the user's private memory folder and downloads memory.md if present. A profile already within the configured token budget is used unchanged; an oversized profile is first condensed by a language-model call and only hard-truncated if it is still too large. If the folder or file cannot be resolved, the turn continues without memory. If the load fails outright, the step is closed as failed and the turn still continues without memory.

  2. Inject. Non-empty memory is injected verbatim into the system prompt under “What I know about you”. If no profile exists yet, this section is omitted.

  3. Answer. The assistant can use the profile to adapt tone, examples, and depth. It cannot update memory during the answer.

  4. Memory Update. When an update of the user memory is required, a postprocessor starts and sends the existing profile and latest user/assistant exchange to the effective memory model, which returns an updated rewritten profile.

Storage Model and Access Control

Memory profiles are stored in the company Knowledge Base as Markdown:

user-memory/            ← company-wide root folder (auto-provisioned)
  <userId>/             ← private per-user folder (created on first use)
    memory.md           ← the user's single memory profile

Level

Access

user-memory root folder

Created automatically when a space admin enables context memory. The company Root Group is granted READ and WRITE, but not MANAGE, so users can create private child folders.

user-memory/<userId>

Created on demand with access inheritance disabled. The owning user receives access; Root Group access on the parent does not flow into the child. Other users cannot read the profile.

memory.md

Uploaded with SKIP_INGESTION and hideInChat: true. It is not indexed for search. The same logical file is upserted on every update.

Because there is exactly one memory file per user, every enabled space loads the same profile. Memory belongs to the user, not to a space or chat.

Memory Profile Format

The profile has YAML frontmatter followed by six fixed Markdown sections in the order below. Empty sections use _(empty)_.

Example memory.md

markdown
---
user_id: user_123
schema_version: 1
last_updated: 2026-06-17T12:00:00+00:00
turn_count: 12
---

# User Memory

## Identity
- Works as a credit risk analyst at a Swiss private bank, based in Zurich (CET).
- Native German speaker; communicates with the assistant in English.

## Communication Preferences
- Prefers concise answers with concrete examples.
- Wants tables for numeric comparisons instead of prose.

## Work Context
- Preparing the quarterly IFRS 9 impairment report.
- Migrating team reporting from Excel to a Python-based pipeline.

## Skills & Expertise
_(empty)_

## Recent Topics
- 2026-06-17 11:40 UTC: Discussed expected-credit-loss staging rules.

## Follow-ups
- Wants to revisit the scenario-weighting approach next week.

Frontmatter Fields

Field

Meaning

user_id

The owning user's ID. Preserved across automatic rewrites and hidden from the in-product editor.

schema_version

Profile schema version, currently 1. Preserved across rewrites.

last_updated

UTC timestamp of the last automatic consolidation that changed the profile.

turn_count

Incremented by one on each automatic rewrite.

Sections and Their Meaning

Section

What it captures

## Identity

Stable facts such as name, role, employer, team, timezone, and language.

## Communication Preferences

Preferred style, formatting, depth, tone, language, and examples.

## Work Context

Current focus areas, active projects, multi-week goals, and deadlines.

## Skills & Expertise

Competences, tools, languages, and proficiency levels.

## Recent Topics

Recently discussed subjects, dated with YYYY-MM-DD HH:MM UTC:.

## Follow-ups

Explicit hand-offs and topics the user wants to revisit.

Configure Context Memory for a Space

Context memory is configured per space and applies to Unique AI spaces.

  1. Enable the feature flag. FEATURE_FLAG_ENABLE_CONTEXT_MEMORY_UN_22033 must be enabled for the company.

  2. Open the Space configuration and go to the Configuration step, where the Context memory switch sits alongside the other general space settings. The switch is hidden entirely while the feature flag is off.

  3. Toggle “Context memory”. Newly created spaces start with the switch on while the feature flag is enabled. For every space the setting is opt-in at runtime: an absent key means memory stays off until the space is saved with the switch on.

  4. Save the space. When memory is effectively enabled, the admin app ensures the company-wide user-memory root exists.

image-20260804-194210.png

Context memory and Web Search are mutually exclusive by default. If Web Search is enabled for the space, the Context memory switch is disabled with this tooltip:

Context memory is unavailable while web search is enabled, to keep user data out of external search queries.

Operators can lift the restriction per company with ALLOW_CONTEXT_MEMORY_WITH_WEB_SEARCH_UN_22591. This is an operator environment setting, not a configuration-backend registry flag, and must be set consistently on node-chat and admin-app.

image-20260712-193633.png

User-Level Opt-Out

Each user controls context memory in Settings → Context Memory. Disabling it sets the user's allowUserMemory preference to false, so memory is neither loaded nor updated in any space for that user.

Current behavior: disabling does not delete the stored memory.md. Re-enabling makes the existing profile available again. The current settings copy that promises permanent deletion does not match the implementation.

image-20260720-134841.png

Viewing and Editing a Profile

When enabled, Settings → Context Memory loads the authenticated user's existing memory.md. When no profile exists yet, opening the page seeds an empty one, creating the private user folder and an empty memory.md, as long as the company user-memory root can be resolved or the caller is a chat admin who can provision it. If the root is missing and the caller is not a chat admin, nothing is created and the page shows the empty state.

Effective Enablement

Context memory is active for a turn only when every applicable condition below holds:

Condition

Level

Default

FEATURE_FLAG_ENABLE_CONTEXT_MEMORY_UN_22033 enabled for the company

Operator

Off

Space allowUserMemory is explicitly true

Space admin

On for newly created spaces while the feature flag is on; an absent key means off

Web Search disabled, or ALLOW_CONTEXT_MEMORY_WITH_WEB_SEARCH_UN_22591 enabled

Space admin / operator

Web Search blocks memory

User allowUserMemory not explicitly false

End user

Enabled

Advanced Configuration

Consolidation is configured per space under Unique AI Services → Context Memory in the assistant's advanced module configuration.

Setting

Default

What it controls

Use Orchestrator Language Model

true

Uses the orchestrator model for the gate, consolidation, condensation, and matching tokenization. When false, the configured Language Model is used.

Language Model

AZURE_GPT_4o_2024_1120, unless the DEFAULT_LANGUAGE_MODEL environment variable overrides the platform default

Used when Use Orchestrator Language Model is false.

Max Tokens

2000 (500–8000)

Maximum runtime profile size. Oversized profiles are condensed and then hard-truncated if necessary.

Consolidation Gate Enabled

true

Runs a cheap UPDATE/NOOP decision before the full rewrite. Disable it to run full consolidation after every non-empty turn.

image-20260804-194508.png

Token Usage and Analytics

Every language-model call the feature makes is attributed to its own invocation source, so memory cost can be separated from the cost of the answer itself:

Invocation source

When it runs

user_memory_gate

The UPDATE/NOOP decision after the answer. Capped at a few output tokens.

user_memory_consolidation

The full profile rewrite.

user_memory_load_condense

Condensing a stored profile that is already over budget when it is loaded.

user_memory_post_consolidation_condense

Condensing a freshly rewritten profile that came back over budget.

Each turn also records a context_memory_updated analytics flag: unset when the postprocessor did not run, false when it ran without writing, and true when a changed profile was uploaded.

Limitations

  • One memory per user, company-wide. There is no per-space or per-chat profile.

  • Not editable during a response. Automatic updates occur after the final answer. Users can separately edit and save the profile in Settings.

  • Web Search exclusivity. The features are mutually exclusive by default.

  • Token budget. Older or low-signal material can be compacted or dropped.

  • Opt-out is not deletion. The current implementation retains the file when the user disables memory.

Feature Flags and Company Settings

Name

Default

Effect

FEATURE_FLAG_ENABLE_CONTEXT_MEMORY_UN_22033

false

Per-company master switch from the feature-flag registry. It enables the space toggle, user Settings tab, and allowUserMemory payload wiring. Supports registry targeting by company.

ALLOW_CONTEXT_MEMORY_WITH_WEB_SEARCH_UN_22591

false

Operator environment override that allows memory and Web Search together. Accepts true, false, or comma-separated company IDs and must be configured on node-chat and admin-app.

Last updated