Designing a Federated Context Layer for Enterprise AI Agents

Designing a Federated Context Layer for Enterprise AI Agents

AI agents are good at writing SQL. They’re bad at knowing what your company means by “revenue”, “active customer” or “South region”. The fix is an ontology: a map from business words to the data behind them. Tools like NVIDIA’s open-source Auto Ontology can draft one for a database. But a real company isn’t one database. Picture 1,000 people, dozens of teams, data across Azure, AWS and GCP. Who draws the map?

AI 智能体擅长编写 SQL,但它们并不了解贵公司对“收入”、“活跃客户”或“南部地区”等术语的定义。解决办法是建立本体(ontology):即业务术语与底层数据之间的映射。像 NVIDIA 开源的 Auto Ontology 这样的工具可以为数据库起草一份本体,但真正的公司并非只有一个数据库。试想一下,1000 名员工、数十个团队,数据分布在 Azure、AWS 和 GCP 上,谁来绘制这张地图呢?

This is a rough idea, not a finished design. I’d like to know where it breaks. The core idea: federated ownership. One central team can’t map the whole company. They don’t know the streets. So split the work: Teams own meaning. Each team defines its own terms. A platform team owns the rules. Format, checks, storage, access and serving.

这只是一个粗略的想法,而非最终设计。我想知道它在哪些地方会行不通。核心理念是:联邦式所有权。一个中心化团队无法映射整个公司,因为他们不了解具体业务。因此,需要分工:由各团队负责定义业务含义,每个团队定义自己的术语;由平台团队负责规则,包括格式、检查、存储、访问和分发。

None of this is new on its own. Federated ownership is the data mesh idea, and data catalogs and Palantir’s Ontology cover similar ground. What I’m exploring is applying it to agent context.

这些概念本身并不新鲜。联邦式所有权是数据网格(data mesh)的核心思想,而数据目录和 Palantir 的本体论也涵盖了类似领域。我所探索的是将其应用于智能体上下文。

The layers, bottom to top:

  1. Sources (multi-cloud): Azure Synapse and SQL, AWS Redshift and S3, GCP BigQuery, plus SaaS and documents. Data stays where it is.
  2. Sync workers: They run when a schema changes, with a nightly sweep as a backstop. They detect drift (a renamed column, a new table) and draft updates for the owning team. They never certify anything. A script can notice that a table changed. It can’t decide what a business term should mean.

各层级(从底层到顶层):

  1. 数据源(多云):Azure Synapse 和 SQL、AWS Redshift 和 S3、GCP BigQuery,以及 SaaS 和文档。数据保留在原地。

  2. 同步工作流:在架构变更时运行,并以每晚扫描作为兜底。它们检测偏差(如重命名的列、新表)并为所属团队起草更新。它们从不进行认证。脚本可以发现表发生了变化,但无法决定业务术语的含义。

  3. Team maps: Each team maintains its own part of the map, starting from an org-provided skeleton. One entry looks like this: term: sales.active_customer definition: “Customer with ≥1 delivered order in last 90 days” maps_to: [sales.customers, sales.orders] use_when: “Questions from Sales about pipeline and account activity” owner: sales-ops@company.com status: certified review_by: 2027-03-01 access: [sales, finance, leadership]

  4. 团队地图:每个团队维护地图的各自部分,从组织提供的框架开始。一个条目示例如下: 术语:sales.active_customer 定义:“在过去 90 天内至少有 1 笔已交付订单的客户” 映射至:[sales.customers, sales.orders] 使用场景:“销售部门关于销售渠道和账户活动的提问” 所有者:sales-ops@company.com 状态:已认证 审核日期:2027-03-01 访问权限:[销售, 财务, 领导层]

  5. Review gate: Automated checks: format, broken links, PII, duplicate or conflicting terms. The team head approves changes in their own domain. The global team approves only shared terms and resolves conflicts.

  6. Global context registry: The org-level map: core skeleton plus linked team maps, versioned and namespaced. sales.revenue and finance.revenue can both exist, each with a “when to use this” rule. Stored in Postgres with pgvector for search and a graph for relationships.

  7. 审核门禁:自动化检查格式、断链、个人隐私信息(PII)、重复或冲突的术语。团队负责人批准其领域内的变更,全局团队仅批准共享术语并解决冲突。

  8. 全局上下文注册表:组织级地图,包含核心框架和关联的团队地图,支持版本控制和命名空间。sales.revenue 和 finance.revenue 可以共存,每个都有“何时使用”的规则。存储在 Postgres 中,利用 pgvector 进行搜索,并使用图数据库处理关系。

  9. Context gateway: One entry point for every agent, over MCP or an API. It checks the user’s identity (SSO) and filters context by their permissions before the model sees anything. It also knows who is asking and from where: a Sales user gets the Sales definition, and the answer says which definition it used.

  10. Agents and models: Agents call models through one AI gateway that routes to Azure AI Foundry, AWS Bedrock or Google Vertex AI. Live numbers are still queried at question time, as the asking user.

  11. 上下文网关:所有智能体的统一入口,通过 MCP 或 API 提供。它在模型接收信息前检查用户身份(SSO)并根据权限过滤上下文。它还能识别提问者及其来源:销售人员会获得销售部门的定义,且回答中会注明所使用的定义。

  12. 智能体与模型:智能体通过统一的 AI 网关调用模型,该网关路由至 Azure AI Foundry、AWS Bedrock 或 Google Vertex AI。实时数据在提问时以提问用户的身份进行查询。

The hard parts (they aren’t technical): Conflicts. Keeping both definitions with usage rules works for team questions. The part I haven’t solved: when the CEO asks “what’s our revenue?”, which definition is the default? Freshness. Every term needs an owner and a review date, or the map turns into a stale wiki. Permissions. HR’s terms should never appear in a sales user’s answer. Filter before retrieval, not after. Motivation. Teams keep their maps updated only if it’s part of their goals, or if agents visibly fail without it.

难点(并非技术问题): 冲突:保留两种定义及其使用规则对团队内部提问有效,但我尚未解决的问题是:当 CEO 问“我们的收入是多少?”时,哪种定义是默认的? 时效性:每个术语都需要所有者和审核日期,否则地图会变成过时的维基页面。 权限:人力资源的术语绝不应出现在销售人员的回答中。必须在检索前过滤,而不是检索后。 动力:只有当更新地图成为团队目标的一部分,或者智能体因缺乏更新而明显失效时,团队才会保持地图更新。

Start small: Don’t launch the platform for 100 teams. Start with one team and one agent, prove the answers improve, then let other teams join because they want to. The model can already drive. The question is whether your company has a map, and who keeps it up to date. Where would this break? I’d like to hear from people who’ve tried something similar.

从小处着手:不要一次性为 100 个团队发布平台。从一个团队和一个智能体开始,证明回答质量有所提升,然后让其他团队自愿加入。模型已经具备了驱动能力,问题在于你的公司是否有地图,以及谁来负责更新。这套方案在哪些地方会失效?我很想听听尝试过类似方案的人的反馈。