Skip to main content

I’ve been thinking about a gap in the way we discuss graphs in AI. Most of the conversation starts after the graph already exists. We talk about graph neural networks, GraphRAG, graph agents, and graph foundation models. We spend much less time on the step that determines what all of them can do: turning raw data into the right graph.我一直在思考我们在讨论 AI 中的图时存在的一个缺口。大多数对话都是在图已经存在之后才开始的。我们谈论图神经网络、GraphRAG、图智能体和图基础模型。但我们花在决定这一切功能基础的步骤上的时间却少得多:即如何将原始数据转化为正确的图。

Suppose an organization has customer records in tables, support conversations in documents, product telemetry in event streams, and incident histories in tickets. Before any of this can be used as a graph, someone has to decide what counts as an entity, what a relationship means, how time is represented, and which source to trust when records disagree. These choices shape every prediction, retrieval result, and agent decision that follows.假设一个组织拥有表格形式的客户记录、文档中的支持对话、事件流中的产品遥测数据以及工单中的事件历史记录。在将这些内容用作图之前,必须有人决定什么算作实体、关系的含义是什么、如何表示时间,以及当记录不一致时该信任哪个来源。这些选择决定了随后的每一次预测、检索结果和智能体决策。

This is what I mean by graph-native AI. It’s an approach that treats graph modeling as a first-class stage between raw data and the different systems that may use it. The graph isn’t simply an input to one model. It becomes a shared representation that can support queries, prediction, retrieval, agents, and, potentially, foundation models.1这就是我所说的“图原生 AI”。这是一种将图建模视为原始数据与可能使用它的不同系统之间关键阶段的方法。图不仅仅是某个模型的输入,它成为了一种共享的表示形式,可以支持查询、预测、检索、智能体,以及潜在的基础模型。1

A graph is a model of the data图是数据的一种模型

At its simplest, a graph consists of nodes and edges, which may also carry features. Real systems also need types, timestamps, provenance, confidence, permissions, and other context. Describing the finished graph tells us very little about how we should get there.简单来说,图由节点和边组成,它们可能带有特征。真实的系统还需要类型、时间戳、来源、置信度、权限和其他上下文。描述最终的图并不能告诉我们应该如何达到目标。

Take customer-support data as a simple example. Should a company be represented as one node or as a set of legal entities that changes over time? Should an email be an edge between two people, a document node connected to its authors, or evidence for claims extracted from the text? Is a purchase an ongoing relationship or an event with a timestamp? If two records refer to the same customer, should we merge them, link them as possible matches, or keep them separate?以客户支持数据为例。公司应该被表示为一个节点,还是随时间变化的法律实体集合?电子邮件应该是两个人之间的边、连接到作者的文档节点,还是从文本中提取出的索赔证据?购买行为是一个持续的关系,还是一个带有时间戳的事件?如果两条记录指向同一个客户,我们应该合并它们、将它们作为可能的匹配项链接起来,还是将它们分开?

There’s no single answer. An entity graph may be useful for identity and relationships. An event graph may be better for process and temporal analysis. An evidence graph may be better for retrieval and provenance. The right choice depends on what we want the system to do.没有单一的答案。实体图可能对身份和关系有用。事件图可能更适合流程和时间分析。证据图可能更适合检索和溯源。正确的选择取决于我们希望系统完成什么任务。

The step before graph learning图学习之前的步骤

Graph representation learning normally starts with an existing adjacency structure. Embeddings learn vectors for nodes. Graph neural networks pass information across neighborhoods. Autoencoders reconstruct structure or attributes. Graph transformers combine local graph structure with longer-range attention. These methods ask: Given this graph, how should we learn from it?2 Graph modeling asks the question before that: What should the nodes and edges be?图表示学习通常从现有的邻接结构开始。嵌入(Embeddings)学习节点的向量。图神经网络在邻域间传递信息。自编码器重构结构或属性。图 Transformer 将局部图结构与更长距离的注意力机制相结合。这些方法问的是:给定这个图,我们应该如何从中学习?2 图建模问的是在此之前的问题:节点和边应该是什么?

Relational deep learning makes this distinction concrete. It maps rows in relational tables to nodes and primary-foreign-key links to edges, producing a temporal heterogeneous graph that a GNN can learn from. This can remove a good deal of manual joining and feature engineering. It also makes an assumption that deserves attention: A database schema designed for storage and transactions is also a useful graph for machine learning.3关系深度学习使这种区别变得具体。它将关系表中的行映射为节点,将主外键链接映射为边,从而生成一个 GNN 可以学习的时间异构图。这可以消除大量的手动连接和特征工程。它也做出了一个值得关注的假设:为存储和事务设计的数据库模式,同样也是用于机器学习的有用图。3

Recent work tests that assumption across 26 relational tasks. Graphs derived directly from database schemas sometimes suffered from information overload and semantic fragmentation. The authors improved performance by adapting the structure: removing distracting connections and adding dependencies that the original schema did not capture. I find this result important because it makes the graph itself part of the learning problem. Adding more edges is not always helpful. What matters is whether the structure supports the reasoning required by the task.4最近的研究在 26 个关系任务中测试了这一假设。直接从数据库模式导出的图有时会遭受信息过载和语义碎片化的困扰。研究人员通过调整结构改善了性能:移除干扰连接,并添加原始模式未捕获的依赖关系。我认为这一结果很重要,因为它使图本身成为了学习问题的一部分。添加更多的边并不总是有帮助的。重要的是结构是否支持任务所需的推理。4

Graph construction therefore needs its own evaluation loop. We can generate a few plausible graph views, test them against the downstream task, inspect failures, and revise the structure. We should also keep provenance and uncertainty so that we know where an edge came from and how confident we are in it. The first graph we can extract is rarely the only graph worth considering.因此,图构建需要其自身的评估循环。我们可以生成几个合理的图视图,根据下游任务测试它们,检查失败原因,并修改结构。我们还应该保留溯源和不确定性信息,以便了解边的来源以及我们对其的置信度。我们提取出的第一个图很少是唯一值得考虑的图。

What the graph can support图可以支持什么

Once the graph has been modeled and checked, several paths open. I don’t think this means every application should use one enormous universal graph. A more practical design is to build several governed views from the same modeled data while keeping identity, evidence, time, and access rules consistent underneath. Here are five ways to use graphs in an AI application.一旦图被建模并经过验证,几条路径就会打开。我不认为这意味着每个应用程序都应该使用一个巨大的通用图。一种更实用的设计是从相同建模数据中构建多个受管视图,同时在底层保持身份、证据、时间和访问规则的一致性。以下是在 AI 应用程序中使用图的五种方式。

  • Query and analytics: A graph database and ordinary graph algorithms may already be enough. Traversals, path queries, neighborhood aggregation, centrality, and community detection can reveal relationships that are awkward to see once the data is flattened into rows. This is also a useful baseline: If a deterministic query answers the question, there is no need to start with an LLM.查询与分析:图数据库和普通的图算法可能已经足够。遍历、路径查询、邻域聚合、中心性计算和社区检测可以揭示当数据被扁平化为行时难以察觉的关系。这也是一个有用的基准:如果确定性查询能回答问题,则无需从 LLM 开始。
  • Prediction and graph representation learning: Embeddings, GNNs, graph autoencoders, and graph transformers can make predictions at the node, edge, subgraph, or whole-graph level. Common examples include fraud detection, recommendation, molecular-property prediction, and link prediction. Here, the graph gives the model an explicit view of which entities are related and how information should move between them.预测与图表示学习:嵌入、GNN、图自编码器和图 Transformer 可以在节点、边、子图或全图级别进行预测。常见的例子包括欺诈检测、推荐、分子属性预测和链接预测。在这里,图为模型提供了哪些实体相关以及信息应如何在它们之间移动的显式视图。
  • Retrieval and GraphRAG: In this case, the graph is used as an index rather than as training data. Microsoft’s GraphRAG work builds an entity graph and community summaries to answer broad questions over a corpus that ordinary chunk retrieval may handle poorly.5 Other approaches retrieve a task-specific subgraph and pass it to an LLM. This can be useful, but the extra graph pipeline has to improve the final result. Recent benchmarking found cases where GraphRAG underperformed vanilla RAG and argued that graph construction, retrieval, and generation should be evaluated together.6检索与 GraphRAG:在这种情况下,图被用作索引而不是训练数据。微软的 GraphRAG 工作构建了一个实体图和社区摘要,以回答普通分块检索可能难以处理的广泛问题。5 其他方法则检索特定任务的子图并将其传递给 LLM。这可能很有用,但额外的图管道必须能改善最终结果。最近的基准测试发现了一些 GraphRAG 表现不如普通 RAG 的情况,并主张应该将图构建、检索和生成放在一起评估。6
  • Graph-augmented agents: Agents have memory, plans, tools, state transitions, and sometimes relationships with other agents. Some of this state is naturally relational. A graph can make it persistent, inspectable, and easier to update across turns. The emerging literature organizes these uses around planning, memory, tool use, and multi-agent coordination. The practical design question is which parts of an agent’s state benefit from being represented as a graph.7图增强智能体:智能体具有记忆、计划、工具、状态转换,有时还与其他智能体存在关系。其中一些状态本质上是关系型的。图可以使其持久化、可检查,并更容易在轮次间更新。新兴文献围绕计划、记忆、工具使用和多智能体协调来组织这些用途。实际的设计问题是,智能体状态的哪些部分从表示为图中受益。7
  • Graph foundation models: The goal here is to pretrain a model that can transfer across graph tasks, datasets, or domains. Current work combines graph backbones, self-supervised objectives, adaptation mechanisms, and sometimes language models. The difficult part is that graph semantics vary widely. Nodes and edges can represent very different things across molecular, transaction, and knowledge graphs. Transfer across these domains requires methods that bridge differences in structure and semantics, supported by suitable training data.8图基础模型:这里的目标是预训练一个可以跨图任务、数据集或领域进行迁移的模型。当前的工作结合了图骨干网络、自监督目标、适应机制,有时还结合了语言模型。困难之处在于图语义差异巨大。在分子图、事务图和知识图中,节点和边可能代表非常不同的事物。跨这些领域的迁移需要能够弥合结构和语义差异的方法,并辅以合适的训练数据。8

What better graph modeling would look like更好的图建模应该是什么样的

When I say that we need to crack graph modeling, I don’t mean a universal converter that produces one correct graph. The more useful goal is a system that can propose, test, and maintain several graph views of the same raw data.当我提到我们需要攻克图建模时,我指的不是一个能生成一个正确图的通用转换器。更有用的目标是一个能够针对相同原始数据提出、测试和维护多个图视图的系统。

Such a system would need to do a few things well. It should identify possible entities and relationships in tables, text, events, images, and existing schemas. It should retain type, time, provenance, confidence, and permissions. It should be able to suggest alternatives instead of quietly committing to one structure. It should compare those alternatives using downstream quality, cost, stability, and human constraints. And it should keep the graph current as the source data and the organization’s understanding of it change.这样的系统需要很好地完成几件事。它应该能识别表格、文本、事件、图像和现有模式中可能的实体和关系。它应该保留类型、时间、溯源、置信度和权限。它应该能够建议替代方案,而不是默默地锁定一种结构。它应该使用下游质量、成本、稳定性和人为约束来比较这些替代方案。并且,随着源数据和组织对其理解的变化,它应该保持图的实时更新。

The downstream applications provide useful feedback. Prediction errors can point to missing relationships. Retrieval failures can expose poor granularity or disconnected evidence. Agent failures can show that important state transitions are absent. Weak transfer across datasets can reveal schemas that do not align. In this view, the graph is evaluated by what it helps the system do.下游应用程序提供了有用的反馈。预测错误可以指出缺失的关系。检索失败可以暴露糟糕的粒度或断开的证据。智能体失败可以显示重要的状态转换缺失。跨数据集的弱迁移可以揭示不匹配的模式。在这种观点下,图是通过它能帮助系统完成什么工作来评估的。

Today, a team will often build a graph for one application: a fraud graph, a recommendation graph, or a knowledge graph for a chatbot. I think there is a larger opportunity. If the underlying graph modeling is done carefully, the same raw data can support several graph views and several applications without rebuilding identity, provenance, and governance each time.今天,团队通常会为一个应用程序构建一个图:欺诈图、推荐图或聊天机器人的知识图。我认为有一个更大的机会。如果底层的图建模做得仔细,相同的数据源可以支持多个图视图和多个应用程序,而无需每次都重建身份、溯源和治理。

We already have strong methods for learning from graphs. The harder and less settled problem is deciding which graph we should build. If we make that step systematic and measurable, graph modeling can become a field in its own right and a shared foundation for analytics, prediction, retrieval, agents, and foundation models.我们已经有了从图中学习的强大方法。更困难且尚未解决的问题是决定我们应该构建什么样的图。如果我们使这一步骤系统化且可衡量,图建模就可以成为一个独立的领域,并成为分析、预测、检索、智能体和基础模型的共享基础。

Footnotes脚注

  1. Arijit Khan, Longxu Sun, Xin Huang, “LLMs+Graphs: Toward Graph-Native, Synergistic AI Systems,” arXiv, June 2026. ↩︎Arijit Khan, Longxu Sun, Xin Huang, “LLMs+Graphs: Toward Graph-Native, Synergistic AI Systems,” arXiv, 2026 年 6 月。 ↩︎
  2. William L. Hamilton, Graph Representation Learning (Morgan & Claypool, 2020). ↩︎William L. Hamilton, Graph Representation Learning (Morgan & Claypool, 2020)。 ↩︎
  3. Matthias Fey et al., “Relational Deep Learning: Graph Representation Learning on Relational Databases,” arXiv, submitted Dec 2023. ↩︎Matthias Fey 等, “Relational Deep Learning: Graph Representation Learning on Relational Databases,” arXiv, 2023 年 12 月提交。 ↩︎
  4. Yao Cheng and Siqiang Luo, “What Makes a Desired Graph for Relational Deep Learning?” arXiv, submitted June 2026. ↩︎Yao Cheng 和 Siqiang Luo, “What Makes a Desired Graph for Relational Deep Learning?” arXiv, 2026 年 6 月提交。 ↩︎
  5. Darren Edge et al., “From Local to Global: A Graph RAG Approach to Query-Focused Summarization,” arXiv, revised Feb. 19, 2025. ↩︎Darren Edge 等, “From Local to Global: A Graph RAG Approach to Query-Focused Summarization,” arXiv, 2025 年 2 月 19 日修订。 ↩︎
  6. Zhishang Xiang et al., “When to Use Graphs in RAG,” arXiv, revised Feb 2026. ↩︎Zhishang Xiang 等, “When to Use Graphs in RAG,” arXiv, 2026 年 2 月修订。 ↩︎
  7. Yixin Liu et al., “Graph-Augmented Large Language Model Agents,” arXiv, revised Aug 2025. ↩︎Yixin Liu 等, “Graph-Augmented Large Language Model Agents,” arXiv, 2025 年 8 月修订。 ↩︎
  8. Zehong Wang et al., “Graph Foundation Models: A Comprehensive Survey,” arXiv, May 2025.
    ↩︎
    Zehong Wang 等, “Graph Foundation Models: A Comprehensive Survey,” arXiv, 2025 年 5 月。 ↩︎

Post topics: AI & MLAI 与机器学习•Data数据文章主题:AI 与机器学习•数据