Unstructured data

What is a knowledge graph? Turning data into context

When you query data across multiple tables, the system often becomes hard to use. A knowledge graph works in a different way by displaying how a particular fact connects to all surrounding data. If you construct this map of connections properly, both human users and AI can comprehend the information without having to rebuild the relationships for each new request.

A knowledge graph is a network that stores entities, such as customers, products, or suppliers, together with the relationships among them. These relationships are kept as data. This structure enables people and AI systems to trace directly how items relate to one another. Users do not have to rebuild links via complex database joins for each query.

A knowledge graph is a network that records entities and the relationships linking them. Entities are the things you care about: a customer, a product, a supplier, a contract, a location, an event. Relationships are the verbs that connect them: bought, supplied by, reports to, located in, mentioned in. A graph keeps the links as data in their own right, rather than buried in isolated rows. The result resembles a map of meaning more than a filing cabinet.

Shipshape Data builds data and AI foundations, and we often encounter a specific problem with our clients. They want an AI assistant that can answer business questions, or a fraud team that can understand account connections, but the real obstacle is usually data structure. The necessary information exists, yet it is stored in tables that do not display relationships between different data points. This guide explains why this occurs, how a graph database can resolve it, where a graph database fits within an organisation, and how to start implementation without a large upfront investment.

Why relational databases struggle with connected questions

Relational databases perform well for their intended purposes. They store records in tables with fixed schemas, enforce data types, maintain consistency, and process simple queries quickly. They are the appropriate tool for transactions and reporting. Problems arise when the primary focus of a query is the relationship between data points rather than the records themselves.

Consider a specific query that a business might need to answer. You want to identify every customer who purchased a product similar to items bought by others in their region, who also used a related service, and who then stopped being a customer within ninety days. This query involves a sequence of five or six connected relationships. To answer this, a relational database must join multiple tables, with each connection in the sequence requiring an additional join operation.

The challenges of joining data at scale

A join works by scanning tables to match specific values. This process is fast and predictable when a query involves only one or two tables. However, the cost rises significantly when you use multiple joins to trace a relationship through several steps. This occurs because each join can multiply the number of rows the subsequent join must process. A query that follows five or six layers of relationships may scan millions of rows and take several minutes to complete. This delay makes interactive use impossible. The depth of connections you can explore is limited by the number of joins the query planner can handle before performance fails.

We have seen teams try to solve this by adding more indexes, creating denormalised summary tables, and running overnight batch jobs to pre-compute joins that cannot be processed in real time. These methods provide temporary relief. They do not address the fundamental issue, which is that the model is designed to store records effectively but handles connections poorly.

Relationships treated as afterthoughts

The primary issue concerns the data stored within a table. A customer table contains information about customers. A product table contains information about products. When a specific customer buys a specific product, that information is stored as a foreign key. This is a value in a column that references a different table.

This relationship has no inherent meaning. It is a reference rather than a fact that you can describe or analyse.

The logic that defines a relationship must reside within your queries. The database does not distinguish between different types of links, such as a recommendation versus a purchase. It also does not recognise that a reporting structure is directional while a collaboration is not. You must write this logic into the SQL each time you ask a question about how entities connect. When an entire analytics team does this, it results in a large amount of duplicated and fragile logic. The database never learns these relationships itself.

A table shows the specific properties of an item. It is not an effective way to show how that item relates to other things.

How a knowledge graph connects data points

A graph stores information using nodes and edges. Nodes represent entities, and edges represent the relationships between them. This is the complete model, and its simplicity is its primary feature.

The system structure matches your existing business model. You can ask a question like "show me the suppliers linked to manufacturers who ship to London" and find the answer by following the connections directly. This process does not require joins.

Nodes and edges are the basic components

A node holds an entity and its attributes: a customer node carries a name, a type, a signup date, whatever properties matter. An edge holds a relationship and its attributes too, which is the part relational people tend to underestimate. When you draw an edge labelled "purchased" from a customer to a product, you can attach properties to that edge itself: the date, the quantity, the price, the channel. The relationship becomes a thing you can query and describe, not a bare pointer between two rows.

This small difference has significant effects. When relationships include their own data, queries that are difficult in SQL become easier to manage. You can find every purchase edge above a specific value from the last quarter. You can follow reporting edges through three levels of management. You can also trace how a document relates to specific people, projects, and decisions. In this model, connections are treated as primary data elements.

Semantic meaning in the connections

Edges have labels that define the nature of the connection. A person and a company may be linked by labels such as "employed by," "manages," or "consults for." Each label represents a distinct type of relationship. When you query a graph, you follow the specific label that matches your objective. This makes the query structure similar to a plain English statement of your requirements.

Graph databases offer performance advantages in addition to readability. They store relationships as direct references between nodes. This allows the system to follow an edge using a pointer hop instead of searching for matching values across different tables. Navigating a long chain of relationships remains roughly linear relative to the length of the chain. This specific workload is difficult for relational models to process efficiently. This process also highlights the importance of the semantic layer in your stack. The labels you apply to edges serve as the vocabulary that all downstream systems will use for reasoning.

How knowledge graphs make AI more accurate

For this reason, knowledge graphs have become prominent again. A large language model can match patterns well, yet it is not anchored in concrete facts; it generates text that appears plausible. Plausibility is not the same as truth, and this gap can produce confident but wrong answers. A graph gives the model a reference source. It holds explicit, verified relationships that the model can retrieve and use.

Fewer hallucinations, because lookup replaces guesswork

When a model responds to "who manages this department" based on its own weights, it chooses the statistically most likely completion for those words. This approach can be accurate at times. Other times, the model produces a plausible name and asserts it with full confidence. If you link the same model to a graph, the answer is taken from the "manages" edge present in your data. The model stops predicting the relationship and instead retrieves it.

This represents the primary advantage of grounding a model in your own knowledge, and it explains why retrieval and knowledge platforms are reliable, not merely able to generate interesting results. A graph database will not enhance a model that has weak language abilities. It solves the issue of the model inferring on facts it should not fabricate, by offering a source for accurate information.

Anchoring a model in a graph swaps uncertain predictions for verifiable data. Such accuracy is the main requirement for enterprise applications.

More precise answers, because context has structure

Grounding stops a model from fabricating information and enhances the precision of its output. Since a graph records relationships between entities across many categories, a system can trace a logical path to obtain a specific answer. When a user queries the reliability of a supplier, the model can move from that supplier to its delivery records, product quality markers, and associated customer complaints. It then constructs a response using this linked evidence. This approach yields a higher quality response than a paragraph of confident yet generic statements. This difference decides if users trust the tool enough to employ it.

Where knowledge graphs earn their keep in the enterprise

You are useful only when you tackle a significant problem. The most effective graphs concentrate on questions where the main value is in the connections. A conventional table format splits these relationships across many locations, making reconstruction difficult.

Fraud detection and risk

Fraud represents a relationship problem disguised as a transaction issue. Banks and insurers link customers, accounts, transactions, devices, and locations, and the relevant signal is seldom a single suspicious record. The important factor is the shape of the surrounding network. A new account sharing a device with an account flagged last year is hidden from a rule that examines records individually. In a graph, that shared device is one edge away, causing the connection to appear as soon as the account shows up. Tools that detect coordinated fraud rings across many accounts typically analyse network structure, which is exactly what a graph is designed to store.

Customer intelligence and personalisation

Retailers and service companies store purchase history, browsing behaviour, demographics, and product attributes, typically in separate systems that share little. A graph combines them into a single view of a customer: what they purchased, what they viewed, what content they engaged with, and what they responded to. Recommendations based on that connected view outperform those based on a single transaction table, because they include context. This pattern is common in AI applications and business intelligence, where the advantage comes from joining signals that were never intended to be combined.

Knowledge and unstructured content

The most common case resides in documents, which is why this guide is placed under unstructured data. Contracts, reports, tickets, emails, and wiki pages contain a vast amount of a company's real knowledge, and nearly none of it resides in a table. A graph provides a natural home for this information. Extract the entities a document mentions, such as people, clauses, obligations, and products, and record how they connect, turning a stack of files into something you can query and reason about. This layer makes an AI assistant truly useful across a business, as it can trace a question to the specific documents and relationships that provide the answer.

How to implement a knowledge graph without overreaching

You are likely to fail if you try to model the entire company at once. Graphs work better when they are focused. You should use the first graph on a specific problem where complex relationships create difficulties. Let the graph show its value before expanding its scope.

Choose a use case that has distinct entities

Effective initial projects involve three to five primary entity types with easily identifiable relationships. Customer intelligence, supply-chain visibility, and fraud detection serve as examples. The entities in these domains are specific (customers, products, suppliers, transactions) and the relationships are clear (purchased, supplied by, connected to). Do not model vague concepts or ambiguous links in the first attempt. The aim is a project where you can verify the graph's accuracy, allowing future expansion to rest on a solid foundation.

Start with the data you already have

You seldom need to gather new data to begin. The relationships already reside in your systems, found in foreign keys, reference fields, and shared identifiers in your customer database, product catalogue, and transaction logs. The job is to make these implied links explicit and assign them specific meanings. A foreign key stating "this order belongs to this customer" becomes an edge labelled "placed" that includes its date and value. Building from data you already trust shortens the initial phase. This is helpful when you are still demonstrating the project's value.

Best for problems where the value lives in the connections: fraud rings, recommendation, supply-chain traceability, and grounding an AI assistant in your own documents and records. Watch for: a graph is only as good as the entities and relationships you feed it, so poorly defined links produce a tidy diagram that answers nothing. Model a narrow, well-understood slice first, get the labels right, then widen the scope once the pattern holds.

Treat the graph as part of the foundation, not a side project

A graph that is not maintained quickly loses its value, much like a lineage diagram that becomes inaccurate within a few months of creation. The most effective graphs are integrated into existing data workflows. They receive updates from your pipelines, adhere to the same governance rules as the rest of your infrastructure, and refresh automatically when underlying systems change. We concentrate most of our client work on this integration. If a graph does not remain synchronised with the business, it delivers incorrect information that appears reliable. This result contradicts the original purpose of building the graph.

Where this leaves you

Your data becomes truly useful when you can see how it connects, not merely where it resides. A knowledge graph provides the structure that makes those connections first-class: queryable, describable, and accessible to both the people asking questions and the AI systems answering them. It proves its worth on real problems, such as understanding a customer across every touchpoint, spotting fraud by its shape, grounding a model in checkable facts, and it provides no value when built solely for its own sake.

You don't have to replace your current systems to start. You ought to map a few key relationships inside one use case. Apply this method to address a particular problem that is presently hard, and then broaden your work. Companies that succeed with this technology are typically not those that have the most data. Rather, they are the firms that have organised their data so the connections become clear.

If you wish to determine whether a knowledge graph solves a real problem you face, that is the type of conversation we prefer to begin with. Talk to us and we will provide a clear assessment of where connected data would make an impact, and where it would only be a nice diagram.

Many teams reach this point in theory but then stall during the build. Our AI development service is designed for that exact stage.

Frequently asked questions

What is a knowledge graph?

A knowledge graph consists of a network of entities, such as customers, products, or suppliers, connected by labelled relationships like bought, supplied by, or reports to. The graph records each connection as data, and that data contains its own attributes. This structure lets you follow a chain of relationships directly rather than recreating the connections with joins.

What is a knowledge graph in AI?

Knowledge graphs give language models a factual reference for information. When a user asks who manages a department, the model can check the specific management relationship in the graph data. This grounding lowers the rate of incorrect or fabricated answers by making sure the model bases its responses on connected and verified evidence.

How do you build a knowledge graph?

Start with a narrow scope. Avoid trying to model the entire company all at once. Choose a use case that includes three to five distinct entity types and relationships that are easy to identify, for example supply chain visibility, customer intelligence, or fraud detection. Most of the required data already exists as reference fields and foreign keys in your existing systems. The main task is to turn these implied links into explicit ones and give them specific meanings. You then need to maintain the graph as your systems evolve.

Is a knowledge graph the same as Google's Knowledge Graph?

This article outlines the general knowledge graph model that companies use to connect data such as customers, products, suppliers, and documents. Google's Knowledge Graph represents a similar concept. It is a particular search tool that applies the same principle of entities linked by labelled relationships. All knowledge graphs rely on the basic concept of nodes and edges that hold meaning, irrespective of their specific purpose.

Start at your core.

Tell us where your data is today and what you want AI to do. We'll come back with a straight answer on what your foundation needs and where the quickest real win is.

Talk to us