Scrape Info

Building a Knowledge Graph from Extracted Web Data

Knowledge graphs turn multi-hop questions into traversable paths RAG alone cannot reach.

· 10 min read · Updated
Cover illustration for “Building a Knowledge Graph from Extracted Web Data”
Data Extraction · July 21, 2026 · 10 min read · 2,313 words

Standard RAG finds document chunks by cosine similarity and that's the whole trick. It compares a question to a pile of text snippets, grabs the ones that look closest in meaning, and hands them to the model. That works fine until the question needs more than one jump to answer.

Picture a question like "which suppliers share a logistics partner with a flagged counterparty?" That's a chain: supplier to logistics partner, logistics partner to counterparty, counterparty to flag, something a lookup can't do. Vector RAG retrieves chunks, not relationships, so it can confirm that two facts exist somewhere in the pile without ever tracing the path connecting them. It's like asking someone for directions and getting handed two postcards from the destinations instead of a map.

LinkedIn ran into this in production and published the fix. Its 2024 research paper found that combining knowledge graphs with RAG produced a substantial jump in Mean Reciprocal Rank, a bump plain RAG could not reach on its own. That's a company with enormous internal search traffic saying, in effect, that similarity scoring alone left real accuracy on the table.

Tuning the embedding model harder doesn't fix this. Adding more chunks doesn't fix it either. The retrieval unit itself is the wrong shape for multi-hop questions. The fix has to change the shape of the data, not the sharpness of the search. That's what a knowledge graph is built to do: turn relationships into data the system can walk across, one edge at a time.

What a knowledge graph is and why its structure makes reasoning possible

A knowledge graph is a network of entities, relationships, and properties, where the relationship itself counts as an object in the system rather than something the software has to guess at. Entities are the nodes. Relationships are the edges connecting them. Properties sit on both, giving each node and each edge extra detail. The basic unit is a triple: subject, predicate, object. That predicate in the middle is a real, labeled, queryable thing, not decoration.

Compare that to a regular database. In a knowledge graph, the edge type, something like "upstream_of" or "governed_by", is already sitting there as its own object, with its own properties and its own rules for how it can be traversed. Nothing needs to be inferred at query time. The relationship was already declared when the data went in.

That declaration only works if there's an agreed vocabulary behind it, which is what an ontology provides. An ontology spells out which node types are allowed, which relationships are permitted between them, and which properties each type can carry. Without the ontology, the graph turns into an untyped blob that nobody can reason over consistently, because "related_to" could mean anything from "manufactures" to "sued."

Ontologies run on a spectrum. On the light end sits SKOS, a simpler taxonomy good enough for something like a business glossary where the stakes are lower and the vocabulary needs to stay easy to update. Most companies land somewhere in the middle: enough structure to keep things consistent, loose enough to change without breaking whatever's already in production.

The payoff appears when an AI agent actually queries the thing. Instead of scanning rows across six tables and joining them together, the agent walks a path: content node, to engagement edge, to customer node, to conversion edge, to channel node. One traversal, not a six-table join. Atlan's Enterprise Data Graph runs this pattern at full company scale: every dataset, every pipeline, every business term becomes a typed node, and every lineage or ownership relationship becomes a named edge that AI agents can query in real time through an MCP server. The edge being a first-class object is the whole reason traversal works at all.

The five-stage pipeline from raw web data to a populated graph

Diagram: Five Stages From Raw Web Data to a Working Knowledge Graph. Visualizes: Show a five-stage linear pipeline with approximate time estimates for each stage: Stage 1 Assess & Scope (1–2 weeks), Stage 2 Design Ontology & Schema (2–4 weeks)…

Turning raw web data into a working graph runs through five stages: assess and scope, design ontology, extract entities and relationships, resolve entities, and validate and activate. Skip or rush any one of them, and pilots quietly die in a corner of someone's laptop.

Stage 1 is assess and scope, usually a one to two week job. Pick a lane first.

Stage 2 is designing the ontology and schema, typically two to four weeks. This means drafting a working ontology for the scoped domain, built alongside the people who actually know that domain. An exhaustive RDF/OWL ontology written before anyone has touched real production data rarely survives first contact with that data. Build it to be good enough, then let it evolve.

Stage 3 is extraction, running one to three weeks, and it's where the web-data pipeline actually lives. This is the stage that turns web pages, warehouse tables, and loose documents into candidate nodes and edges, usually with LLM-assisted extraction doing the heavy lifting. Everything that comes out of Stage 3 should be treated as unverified until it clears Stage 5's validation gate. Format matters just as much as method here: Markdown and plain text suit reading tasks, JSON suits structured fields, and raw HTML is close to the worst option for anything LLM-bound, since the model burns tokens parsing markup it doesn't need.

Stage 5 is validate and activate, one to two weeks: gating the graph with SHACL rules and an actual human review before any of it reaches production. That validation gate is the thing standing between the company and a graph full of confidently wrong relationships an LLM invented somewhere in Stage 3. Atlan's construction guide puts the full timeline at 6 to 12 weeks for a single domain, 2 to 3 months if the goal is company-wide coverage.

None of this works without groundwork. Groundwork means governed access to metadata, executive sponsorship for whoever owns schema decisions, an entity resolution strategy worked out before extraction starts, a validation framework, and a named project lead with real hours allocated. Work that nobody formally owns is, reliably, the work that gets abandoned.

Why entity resolution, not extraction, is where pipelines fail

Plenty of teams assume today's LLMs have basically solved entity resolution. That assumption is wrong, and it's the single most expensive mistake in this whole process. Extraction is cheap now. Resolution and getting everything to line up with the ontology at scale are the steps practitioners describe, bluntly, as soul-crushing, and they're consistently the steps that get the least time and the fewest people.

Swap in Neo4j, swap in a GraphRAG stack, swap in any metadata platform on the market. Teams report hitting the identical wall every time: resolving entities and aligning them to the ontology at scale doesn't bend to LLM shortcuts the way extraction does.

Here's what that wall looks like in practice. "John Smith" shows up in the CRM. "j.smith@company.com" shows up in the email tool. No extraction model resolves that connection on its own. It takes a resolution strategy decided before extraction even starts, not bolted on afterward as cleanup.

A 2023 arXiv survey of knowledge graph construction backs this up directly: production-grade pipelines need provenance tracking and repair mechanisms built in as the graph grows. LLM-based parsing has cut down on breakage from site layout changes by a lot, which helps. But a meaningful tail of cases still needs a human to look at them, and at web scale, reviewing that tail costs real money and real time.

The practical fix is simple to state and easy to underfund: put more calendar time and more review capacity into Stage 4 than into Stage 3. Resolution tooling hasn't kept pace, and planning as if it has is how projects run over budget and over schedule in the exact same spot, every time.

GraphRAG versus vector RAG: which retrieval pattern fits which query type

Once the pipeline is understood, the real decision facing most teams is simpler than it sounds: does the AI agent need to answer questions about specific facts, or does it need to answer questions about how things across the dataset connect to each other? Most production queries, most of the time, fall into the first bucket.

Vector RAG is the right tool for specific-fact retrieval. It's fast, it's cheap to run, and it covers the bulk of support tickets, search queries, and summarization tasks without needing anything fancier.

GraphRAG earns its keep on structural and relational questions: tracing a chain across several hops, spotting a pattern that only appears when you connect several entities together, or answering a "how does X relate to Y through Z" question that a flat chunk search can't even parse correctly.

Microsoft Research built LazyGraphRAG specifically to chip away at the cost argument against graph-based retrieval. Microsoft Research reports its indexing cost runs at roughly 0.1% of full GraphRAG's cost, while matching GraphRAG Global Search on answer quality for global queries, at a much lower cost per query. For teams willing to accept a bit more latency at query time, that largely removes cost as the reason to avoid GraphRAG.

Mature production systems converge on hybrid routing instead of a single pipeline for everything. Simple factual questions route to vector RAG. Questions that mix both kinds of complexity route through something like DRIFT search. No single approach handles every query type well, so the routing layer is doing real work.

Jerry Liu, co-founder of LlamaIndex, has made the case that plain vector RAG is often good enough, and for use cases that never touch multi-hop reasoning, he's right. The sensible response is to scope graph construction to the specific cases that genuinely need traversal, leaving the rest running on vector search where it already works fine.

The cost and scalability trade-offs that determine whether a graph reaches production

GraphRAG used to carry an indexing cost that priced a lot of teams out before they even started. That cost has come down fast through 2026, closing in on something close to parity with plain vector RAG. That shift changes who can afford to get started with a graph project. It doesn't touch a separate problem: the ceiling on graph traversal performance once a graph grows into the billions of nodes.

The cost pressure that's left is at query time for full GraphRAG. LazyGraphRAG's whole trade is accepting that cost at a fraction of the usual price while holding onto most of the quality.

Scale brings its own headaches that money alone doesn't fix. Research on this plateau effect shows something counterintuitive: past a certain size, traversal actually gets less discriminative, not more useful, so throwing more data at the graph stops paying off and can make answers fuzzier. Bigger isn't automatically better here, so scoping the graph's boundaries carefully back in Stage 1 keeps paying dividends long after the project ships.

Infrastructure choices matter once a graph reaches this size. AWS expanded Neptune Analytics into seven additional regions in February 2026, aimed squarely at companies that need to operate across multiple legal jurisdictions at once. None of this is optional once a graph crosses a certain size. Picking a database that matches the actual projected scale of the graph is part of the job, not an afterthought bolted on after things start slowing down.

What production deployments look like: three concrete cases

Across real deployments, the value of a knowledge graph rarely lies in the graph itself. It is visible in what the graph lets the AI do afterward: faster decisions, fewer hallucinated answers, and questions that used to be flatly unanswerable now getting answered.

Daimler Truck North America combined graph technology with large language models to turn live enterprise activity into something the organization could actually reason about in real time. A spokesperson for the company described the result: the company can now solve problems in minutes instead of weeks. That's a different category of outcome, not a speed boost on an existing process, built on connecting facts a flat database never would have linked on its own.

This pattern holds across every deployment of this kind worth looking at closely. The win isn't that retrieval got faster. The win is that reasoning got deeper, able to connect facts across entity boundaries that would otherwise require an analyst sitting down with several systems open and doing the connecting by hand. A graph does structurally what a tired human analyst does manually at 11pm with four browser tabs open, except it does it in milliseconds and doesn't need coffee.

How AI agents interact with a live knowledge graph in 2026

By 2026, the connective tissue between graph databases and the AI agents that use them has settled on one standard: MCP, the Model Context Protocol. An arxiv paper on the subject calls MCP the primary integration layer for agentic AI, and notes it's increasingly seen as the right framework for knowledge graphs specifically. A dev.to guide puts a number on how fast that happened: in roughly 18 months, MCP went from new idea to the de facto standard for AI agent integration.

What that standardization means in practice is that a graph stops sitting behind a dashboard waiting for a human analyst to run a query. It sits behind an MCP server, available to any properly authorized agent that needs to ask it something, the same way Atlan's Enterprise Data Graph exposes lineage and ownership edges to agents querying it directly and in real time. Companies doing well with knowledge graphs right now treat the graph as something agents talk to constantly, not something a data team updates once a quarter and hopes stays accurate.

That shift is the entire reason the five-stage pipeline earlier in this piece is worth the six to twelve weeks it takes. A graph built without a scoped domain, without a working ontology, without a serious entity resolution strategy, and without a validation gate is a liability wearing a graph's clothing, waiting for an autonomous system to make a confident decision based on a relationship nobody checked.

Sources

  1. Knowledge Graph Construction for AI: Enterprise Data Graph (2026)
  2. Mutual Understanding between People and Systems via Neurosymbolic AI and Knowledge Graphs
Filed underData Extraction

More in Data Extraction