⚡ Quick Answer

A knowledge graph is a way of organizing information as connected entities and relationships. People, places, products, concepts, events, and more are all modeled as entities, and the relationships between them as connections. Knowledge graphs are used by search engines, AI applications, recommendation systems, and more to gain insight into the information they are working with.

What Is a Knowledge Graph?

A knowledge graph is a structured representation of knowledge, the entities and their relations in a particular domain. The entities in a knowledge graph can be for example people, organizations, products, places, events, concepts. The relations between the entities in a knowledge graph explain how the entities in a knowledge graph are related to each other.

To illustrate this, consider a simple graph of a company, its employees, its products, past customers and various locations. This knowledge graph can be used to express various facts such as “John works for ACME”, “ACME produces Frisbees”, “X purchased a Frisbee from ACME” and “ACME is located in San Francisco”.

These kinds of networks are also often called semantic networks because storing information alone is not enough; the information’s meaning and the connections between individual pieces of information must also be represented. Thus, knowledge graphs are built from information coming from all sorts of sources, allowing it to be searched by all sorts of applications and to be used by AI systems in a wide array of different ways.

How Does a Knowledge Graph Work?

In the first step information is collected from single or multiple sources, e.g. databases, documents, web pages, APIs, enterprise applications etc..

After the information has been collected it is analyzed to determine the relationships between the identified entities. This can be a complex process and many Knowledge Graphs use Natural Language Processing (NLP) and machine learning to analyze text in order to identify the entities within it and the relationships between them.

Identifying Entities

The process starts with identifying the relevant entities contained in the provided data, like in a document about a technology company or its products, executives, customers and locations.

We use the context of a piece of text to identify entities of different types. The same word can be used to talk about very different things. For example, “Apple” can refer to the company, or to the fruit.

Defining Relationships

Relationships between entities need to be defined after the entities have been identified.

An example of relationships about a Company would be: Company → develops → Product or Employee → works for → Company. These relationships enable systems to understand the context of the information and to navigate through the Knowledge Graph in order to retrieve relevant information.

Connecting Information

Connecting Information. Knowledge graphs can be used to connect information from various sources that was previously structured in different ways. Schemas, identities and context are used to make sense of information in a knowledge graph.

This linked information allows search and AI programs to search for and retrieve information in a new light, such as by relationships and by context. The linked data can also reveal hidden relationships that would have been impossible to discover had the information been stored separately.

What Are the Main Components of a Knowledge Graph?

A knowledge graph consists of nodes, edges and labels or properties. Together they describe the entities and the relations between them.

Nodes represent entities or concepts. A node could represent a person, company, product, place, event, or document. 

Edges represent relationships between nodes. For example, relationships like “works for”, “located in”, “purchased”, “depends on”, “developed by” can be modeled as edges between nodes.

Finally, properties or labels on edges and on nodes can add a lot of value to the knowledge in a knowledge graph. For instance, a person node can have a number of properties: name, role, address, date of birth, etc.

An ontology, which is a formal and structured representation of knowledge, of entities and of their relationships can then be used to classify entities within the domain into predefined concepts, as well as to define the possible relationships.

What Are Knowledge Graphs Used For?

There are many scenarios when information connecting together is more relevant than storing individual information as separate records.

Search and Information Retrieval: The most obvious application of Knowledge Graphs is Search. A Knowledge Graph helps search engines like Google to better understand entities, their relations and the context of a search query. Thus, better search results can be provided to users.

Recommendation systems by taking into account information about users, products, content, and their interactions with each other. For example, an e-commerce platform could recommend related products or an entertainment platform could recommend related TV shows or movies.

Enterprise knowledge management: In corporations, knowledge is distributed across databases, documents, applications and departments. A Knowledge Graph can help to structure this knowledge and give a unified view of all entities and their relationships within an enterprise.

Generative AI and RAG (Retrieval-Augmented Generation) models as they can serve as a structured input for the AI to comprehend the context of entities and their interrelations. This can then be used as input for retrieval-augmented generation, or even for training RAG models in a domain-specific context.

What Are the Benefits of a Knowledge Graph?

One major advantage of knowledge graphs is that they add context to your data. Unlike data structures that only store facts and not their relations, knowledge graphs explicitly represent all relations between facts.

Information from different sources can be connected in a knowledge graph. Since this information is stored in different databases with different structures, a knowledge graph makes it easier to integrate this information.

Another advantage of a Knowledge Graph is information discovery. Because all relationships between entities are stored in a Knowledge Graph, queries can follow links between entities to find information that would not have been found by querying individual pieces of information.

In addition to search, knowledge graphs can also support question answering, recommendation systems, analytics, and many more applications. For these use cases knowledge graphs are often combined with Machine Learning (ML) and Natural Language Processing (NLP).

Knowledge Graph vs. Traditional Database

Feature Knowledge Graph Traditional Database
Primary structure Connected entities and relationships Tables, rows, and columns
Data representation Nodes, edges, properties, and relationships Structured records and fields
Relationship handling Relationships are a core part of the model Relationships are typically defined through keys and queries
Context Can represent semantic context between entities Usually focused on structured data values
Data sources Can integrate structured and unstructured information Commonly relies on structured data
Common search approach Relationship-based and semantic retrieval Structured queries and exact matching
AI applications Useful for search, recommendations, RAG, and knowledge discovery Useful for transactions, reporting, and structured data processing
Best suited for Connected and complex information Structured and transactional information

A knowledge graph is not a replacement for a database, but it can be very helpful in conjunction with databases of structured data. In such a setup, the knowledge graph would be built from the data in the databases, and it would represent the connected entities and their relationships.

Knowledge Graph vs. Knowledge Base

The term knowledge base usually refers to a stock of information which users or systems can query for knowledge. That information could be written in the form of articles, FAQ’s, guides, policies and other information containing documents.

A knowledge graph can also be used to represent a knowledge base, and vice versa. Thus, knowledge graph, knowledge base, and ontology are terms that can be used more or less interchangeably in different contexts. However, typically a knowledge graph will be used to represent a model that is focused on representing entities and their interrelations.

Feature Knowledge Graph Knowledge Base
Main focus Relationships between entities Collection of useful information
Structure Nodes and relationships Articles, documents, records, or other content
Context Explicitly represents relationships and meaning Depends on how information is organized
Typical access Queries, graph traversal, semantic retrieval Search, browsing, or AI-assisted retrieval
Common applications Search, recommendations, analytics, AI Customer support, documentation, internal knowledge

In practice, a knowledge base can use a knowledge graph to make its information more connected and easier for AI systems to retrieve.

Real-World Examples of Knowledge Graphs

Search engines are one of the most common applications of knowledge graph technology. By having a vast store of interconnected information about people, companies, places and more, search engines are able to better understand a user’s search query and return results relevant to what they are looking for.

In addition to search, knowledge graphs are used in a number of industries, such as retail (products, customers, behavior), finance (customer data and transactions, e.g. for know-your-customer processes or financial crime investigations), health (concepts, research, diagnoses, treatment). For enterprise AI knowledge graphs represent structured information about customers, products, employees, processes, documents and systems and support search, analytics, question answering and many more AI applications.

For Enterprise AI the Knowledge Graph can also be set up to include the data relevant to your company such as information on your customers, products, employees, business processes, documents and systems and enable search, analytics, questioning and learning with AI.

Frequently Asked Questions

A knowledge graph is a type of data structure to represent knowledge. It consists of entities and the connections between them. By organizing knowledge in such a way, systems can understand the context of individual facts rather than treating each fact as an independent data point.

A knowledge graph is created by first gathering all information and then by identifying the entities within the information. The relationships between the entities are then determined. All connections between the entities are then stored within the knowledge graph in graph structure and can be searched by search engines and also by AI systems in order to retrieve the most relevant information.

A knowledge graph consists of nodes (for the entities), edges (for the relationships between the entities) and properties or labels for the nodes and edges to describe the entities and relationships in more detail.

A database generally stores information within tables and records. Knowledge graphs, on the other hand, are focused around entities and the relationships connecting them, which enables a better understanding of the information within context.

As mentioned earlier, a knowledge base can contain information for users and computers to access, whereas a knowledge graph specifically represents entities and their interrelations. A knowledge base may even utilize a knowledge graph in order to interlink the information stored within it.

Knowledge graphs are also useful for more general tasks in AI, for example for semantic search, recommendation systems, question answering, knowledge retrieval and generative AI.

Yes. Knowledge graphs provide structured context to generative AI. Knowledge graphs can be combined with retrieval techniques (RAG) for generative AI applications. Knowledge graphs are useful for understanding complex relationships between multiple entities and for retrieving connected information.