Skip to content

How the Context System Works

The user-facing guide for context lives at The Context System. This page covers what happens under the hood: how Aliveo combines Global, Org, and Account context into the effective prose an agent reads, and how that prose reaches the AI.


Three Stores, One Tree

Context is persisted in three independent stores:

  • Global Context — a single record per organization.
  • Org Context — one record per line of business.
  • Account Context — one record per integration (or group of integrations) within a business.

Each record stores its own natural-language prose, an inheritance flag (whether to build on its parent), and who saved it and when. The three layers form a tree: account points to its business, business points to global.

Effective Prose Is Built When You Save

When you save context at any layer, Aliveo builds that layer's effective prose straight away:

  1. Start with the text you wrote for this layer.
  2. If inheritance is on, put the parent's effective prose in front of it. An account's effective prose therefore reads global → org → account.
  3. Pull out a short set of structured settings from the result, such as the day your week starts, your fiscal year start, your timezone, default lookback and trend granularity, preferred tone, and your own terminology.
  4. Store the effective prose and the settings with the record.

The order matters: more specific context comes after broader context, so when rules conflict, the AI gives the more specific one more weight. If you turn inheritance off for a layer, its effective prose is its own text only.

Cascading Saves

Saving a parent layer automatically refreshes the children that inherit from it:

  • Saving Global Context rebuilds every org and account that inherits.
  • Saving Org Context rebuilds every account in that business that inherits.

The refresh runs in the background, so the save returns immediately. Children with inheritance turned off are left as they are.

What Happens When You Ask

At request time, nothing is recombined. For each account in scope, Aliveo picks the most specific layer that has text of its own (account, otherwise org, otherwise global) and uses that layer's stored effective prose and settings in full. Because the broader layers were built into it at save time, nothing from them is lost.

On top of that:

  • Rules in your question apply as well. If you say "use gross revenue for ROAS" in a chat, that override applies on top of your saved context for the conversation.
  • Datasets you @-mention in saved context are loaded alongside the account's own data, just as if you had @-mentioned them in the question.
  • Knowledge documents you @-mention, in saved context or in your question, are searched, and only the passages that best match your question are added.

Provenance

Every save records who saved the layer and when. This powers the "Last saved … by …" line on each context page. When a layer is rebuilt by a cascade, it records the person who saved the parent.

How Context Reaches the Agent

When a chat or automation agent session starts:

  1. The scope of the session (active org, selected accounts, @-mentions) is resolved.
  2. For each account in scope, the stored effective prose and settings are read.
  3. @-mentioned datasets are loaded, and the relevant passages of @-mentioned documents are retrieved.
  4. The analysis agent receives all of this as part of its instructions, together with each account's data model, and uses it to plan, write code and frame the answer (see The Analysis Agent).

This is why a chat at the org level can frame an answer slightly differently from the same question scoped to a single account: different scope, different effective prose.

Multiple accounts in one session

A single chat can span several accounts at once, even across different platforms (for example Google Ads + Meta + Apple Search Ads). When it does, the effective prose for every account in scope is included, so each account keeps its own definitions and exclusions.

Scope is expressed as context chips (accounts, data context, grouping, date range) that stay editable for the whole conversation. Changing the chips mid-chat picks up the context for the new scope on the next turn. See Starting a Chat for the chip UI.


Putting It Together

The context system is layered to mirror how real organizations work: shared vocabulary lives once at the top, teams add their playbooks, and individual accounts attach the truly bespoke exceptions. Because each layer's effective prose is built when you save, every question gets the full, up-to-date context for its scope without any extra work at request time. For how Aliveo understands the data itself (KPIs, column descriptions, campaign tags), see How Aliveo Understands Your Data.