← Back to list

Knowledge Graphs in the LLM Era: A Practical Guide to Semantic Engineering

How knowledge graphs turn scattered records into connected, explainable, and continuously updated knowledge

Doil Kim · 2026-07-30 11:58 · 2 claps · 10.5 min read paywalled
#knowledge-graph #semantic-engineering #graphrag #llm #graphdb
Open on Medium ↗
Wiki topics: LLM · Large Language Models RAG · RAG & Retrieval

Knowledge Graphs in the LLM Era: A Practical Guide to Semantic Engineering

How knowledge graphs turn scattered records into connected, explainable, and continuously updated knowledge

Image by author — Generated with ChatGPT

Image by author — Generated with ChatGPT

This story was written with the assistance of an AI writing program.

Imagine four analysts describing the same company without using the same name.

One writes NVIDIA in a research report. Another stores NVDA in a market database. A third records the ISIN US67066G1040. The last mentions only NVIDIA’s data-center business in a regulatory filing.

A human connects the dots almost instantly. A conventional search engine may see four different strings.

Now add another record: an ETF holdings table says that VOO holds NVIDIA shares at a certain portfolio weight and rank. The data is available. The problem is that the meaning is scattered across documents, tables, identifiers, and systems.

This is where knowledge graphs become useful. They give machines something humans use naturally: context.

A knowledge graph does not merely store NVIDIA, VOO, and Vanguard as separate objects. It records how they are related, what each relationship means, where the fact came from, when it was true, and how confident we are in it.

That sounds simple. Building it reliably — especially with LLMs — is not.

Search finds words. A knowledge graph follows meaning.

Traditional search is excellent at locating documents that contain a keyword. It becomes less reliable when the answer requires several connections.

Suppose someone asks:

Which ETFs managed by Vanguard hold NVIDIA, and what position does NVIDIA have in each portfolio?

The answer may require joining a fund database, a holdings table, an issuer record, and a company identifier. A search engine can return relevant pages. A knowledge graph can follow the path:

Vanguard — sponsors → VOO — carries a position in → NVIDIA

It can then attach details such as portfolio weight, rank, reporting date, and source.

The smallest unit in this model is a triple:

Subject — Predicate → Object

Or, in everyday language:

Thing — meaningful relationship → Thing

For example:

  • Vanguard — sponsors → VOO
  • VOO — carries a position in → NVIDIA
  • NVIDIA — trades under → NVDA

One triple represents one claim. Thousands or millions of connected claims form a graph.

Traditional search retrieves matching documents. A knowledge graph connects the entities, relationships, and evidence behind them.

Traditional search retrieves matching documents. A knowledge graph connects the entities, relationships, and evidence behind them.

The predicate — the relationship in the middle — is what makes the graph semantic. “Manages,” “holds,” “manufactures,” and “competes with” are not generic lines between two dots. They have different meanings, rules, and consequences.

Think of it as the difference between a subway map with unlabeled lines and one that tells you which line goes where. Both contain connections, but only one helps you navigate.

LLMs shortened the pipeline — and moved the risk

Before LLMs, turning documents into a graph often meant passing the same text through a relay race:

Document pages → Mention detection → Relationship discovery → Identity reconciliation → Graph-ready facts

Each runner inherited whatever the previous runner handed over. If the first stage confused a product with a company, every later stage worked from that mistake. This is error propagation: small errors gain weight as they move downstream.

LLMs can collapse much of that relay into a shorter route:

**Document pages → LLM interpretation → Candidate graph facts**

That is a major improvement in flexibility. An LLM can read a paragraph, identify the entities, describe their relationship, and return structured output in a single call.

But the risk has not disappeared. It has changed shape.

Consider the sentence:

VOO holds NVIDIA as its largest position at 7.89%.

One model run might produce VOO — acquiresCompany → NVIDIA. Another might produce the vague VOO — containsStock → NVIDIA. A better schema might use VOO — carriesPositionIn → NVIDIA, yet the model could still invent a reason for the allocation.

All three outputs may sound plausible. Only one may match the organization’s schema, and none should be trusted without checking the source.

This creates four practical challenges:

4 practical challenges of using LLM to make knowledge graph

4 practical challenges of using LLM to make knowledge graph

The operating principle is straightforward:

Let the LLM propose a fact. Make the system prove it belongs.

RDF and LPG are two different ways to pack the same knowledge

Once facts have been extracted, they need a storage model. Two common choices are RDF and the Labeled Property Graph, or LPG.

A useful analogy is shipping.

RDF treats each fact like a standardized container. The format is strict, globally identifiable, and easy to exchange across organizations. LPG is more like a delivery vehicle designed for local speed: nodes and relationships can carry properties directly, making traversal convenient.

RDF expresses context through additional triples, while LPG can store the same context directly on a relationship.

RDF expresses context through additional triples, while LPG can store the same context directly on a relationship.

Suppose the graph must represent:

VOO holds NVIDIA at a weight of 7.89%, ranked first in the portfolio.

In an LPG, weight = 7.89 and rank = 1 can be properties on a domain-specific relationship such as CARRIES_POSITION_IN.

In RDF, the same information may be expressed through additional triples or a separate holding entity. This is more verbose, but it preserves a standards-based semantic model that can support integration and inference.

Tradeoff of RDF vs. LPG

Tradeoff of RDF vs. LPG

RDF may require more joins because nearly everything is expressed as a statement. LPG engines are commonly optimized for moving quickly from one node to its neighbors.

This does not mean “LPG is fast and RDF is slow.” Real performance depends on the engine, indexes, data shape, and query. The more useful question is:

Do we care more about shared meaning across systems, or direct traversal inside one system?

Many enterprises eventually use both.

The same question, spoken in three graph dialects

Graph query languages express the same business question in different ways. Here the holding is modeled as a portfolio position, because weight and rank describe the position — not the company itself.

SPARQL declares the RDF pattern that a matching answer must satisfy:

SELECT ?companyName ?weight ?rank WHERE {
  ?fund a portfolio:ETF ;
        portfolio:symbol "VOO" ;
        portfolio:recordsPosition ?position .
  ?position portfolio:security ?company ;
            portfolio:weight ?weight ;
            portfolio:rank ?rank .
  ?company company:displayName ?companyName .
}

Cypher draws the same idea as a readable path, with weight and rank stored on the relationship:

MATCH (fund:ETF {symbol: "VOO"})
      -[position:CARRIES_POSITION_IN]->(company:Company)
RETURN company.name, position.weight, position.rank

Gremlin describes how to walk from the ETF to each portfolio position:

g.V().has('ETF', 'symbol', 'VOO')
  .outE('CARRIES_POSITION_IN')
  .project('company', 'weight', 'rank')
  .by(inV().values('name'))
  .by('weight')
  .by('rank')

SPARQL speaks in semantic patterns, Cypher in visible paths, and Gremlin in traversal steps. These example names are intentionally domain-specific; a real organization should choose a vocabulary that matches its own business language.

Connections are cheap. Trust is engineered.

A graph can be beautifully connected and still be wrong.

For financial, legal, healthcare, or operational use, trust must be designed into the ingestion process. Four controls matter most.

1. Resolve identity before creating new nodes

NVIDIA, NVIDIA Corporation, NVDA, and US67066G1040 may all refer to the same company. Without entity resolution, the graph can create four separate NVIDIA nodes, each with an incomplete neighborhood.

A practical resolver works in stages:

  1. Match trusted identifiers such as ISIN, ticker plus exchange, legal entity identifier, or an internal product code.
  2. Normalize names and known aliases.
  3. For unresolved cases, compare descriptions and embeddings.
  4. Automatically merge only high-confidence matches; send ambiguous cases for review.

Exact codes are strong evidence, but even they need context. A ticker may be reused across exchanges or over time. Embedding similarity is helpful, but it should not make high-stakes identity decisions alone.

2. Validate structure before storage

A graph needs rules just as a database needs constraints.

For RDF, SHACL can describe the expected shape of data. An ETF node might require a name, currency, issuer, and identifier. A holding relationship might require a valid percentage and reporting date.

Validation can check:

  • Required fields and allowed nulls
  • Data types and value ranges
  • Minimum or maximum relationship counts
  • Whether a relationship points to the correct class
  • Uniqueness and business-specific policies

A reliable ingestion flow looks like this:

Source evidence → Candidate claims → Identity check → Rule check → Publish or quarantine

A failed validation should not always mean “bad data.” Sometimes the source genuinely lacks information. Systems should distinguish missing evidence, extraction errors, and policy violations.

3. Keep the receipt for every fact

Confidence scores are useful, but provenance is more important.

Every important fact should answer:

  • Which document and passage support it?
  • When was the source published and ingested?
  • Which model, prompt, and pipeline version extracted it?
  • Was it transformed or merged with another fact?

Without provenance, a graph gives an answer. With provenance, it can explain the answer.

4. Use consistency as a signal, not as proof

One way to reduce noisy extraction is to run the task more than once or compare multiple models. A triple that appears consistently may receive a higher score.

But five identical answers can still be wrong if all five share the same assumption. Self-consistency should raise or lower confidence; it should never replace source verification.

Security becomes a graph problem too

Relational access control often hides a table, column, or row. Graph access is trickier because hiding one node can break every path that crosses it.

Imagine an employee graph. A user may be allowed to know that Alice works in Finance but not see her salary or performance rating. Removing Alice entirely would destroy legitimate organizational paths. Returning the full node would expose sensitive properties.

The system may therefore need to preserve the node and relationship while filtering selected properties.

There are two broad enforcement layers:

  • Database-level enforcement: stronger because unauthorized data never leaves the engine.
  • Application-level enforcement: more flexible, but a missing filter or software bug can expose data.

Tags and query filters help, but they are not a complete security model. Nodes, relationships, and properties need classification. Traversal paths need authorization tests. Reads should be logged.

And because graph databases differ widely in fine-grained access control, security requirements should be tested before selecting an engine — not after deployment.

Choose the graph by the question, not by the trend

There is no universal knowledge graph architecture. The structure you build determines the questions you can answer efficiently.

Choose the graph that fits the question.

Choose the graph that fits the question.

A lexical graph is a data structure used in GraphRAG and text analysis to map the literal structure, source files, and sequential text chunks of source documents. It can preserve a path such as:

Original source → Exact location → Evidence passage → Supported claim → Referenced entity

That makes it strong for contracts, prospectuses, policies, and manuals where the original wording matters.

Smaller chunks preserve meaning and produce more useful embeddings. [Source]

Smaller chunks preserve meaning and produce more useful embeddings. [Source]

**Microsoft GraphRAG is a community-based synthesis engine. Its standard pipeline extracts entities, relationships, and optional claims, groups closely connected entities into communities, and generates summaries at multiple levels. T**his makes it effective for global questions that ordinary chunk retrieval struggles to answer.

However, indexing is LLM-intensive, and major data changes may require affected communities and their reports to be recalculated, increasing cost and operational complexity.

Community based MS Graph [Source]

Community based MS Graph [Source]

**Graphiti builds temporal context graphs that track what is true now, what was true before, and which source introduced each fact. It continuously integrates interactions, documents, and structured data through incremental updates, while supporting semantic search, keyword matching, and graph traversal. This makes it useful for news, filings, customer interactions, and agent memory.**

However, entity resolution, temporal conflicts, ontology management, and LLM-based extraction can increase operational complexity, cost, and latency.

Graphiti tracks when a fact becomes valid and when it stops being true. [Source]

Graphiti tracks when a fact becomes valid and when it stops being true. [Source]

A financial platform might combine all of these:

  • Thin RDF for authoritative security and product master data
  • A lexical graph for prospectuses and fund terms
  • GraphRAG for long-form research synthesis
  • A temporal graph for filings and news
  • Vector search for fuzzy discovery across the collection

Architecture should follow the required accuracy, latency, freshness, explainability, volume, and update frequency — not whichever graph product currently has the best demo.

The map must move when reality moves

Real-world knowledge changes.

An ETF adds or removes a holding. A company changes its name. A policy is replaced. A news story corrects an earlier claim. If every change requires rebuilding the whole graph, the system will become slow and expensive.

Incremental indexing updates only what reality changed:

  1. Detect: identify the new, revised, or withdrawn source material.
  2. Reconcile: compare its entities and claims with what the graph already knows.
  3. Propagate: add, revise, expire, or remove facts, then refresh only the affected indexes and summaries.

The difficult part is not addition. It is controlling side effects.

Identity drift

A new alias can create a duplicate node and split one company’s history into several neighborhoods. Stable identifiers, alias rules, and semantic matching keep the graph coherent.

Deletion asymmetry

Adding a brick is easy. Removing one may weaken the wall.

Deleting a fact can affect paths, summaries, embeddings, and downstream answers. Many systems first mark data with a tombstone such as isDeleted = true, then perform physical cleanup later. When a large percentage of the corpus changes, a full rebuild may be safer than thousands of local repairs.

Cascading summaries

In a GraphRAG-style system, changing one entity may affect its community report, parent communities, embeddings, and cached answers. The architecture must define how far recomputation travels.

The ideal system records dependencies and rebuilds only the affected neighborhood. If global summaries are not central to the use case, avoiding them can make incremental operation much simpler.

From document to dependable answer

The technologies may vary, but a reliable pipeline usually follows the same logic:

  1. Ingest the source and record its identity, version, time, and access policy.
  2. Interpret candidate claims with deterministic mappings, NLP, or LLMs.
  3. Reconcile identities against stable identifiers and existing nodes.
  4. Test structure and evidence, then quarantine questionable claims.
  5. Publish accepted knowledge with provenance, confidence, and temporal metadata.
  6. Retrieve with the right combination of graph traversal, keyword search, and vector similarity.
  7. Monitor changes and update only the affected portion of the graph.

A reliable knowledge graph is built through validation, governance, and continuous updates — not storage alone.

A reliable knowledge graph is built through validation, governance, and continuous updates — not storage alone.

Notice that the graph database is only one step. The real system includes identity, validation, lineage, security, retrieval, and lifecycle management.

The graph is not the product. Understanding is.

A knowledge graph should not be judged by how many nodes or triples it contains.

The better questions are:

  • Can it recognize that NVIDIA, NVDA, and an ISIN refer to the same entity?
  • Can it explain why VOO is connected to NVIDIA?
  • Can it point to the source and reporting date?
  • Can it prevent an unsupported LLM claim from becoming accepted knowledge?
  • Can it hide sensitive properties without destroying useful paths?
  • Can it update one changed fact without rebuilding everything?

If the answer is yes, the graph is doing more than connecting data. It is turning scattered records into something an organization can search, question, verify, and trust.

That is the real promise of semantic engineering in the LLM era: not a larger pile of facts, but a system that knows how those facts fit together.

Further reading


메타데이터
post_id
a056dc6bcd0a
slug
knowledge-graphs-in-the-llm-era-a-practical-guide-to-semantic-engineering-a056dc6bcd0a
url
https://medium.com/@kimdoil1211/knowledge-graphs-in-the-llm-era-a-practical-guide-to-semantic-engineering-a056dc6bcd0a
canonical_url
https://medium.com/@kimdoil1211/knowledge-graphs-in-the-llm-era-a-practical-guide-to-semantic-engineering-a056dc6bcd0a
author_url
https://medium.com/@kimdoil1211
status
ok
fetched_at
2026-08-02 19:17:18