Tech, ExplainedData platforms and AI
Product

Graph database

When the links are the point.

BEFORE ITAFTER ITGraph databaseNeo4jCOVERSNodes and linksFraud ringsRecommendationsKnowledge graphsreturnslinkedaccountsPayment fraud detection↗ IN-STORE PAYMENTSreturnsconnectedfactsRetrieval-augmentedgeneration (RAG)↗ GENERATIVE AI APPLICATIONSanswersagents'queriesAI agent framework↗ GENERATIVE AI APPLICATIONSAn app writes each newcustomer, account, deviceor document into it as anode, with links to thenodes it connects toCONCEPTS IT USESVector embeddingsBEFORE ITAFTER ITGraph databaseNeo4jCOVERSNodesand linksFraud ringsRecommendationsKnowledgegraphsreturnslinkedaccountsPaymentfraud detection↗ IN-STORE PAYMENTSreturnsconnectedfactsRetrieval-augmentedgeneration (RAG)↗ GENERATIVEAI APPLICATIONSanswersagents'queriesAIagent framework↗ GENERATIVEAI APPLICATIONSAn app writeseach newcustomer,account, deviceor documentinto it as anode, withlinks to thenodes itconnects toCONCEPTS IT USESVector embeddingsBEFORE ITAn app writes each new customer, account,device or document into it as a node, withlinks to the nodes it connects to↓Graph databaseNeo4jNodes and linksFraud ringsRecommendationsKnowledge graphsAFTER IT↓ returns linked accountsPayment fraud detection↗ IN-STORE PAYMENTS↓ returns connected factsRetrieval-augmented generation (RAG)↗ GENERATIVE AI APPLICATIONS↓ answers agents' queriesAI agent framework↗ GENERATIVE AI APPLICATIONSCONCEPTS IT USESVector embeddings
The graph database stores nodes and the links between them, and returns linked accounts to payment fraud detection and connected facts to retrieval-augmented generation and AI agent frameworks.
opens a page inside this one a page in the same scene a page in another scene a concept page a label only, with no page

A graph database is a database that stores records and the links between them, and treats each link as data in its own right. In a graph, the records are called nodes, and the links are called edges or relationships. It suits questions where the links are the point, such as "which of these accounts are connected?"

Each node has a type and details. For example, a node can be a person, a phone number or a bank account. Each edge connects two nodes and says how they are linked, such as "uses" or "paid". The database stores, with every node, where its edges lead. So it can follow a chain of links directly, one step after another.

Why not use a relational database? A relational database can store links too, as rows that point to other rows. But following a chain of four or five links means joining the same tables four or five times. On millions of rows, that becomes slow. A graph database follows the same chain in milliseconds, because it reads each link directly instead of searching for it. Graph databases have their own query languages, which describe patterns of nodes and links.

Imagine a small-loan app in Bhubaneswar that receives 6,000 loan applications a day. Each application is a node, linked to the phone, the device, the bank account and the address it used. A new application asks for ₹20,000. The graph shows that its device was used by two earlier applicants. Those two share bank accounts with others, and within four links the chain reaches 40 applicants. Eleven of them have already stopped repaying. The query takes about 50 milliseconds. The app holds the application for review. A group of accounts that works together to cheat a lender like this is called a fraud ring. Card payment systems look for rings in the same way, as part of payment fraud detection.

Graphs are also used for recommendations. Shoppers who bought this also bought that, and friends of friends may know each other; the page on recommendation systems explains the wider idea.

More recently, graphs give AI chatbots facts to base their answers on. A company records its products, documents and people as a knowledge graph. When a user asks a question, retrieval-augmented generation (RAG) fetches the connected facts and hands them to the model. Agents built on an AI agent framework can query the same graph. Factories keep an industrial knowledge graph of every machine and how it connects to others. Some graph databases also store vector embeddings, so that a search can combine meaning and links.

How is it different from a multi-model database? A multi-model database holds graphs as one of several kinds of data. A graph database is built for links alone, and is usually faster at following them.

Tech, Explained is a part of ingrid.fyi. Every page explains one piece of technology in plain words.