Skip to main content
Blog

How to build shared AI analytics agents in multi-tenant SaaS applications

Artificial IntelligenceReading time 10 min read
How to build shared AI analytics agents in multi-tenant SaaS applications

A SaaS company with 100 customers should not need to maintain 100 independent implementations of the same analytical agent. Most customers ask similar questions about performance, activity and trends. Their underlying data, permissions and definitions of certain metrics may differ considerably, though.

Sharing an agent across customers is an architectural decision about reuse. It does not mean sharing customer data, conversation history or unrestricted access to tools. The challenge is to separate the parts of the agent that represent your product's analytical expertise from the parts that belong to a specific customer.

Here is how to design that separation, decide when customization belongs in a tenant-specific layer and roll out changes without turning every customer into a separate AI project.

What is a shared AI analytics agent?

A shared AI analytics agent is a reusable agent configuration or service that interprets analytical questions and works with governed data on behalf of multiple authorized users. In multi-tenant SaaS, the agent can share behavior and metric contracts while each execution remains scoped to the authenticated customer, user and permitted resources.

The shared elements may include instructions, tool contracts, analytical terminology and evaluation rules. Tenant-specific elements include data connections, access restrictions, custom definitions and conversation state. Sharing an agent never implies that its callers should share access to all the data the service can reach.

Decide what belongs in the shared layer

A product-level agent should understand the common concepts in the application. In a logistics platform, those concepts might include completed deliveries, on-time delivery rates and average transit time. In an HR platform, they could include employee headcount or approved absence requests.

Maintain the shared definitions in a reviewed analytical contract. The contract records the meaning, unit, grain and allowed dimensions of each metric. It also identifies when a metric is unavailable for a particular customer. Treat the contract as a product dependency with a version and owner.

Keep task-specific behavior alongside the contract. An agent may be instructed to clarify the reporting period or avoid drawing causal conclusions from a simple correlation. Those rules apply across customers and should not require duplicated configuration.

Keep tenant-specific context separate

Customers may have different fiscal calendars, data sources, custom fields or preferred terminology. A single global prompt containing every customer's context creates unnecessary complexity and can increase the risk of accidental disclosure.

Use a tenant-aware context resolution layer. After authentication, resolve the applicable dataset mapping, reporting calendar and permitted custom definitions. Give the agent access only to context relevant to that request. If a required mapping is missing, return an explicit limitation rather than guessing.

The article One Semantic Layer, Different Customer Schemas explains how a common analytical contract can coexist with customer-specific data models. Shared agent design uses that contract as a foundation for execution and lifecycle management.

A concrete example

A fictional property management platform offers the same occupancy question to every customer. Customer A stores units and leases in separate tables. Customer B receives occupancy data from a third-party feed. Both need an approved occupancy metric, but the implementation of the metric is different.

The product-level contract defines occupancy for a particular date as occupied rentable units divided by total rentable units under the agreed rules. The customer-specific mapping identifies how to retrieve those values from each source. The agent asks the analytical service for the approved metric rather than selecting arbitrary fields from every connected database.

If Customer B cannot provide historical occupancy snapshots, the agent should explain that limitation when asked for last year's trend. It should not reconstruct a historical series from current occupancy data without a valid basis.

The request lifecycle

A shared agent should operate inside a trusted application workflow. The application authenticates the user and derives tenant identity from its own session or verified credentials. It determines which analytical resources the caller is allowed to use and binds those restrictions to the request.

The agent interprets the analytical intent and selects an approved operation. The execution service validates the operation against the authorized scope and applies the required filters. It returns a bounded result that the agent can explain or visualize. The application records the outcome using an appropriate audit trail.

Do not accept a tenant identifier supplied in a chat message as authorization. A user can legitimately ask to compare business units, but only a trusted authorization service can determine which units they may access.

Use a consistent analytical contract across interfaces

The same customer might access analytics in an embedded dashboard, a conversational assistant and an external AI tool. If each interface calculates revenue differently, the user will spend more time reconciling the results than acting on them.

A common analytical service can support several user experiences while keeping metric definitions consistent. The caller still needs to identify the user and communicate a valid authorization context. Every tool invocation must enforce its own access rules; an approved conversational session does not grant permission to unrelated resources.

Luzmo describes reusable Agents and Knowledge Layer capabilities in its guide to embedded AI analytics. Its October 2026 product release explains the use of agent identifiers across supported chat, API and MCP integrations. That offers a practical configuration reuse pattern to evaluate when building several analytical interfaces.

Sharing configuration is different from sharing a conversation

Conversation history can include customer names, filters, query results and sensitive business questions. Store and retrieve it according to the authenticated user's allowed scope. Apply appropriate retention rules and verify access again when the session resumes.

A shared agent identifier must not function as a universal history key. Use a conversation identity that includes the relevant ownership and authorization boundaries. If a user switches accounts, re-evaluate the scope before allowing access to earlier messages or generated assets.

The same distinction applies to caches. A public metric definition can be reused across customers. A query result containing tenant data cannot be cached globally without a safe design. Partition cached results according to tenant, permission scope, metric version and effective filters. Invalidate entries when those inputs change.

Choose the right customization model

Three architectural patterns are worth evaluating. A single shared configuration works well when most customers use common product terminology and a consistent set of metrics. A shared base with controlled tenant overrides accommodates customer-specific mappings and selected business rules. Separate configurations may be appropriate when customer workflows, permitted tools or regulatory requirements differ substantially.

Do not create a separate agent merely to rename one metric. Equally, do not force two incompatible workflows into a common configuration to reduce maintenance. Choose the smallest shared boundary that can preserve the required behavior and access controls.

Keep overrides typed and reviewable. A tenant-specific reporting calendar is a structured setting, while an unrestricted instruction field can introduce unpredictable behavior. If customers can provide analytical context, treat it as untrusted input and prevent it from changing tool permissions or system-level policies.

Plan for versioning and deployment

Shared configuration has a valuable operational property: a reviewed improvement can reach multiple customers without rebuilding every integration. That same property increases the impact of a faulty change.

Version metric contracts, tool schemas, agent rules and tenant mappings. Test compatibility with the deployed configuration. Roll out changes to a limited cohort before expanding them across all eligible customers. Maintain an explicit rollback path and identify customers requiring special compatibility checks.

For a new metric definition, compare the old and new calculation against known fixtures. Determine whether historical charts, saved reports and agent responses should change together. If a customer-specific override conflicts with the new definition, require an owner to resolve the conflict before activation.

Measure adoption without mixing customer data

Product teams need to know which analytical questions customers ask, where agents fail and which request types cost the most. Aggregate operational metrics under an approved analytics policy, with appropriate controls on access to underlying diagnostic records.

Separate product-wide telemetry from customer-visible analytics. A team may review aggregate latency across the service without exposing any customer's raw query results to another customer. Avoid logging full prompts or tool results when request category and error code are sufficient to diagnose the problem.

Shared infrastructure may improve maintenance economics, but it does not automatically make individual queries cheaper. Review request complexity, retries and actual consumption. The cost of embedded AI analytics is a starting point for modeling the workload.

Test isolation before expanding adoption

Create synthetic tenants with deliberately different reference values. Run identical questions for each tenant and confirm that every response uses the appropriate data. Test role changes, account switching, cached results and generated visualizations. Verify that attempts to request another account's data are rejected at the execution layer.

Then test the shared behavior itself. A new rule defining completed orders should produce the expected results across all eligible mappings. The test suite must catch customer-specific failures as well as global regressions. Use the AI analytics agent testing guide to structure these evaluations.

Who owns the shared configuration?

A shared agent needs an operating model. Product management owns the intended user experience and supported analytical tasks. Data specialists own the metric definitions and the mapping rules. Engineering owns the execution contract and release process. Security specialists review the authorization boundary, particularly when external applications are involved.

Assign a specific owner to each customer-specific override. If a customer changes its accounting calendar or introduces a custom field, the change should enter the same review process as any other analytical dependency. Otherwise a local customization can silently affect later releases.

During onboarding, collect the minimum information needed to resolve the tenant's data correctly. Validate its mapping against representative questions and record the capabilities that remain unavailable. An onboarding process that treats analytical coverage as an explicit contract makes support conversations much easier later.

When a separate agent is the better option

A shared configuration is not a mandatory architecture. A customer operating under a different regulatory regime may require a different set of tools or a different deployment boundary. An internal analyst agent may need capabilities that would be inappropriate for customer-facing users. Separate configurations can simplify the review of those differences.

Before splitting the service, determine whether the distinction is about agent behavior or access policy. If two groups use the same metric definitions and differ only in permitted data, independent execution authorization may be enough. If the workflows require materially different instructions and tools, separate configurations may offer a clearer maintenance boundary.

Implementation checklist for a shared agent

  • A versioned product-level metric contract exists.
  • Tenant mappings and overrides have explicit owners.
  • Identity and permissions are derived from trusted credentials.
  • Each tool validates authorization before executing queries.
  • Context, caches, generated assets and history are scoped appropriately.
  • Configuration changes have regression tests and rollback procedures.
  • Operational telemetry excludes unnecessary sensitive data.
  • Every enabled interface is tested under multiple tenant roles.

Build one analytical foundation with room for customer differences

The appeal of a shared agent is that it allows a SaaS product to evolve its analytical capabilities without creating a permanent maintenance project for every customer. The architecture succeeds when reuse remains separate from authorization and customer-specific data.

Product teams evaluating Luzmo can explore its embedded analytics platform, its semantic layer and the agent integration patterns described in MCP for analytics. Establish the common metric contract and access model first, then test how the platform supports the intended deployment.

Customers should experience an agent that understands their business without seeing the machinery that keeps other businesses separate. Achieving that experience requires explicit boundaries, repeatable evaluation and a configuration lifecycle the product team can maintain as adoption grows.

Written by

Kinga Edwards
10 min read

Ship the future of your data

Let us show you what Luzmo can do for your product.

Rosita Martorana — Luzmo account executive

Book your session with our analytics expert.