Marketing agencies · AI agent

Per-client context for the AI agent

The agent answers about each client using that client's rules and tables, and says it does not know instead of making things up.

UsageWidely used
EffortMedium
ForAgencies that use an AI agent to answer questions about many clients.
Source

Layers per client and context documents

Rule

Resolve the client, route and apply precedence

Outcome

Answer with the client's rules and tables

Activation

AI agent, reports and client service

What it solves

  • The agent never mixes one client's data or rules with another's.
  • Each client is measured by the definition agreed with the agency.
  • When data is missing, the agent says so instead of estimating.

Business questions it answers

Ask your agent these questions once the case is live.

How did client X do in paid media this month?
How many leads did client X get in August and what was the CPL by their rule?
What was client Y's cost per SQL last quarter?
Which of client Z's rules have not yet been validated with them?
Build client X's monthly presentation for the closed month.

What you need

  • Each client's sources connected and organized by layer
  • Each client's definitions: lead, sale, main event, taxes and scope

What you get

  • A routing document per client and platform
  • A global contract with rule precedence
  • An agent that answers by each client's rules
  • The list of what still needs validating with each client

Where to activate

AI agent via MCP

The account manager asks about a client and gets the answer by that client's rules.

On-demand reports

Report templates in the context, filled only with queried data and with questions when something is missing.

Per-client agent

Data sliced by client for an agent that sees only its own dataset.

Ready to build?

Little transformation and a lot of writing. The work is surveying and validating each client's rules; the model repeats for every new client. The detailed view has the business rules, the pitfalls and the acceptance test. Or send everything straight to your agent with the Nekt MCP.

The problem

Each agency client has its own funnel, conversion event, taxes, CRM and vocabulary. Without separate context, the AI agent uses another client's table because the name looks similar, applies the global rule on top of an agreed exception, or estimates a number that does not exist. The answer looks right and reaches the client wrong.

How it is usually done, and the rule

Each row is a mistake that already happened in practice.

The common wayThe rule
01
Infer the client from the table that looks most like the question.
Resolve the client before querying

The order is: 1) client named in the current request; 2) conversation context, only when there is exactly one active client and no ambiguity; 3) otherwise, the client stays unresolved and the agent asks. A question covers one client only. Queries that combine clients only when explicitly requested.

02
One central map with every client, table and rule mixed together.
Routing per client, interpretation in the global docs

Each client has a routing document per platform that states its source, layer and physical tables. That document only resolves where the data lives: it does not redefine KPI, result, grain or deduplication. The global documents say how to interpret the data and hold no client physical names.

03
Apply the global result rule to a client that agreed on a different event.
Written precedence

When two rules conflict, this order applies: 1) explicit user request; 2) validated client rule; 3) global agency rule; 4) generic platform interpretation. A global rule never silently overrides a validated client exception.

04
Copy the join that worked for the neighboring client.
Another client's resource is not evidence

Another client's table is not proof, even with the same name, structure, metrics and connector, or when its document shows up by similarity. Do not reuse a validated join, observed grain or available history from another client.

05
One lead definition for the whole portfolio.
Every term is defined within the client's scope

A lead can be a digital deal created in the CRM, a contact with a valid conversion in marketing automation, or a conversion reported by the platform when there is no CRM. The same word (lead, MQL, sale) changes from client to client. Use the vocabulary of the report the client already receives and write the definition in their document.

06
A rule surveyed by the agency presented as agreed with the client.
Every document has a status, owner and date

Fixed header: STATUS (validated, partially validated, surveyed in the data and not validated), scope, owner and date of last review. When answering with an unvalidated rule, the agent warns that the rule is the agency's and is pending validation with the client.

07
ROI calculated with the company's entire revenue.
What is out of scope is written down

Declare what is not part of the analysis: a reactivation funnel built from imports, revenue from the old customer base when the agency only handles the new slice, the client's own campaigns in the shared account. Never divide the client's total revenue by the agency's budget.

08
Estimate sales from platform conversions.
No data means the answer is that there is no data

A client with no CRM connected has no sales, MQLs or close rate in the data: the right move is to say so, not to approximate. No number is estimated, rounded for convenience or inferred. If a report is missing information, the agent asks before filling it in.

09
Answer about the portfolio with the number written in the document.
An old count loses to the query

Rules are stable; counts (active clients, layers, connectors) are a snapshot of a date and go stale within days. If a number in the document diverges from the query, the query is the truth. Before flagging a divergence, check the date of the source's last run.

10
A long document that depends on the previous paragraph.
Write for reading in chunks

The agent may retrieve only an excerpt. Each block must stand on its own: a descriptive title with the client's name, one concept per block, terms defined before they are used, and explicit references to table and field.

Who wins when two rules conflict

From strongest to weakest. With no resolved client, none apply.

1stExplicit user requestin this conversation
2ndValidated client ruleSTATUS: VALIDATED
3rdGlobal agency ruleglobal semantic contract
4thGeneric platform interpretationconnector default
No clientAsk before answeringclient_scope unresolved

Definitions

Client scope
exactly one client per question; combine clients only on explicit request
Routing document
one per client and platform; lists source, layer and physical tables; does not define metrics
Global document
interpretation rule valid for the whole portfolio until replaced by a validated exception
Validated exception
client rule confirmed with the client, with an owner and review date; beats the global rule
Unvalidated rule
surveyed in the data by the agency; can be used, always with the pending warning
Lead (per client)
the definition declared in the client's document; the agency has no universal definition
Out of scope
data present in the warehouse that is not part of the client's analysis, listed in the overview document

Pitfalls that already happened

The neighbor's table

Clients with tables sharing the same connector prefix and similar names led the agent to answer with another client's data.

Routing per client and a written ban on using another client's resources.

Global rule on top of the exception

A client that agreed on a custom event as the result got a CPL calculated from the global rule's standard lead.

Precedence in the global document and the exception marked as validated.

Made-up ROI

Almost all of the client's revenue was repeat purchases from the existing base; dividing it by the media budget produced an absurd return. Revenue coming from marketing was a tiny fraction.

Written scope: only revenue from people who were marketing leads counts.

Estimated sales without a CRM

For a media-only client, the agent approximated sales from platform conversions.

An overview document stating that the question has no answer in the data.

Context generated by automation without curation

Documents written by an agent showed up duplicated, with test probes and a "generic market overview" in the middle of the client's context; the generic benchmark became the answer.

Automation only updates marked blocks; generic content stays out of the client document.

Inventory that goes stale

Layers and connectors changed within a few days and the warehouse copy of the portfolio lagged by up to 24 hours; the document and the query diverged.

A date on every count and the query as the truth.

Acceptance test

The case is done when every item passes.

Agent package

Paste into Claude, ChatGPT or any client with the Nekt MCP connected.

Full Markdown
Per-client context contract
- Every question covers exactly one client. Resolve in this order: client named in the request; conversation context only if there is a single active client; otherwise, ask which client it is.
- Never pick a client by similar name, same platform or similar tables.
- The physical location (source, layer, tables) comes from the "<client> Routing" document for each platform. The global documents say how to interpret, not where the data is.
- Another client's resource is not evidence, even with the same table, metric and connector.
- Precedence: 1) explicit user request; 2) validated client rule; 3) global agency rule; 4) generic platform interpretation. A global rule never overrides a validated exception.
- Lead, MQL, SQL and sale are defined in each client's document. Use that client's definition.
- If the rule used has status "not validated", say the rule is the agency's and is pending with the client.
- With no connected data (e.g. a client with no CRM), say the question has no answer in the data. Never estimate.
- Counts written in the documents are a snapshot of a date; if they diverge from the query, the query wins.
- Combine clients in one answer only when the user explicitly asks.
Per-client exceptions:
- <client>: lead = <definition>; status: <validated | not validated> on <date>.
- <client>: out of scope: <funnel, revenue or campaigns that are excluded>.
- <client>: no CRM connected; sales and MQL questions have no answer in the data.

Variations

Physical isolation

One table or layer per client for agents exposed to the end client; in the notebook, literal table names per client.

Shared source

Multi-client sources (Google Business Profile, Business Manager) filtered by the client identifier declared in the document.

Agency as a client

The agency itself, analyzed as a client, sits in a scope separate from the global rules it maintains.