The Function of Enterprise Data Graphs in LLMs


Massive Language Fashions (LLMs) and Generative AI signify a transformative breakthrough in Synthetic Intelligence and Pure Language Processing. They will perceive and generate human language and produce content material like textual content, imagery, audio, and artificial information, making them extremely versatile in numerous functions. Generative AI holds immense significance in real-world functions by automating and enhancing content material creation, personalizing consumer experiences, streamlining workflows, and fostering creativity. On this learn, we are going to deal with how Enterprises can combine with Open LLMs by grounding the prompts successfully utilizing Enterprise Data Graphs.

Studying Goals

  • Purchase data on Grounding and Immediate constructing whereas interacting with LLMs/Gen-AI methods.
  • Understanding the Enterprise relevance of Grounding, the enterprise worth out of integration with open Gen-AI methods with an instance.
  • Analyzing two main grounding contending options data graphs and Vector shops on numerous fronts and understanding which fits when.
  • Examine a pattern enterprise design of grounding and immediate constructing, leveraging data graphs,  studying information modeling, and graph modeling in JAVA  for a personalised suggestion buyer situation.

This text was revealed as part of the Knowledge Science Blogathon.

What are Massive Language Fashions?

A Massive Language Mannequin is a sophisticated AI mannequin skilled utilizing deep studying strategies on huge quantities of textual content|unstructured information. These fashions are able to interacting with human language, producing human-like textual content, photos, and audio, and performing numerous pure language processing duties.

In distinction, the definition of a language mannequin refers to assigning possibilities to sequences of phrases based mostly on the evaluation of textual content corpora. A language mannequin can range from easy n-gram fashions to extra refined neural community fashions. Nonetheless, the time period “massive language mannequin” normally refers to fashions that use deep studying strategies and have numerous parameters, which might vary from hundreds of thousands to billions. These fashions can seize advanced patterns in language and produce textual content typically indistinguishable from that written by people.

What’s a Immediate?

A immediate to any LLM or an identical chatbot AI system is a text-based enter or message you present to provoke a dialog or interplay with the AI. LLMs are versatile, skilled with all kinds of huge information, and can be utilized for numerous duties; therefore, the context, scope, high quality, and readability of your immediate considerably affect the responses you obtain from the LLM methods.

What’s Grounding/RAG?

Grounding, AKA Retrieval-Augmented Technology(RAG), within the context of pure language LLM processing, refers to enriching the immediate with context, further metadata, and scope we offer to LLMs to enhance and retrieve extra tailor-made and correct responses. This connection helps AI methods perceive and interpret the information in a manner that aligns with the required scope and context. Analysis on LLMs exhibits that the standard of their response is dependent upon the standard of the immediate.

It’s a elementary idea in AI, because it bridges the hole between uncooked information and AI’s means to course of and interpret that information in a manner in step with human understanding and scoped context. It enhances the standard and reliability of AI methods and their means to ship correct and helpful data or responses.

What are the Drawbacks with LLMs?

Massive Language Fashions (LLMs), like GPT-3, have gained vital consideration and use in numerous functions, however additionally they include a number of cons or drawbacks. A number of the major cons of LLMs embody:

1. Bias and Equity: LLMs typically inherit biases from the coaching information. This can lead to the era of biased or discriminatory content material, which might reinforce dangerous stereotypes and perpetuate present biases.

2. Hallucinations: LLMs don’t actually perceive the content material they generate; they generate textual content based mostly on patterns within the coaching information. This implies they will produce factually incorrect or nonsensical data, making them unsuitable for crucial functions like medical prognosis or authorized recommendation.

3. Computational Assets: Coaching and working LLMs require huge computational sources, together with specialised {hardware} like GPUs and TPUs. This makes them costly to develop and preserve.

4. Knowledge Privateness and Safety: LLMs can generate convincing faux content material, together with textual content, photos, and audio. This dangers information privateness and safety, as they are often exploited to create fraudulent content material or impersonate people.

5. Moral Considerations: Utilizing LLMs in numerous functions, reminiscent of deepfakes or automated content material era, raises moral questions on their potential for misuse and affect on society.

6. Regulatory Challenges: The speedy improvement of LLM know-how has outpaced regulatory frameworks, making it difficult to determine acceptable pointers and laws to deal with the potential dangers and challenges related to LLMs.

It’s essential to notice that many of those cons are usually not inherent to LLMs however fairly replicate how they’re developed, deployed, and used. Efforts are ongoing to mitigate these drawbacks and make LLMs extra accountable and helpful for society. Right here is the place grounding and masking may be leveraged and be of big benefit to the Enterprises.

Enterprise Relevance of Grounding

Enterprises thrive to induce Massive Language Fashions (LLMs) into their mission-critical functions. They perceive the potential worth that LLMs may gain advantage throughout numerous domains. Constructing LLMs, pre-training, and fine-tuning them is kind of costly and cumbersome for them. Reasonably, they may use the open AI methods accessible within the trade with grounding and masking the prompts round enterprise use instances.

Therefore, Grounding is a number one consideration for enterprises and is extra related and useful for them each in enhancing the standard of responses in addition to overcoming the priority of hallucinations, Knowledge safety, and compliance, as it could drive superb enterprise worth out of the open LLMs accessible available in the market for quite a few use instances that they’ve a problem automating right this moment.

 Advantages to Enterprises

There are a number of advantages for Enterprises to implementing grounding with LLMs:

1. Enhanced Credibility: By making certain that the data and content material generated by LLMs are grounded in verified information sources, enterprises can improve the credibility of their communications, stories, and content material. This will help construct belief with clients, purchasers, and stakeholders.

2. Improved Determination-Making: In enterprise functions, particularly these associated to information evaluation and determination assist, utilizing LLMs with information grounding can present extra dependable insights. This will result in better-informed decision-making, which is essential for strategic planning and enterprise progress.

3. Regulatory Compliance: Many industries are topic to regulatory necessities for information accuracy and compliance. Knowledge grounding with LLMs can help in assembly these compliance requirements, lowering the danger of authorized or regulatory points.

4. High quality Content material Technology: LLMs are sometimes utilized in content material creation, reminiscent of for advertising, buyer assist, and product descriptions. Knowledge grounding ensures that the generated content material is factually correct, lowering the danger of disseminating false or deceptive data or hallucinations.

5. Discount in Misinformation: In an period of pretend information and misinformation, information grounding will help enterprises fight the unfold of false data by making certain that the content material they generate or share is predicated on validated information sources.

6. Buyer Satisfaction: Offering clients with correct and dependable data can improve their satisfaction and belief in an enterprise’s services or products.

7. Threat Mitigation: Knowledge grounding will help scale back the danger of creating selections based mostly on inaccurate or incomplete data, which might result in monetary or reputational hurt.

Instance: A Buyer Product Advice Situation

Let’s see how information grounding might assist for an enterprise use case utilizing openAI chatGPT

Primary prompts

Generate a brief electronic mail including coupons on advisable merchandise to buyer
Enterprise Knowledge Graphs

The response generated by ChatGPT may be very generic, non-contextualized, and uncooked. This must be manually up to date/mapped with the best enterprise buyer information, which is pricey. Let’s see how this might be automated with information grounding strategies.

Say, suppose the enterprise already holds the enterprise buyer information and an clever suggestion system that may generate coupons and suggestions for the purchasers; we might very properly floor the above immediate by enriching it with the best metadata in order that the generated electronic mail textual content from chatGPT could be precisely identical as how we wish it to be and might very properly be automated to sending electronic mail to the client with out handbook intervention.

Let’s assume our grounding engine will receive the best enrichment metadata from buyer information and replace the immediate under. Let’s see how the ChatGPT response for the grounded immediate could be.

Grounded Immediate

Generate a brief electronic mail including under coupons and  merchandise to buyer Taylor and want him a 
Completely happy vacation season from Group Aatagona,
Winter Jacket Mens - [ - 20% off
Rodeo Beanie Men’s - [ - 15% off
grounded prompt | Enterprise Knowledge Graphs

The response generated with the ground prompt is exactly how the enterprise would want the customer to be notified. The enriched customer data embedding into an email response from Gen AI is an automation that would be remarkable to scale up and sustain enterprises.

Enterprise LLM Grounding Solutions for Software Systems

There are multiple ways to ground the data in enterprise systems, and a combination of these techniques could be used for effective data grounding and prompt generation specific to the use case.  The two primary contenders as potential solutions for implementing retrieval augmented generation(grounding) are

  1. Application Data|Knowledge graphs
  2. Vector embeddings and semantic search

Usage of these solutions would depend on the use case and the grounding you want to apply. For example, vector stores provided responses can be inaccurate and vague, whereas knowledge graphs would return precise, accurate, and stored in a human-readable format.

A few other strategies that could be blended on top of the above could be

  • Linking to External APIs, Search engines
  • Data Masking and compliance adherence systems
  • Integrating with internal data stores, systems
  • Realtime Unifying data from multiple sources

In this blog, let’s look at a sample software design on how you can achieve with enterprise application data graphs.

Enterprise Knowledge Graphs

A knowledge graph can represent semantic information of various entities and relationships among them. In the Enterprise world, they store knowledge about customers, products, and beyond. Enterprise customer graphs would be a powerful tool to ground data effectively and generate enriched prompts. Knowledge graphs enable graph-based search, allowing users to explore information through linked concepts and entities, which can lead to more precise and diverse search results.

Comparison with Vector Databases

Choosing the grounding solution would be use-case-specific. However, there are multiple advantages with graphs over vectors like

Criteria Graph grounding Vector grounding
Analytical Queries Data graphs are suitable for structured data and analytical queries, providing accurate results due to their abstract graph layout. Vector data stores may not perform as well with analytical queries as they mostly operate on unstructured data, semantic search with vector embeddings, and rely on similarity scoring.
Accuracy and Credibility knowledge graphs use nodes and relationships to store data, returning only the information present. They avoid incomplete or irrelevant results. Vector databases may provide incomplete or irrelevant results, mainly due to their reliance on similarity scoring and predefined result limits.
Correcting Hallucinations Knowledge graphs are transparent with a human-readable representation of data. They help identify and correct misinformation,  trace back the pathway of the query, and make corrections to it, improving LLM (Large Language Model) accuracy. Vector databases are often seen as black boxes not stored in readable format and may not facilitate easy identification and correction of misinformation.
Security and Governance Knowledge graphs offer better control over data generation, governance, and compliance adherence, including regulations like GDPR. Vector databases may face challenges in imposing restrictions and governance due to their nontransparent nature.

High-Level Design

Let us see on a very high level how the system can look for an enterprise that uses knowledge graphs and open LLMs for grounding.

The base layer is where enterprise customer data and metadata are stored across various databases, data warehouses, and data lakes. There can be a service building the data knowledge graphs out of this data and storing it in a graph db. There can be numerous enterprise services|micros services in a distributed cloud native world that would interact with these data stores. Above these services could be various applications that would leverage the underlying infra.

Applications can have numerous use cases to embed AI into their scenarios or intelligent automated customer flows, which requires interacting with internal and external AI systems. In the case of generative AI scenarios, let’s take a simple example of a workflow where an enterprise wants to target customers via an email offering a few discounts on personalized recommended products during a holiday season. They can achieve this with first-class automation, leveraging AI more effectively.

High-level design

The Workflow

  • Workflow that wants to send an email can take the help of open Gen-AI systems by sending a grounded prompt with customer contextualized data.
  • The workflow application would send a request to its backend service to obtain the email text leveraging GenAI systems.
  • Backend service would route the service to a prompt generator service, which routes to a grounding engine.
  • The grounding engine grabs all the customer metadata from one of its services and retrieves the customer data knowledge graph.
  • The grounding engine traverses the graph across the nodes and relevant relationships extracts the ultimate information required, and sends it back to the prompt generator.
  • The prompt generator adds the grounded data with a pre-existing template for the use case and sends the grounded prompt to the open AI systems the enterprise chooses to integrate with(e.g., OpenAI/Cohere).
  • Open GenAI systems return a much more relevant and contextualized response to the enterprise, sent to the customer via email.

Let’s break this into two parts and understand in detail:

1. Generating Customer Knowledge graphs

The below design suits the above example, modeling can be done in various ways according to the requirement.

Data Modeling: Assume we have various tables modeled as nodes in a graph and join between tables as relationships between nodes. For the above example, we need

  • a table that holds the Customer’s data,
  • a table that holds the product data,
  • a table that holds the CustomerInterests(Clicks) data for personalized recommendations
  • a table that holds the ProductDiscounts data

It’s the enterprise’s responsibility to have all of this data ingested from multiple data sources and updated regularly to reach customers effectively.

Let’s see how these tables can be modeled and how they can be transformed into a customer graph.

customer graph | Enterprise Knowledge Graphs
Enterprise Knowledge Graphs

2. Graph Modeling

From the above graph visualizer, we can see how customer nodes are related to various products based on their clicks engagement data and further to the discounts nodes. It’s easy for the grounding service to query these customer graphs, traverse these nodes through relationships, and obtain the required information around discounts eligible to respective customers.

A sample graph node and relationship JAVA POJOs for the above could look similar to the below

public class KnowledgeGraphNode implements Serializable {
 private final GraphNodeType graphNodeType;
 private final GraphNode nodeMetadata;

public interface GraphNode {

public class CustomerGraphNode implements GraphNode {
 private final String name;
 private final String customerId;
 private final String phone;
 private final String emailId;
public class ClicksGraphNode implements GraphNode {
 private final String customerId;
 private final int clicksCount;

public class ProductGraphNode implements GraphNode {
 private final String productId;
 private final String name;
 private final String category;
 private final String description;
 private final int price;

public class ProductDiscountNode implements GraphNode {
 private final String discountCouponId;
 private final int clicksCount;
 private final String category;
 private final int discountPercent;
 private final DateTime startDate;
 private final DateTime endDate;
public class KnowledgeGraphRelationship implements Serializable {

 private final RelationshipCardinality Cardinality;


public enum RelationshipCardinality {




A sample raw graph in this scenario could look like below

sample raw graph | Enterprise Knowledge Graphs

Traversing through the graph from customer node ‘Taylor Williams’ would solve the problem for us and fetch the right product recommendations and eligible discounts.

There are numerous graph stores available in the market that can suit enterprise architectures. Neo4j, TigerGraph, Amazon Neptune, and OrientDB are widely adopted as graph databases.

We introduce the new paradigm of Graph Data Lakes, which enables graph queries on tabular data (structured data in lakes, warehouses, and lakehouses). This is achieved with new solutions listed below, without the need to hydrate or persist data in graph data stores, leveraging Zero-ETL.

  • PuppyGraph(Graph Data Lake)

Compliance and Ethical Considerations

Data Protection: Enterprises must be responsible for storing and using customer data adhering to GDPR and other PII compliance. Data stored needs to be governed and cleansed before processing and reusing for insights or applying AI.

Hallucinations & Reconciliation: Enterprises can also add reconciling services that would identify misinformation in data, trace back the pathway of the query, and make corrections to it, which can help improve LLM accuracy.  With knowledge graphs, since the data stored is transparent and human-readable, this should be relatively easy to achieve.

Restrictive Retention policies: To adhere to data protection and prevent misuse of customer data while interacting with open LLM systems, it is very important to have zero retention policies so the external systems enterprises interact with would not hold the requested prompt data for any further analytical, or business purposes.


In conclusion, Large Language Models (LLMs) represent a remarkable advancement in artificial intelligence and natural language processing. They can transform various industries and applications, from natural language understanding and generation to assisting with complex tasks. However, the success and responsible use of LLMs require a strong foundation and grounding in various key areas.

Key Takeaways

  • Enterprises can benefit hugely from effective grounding and prompting while using LLMs for various scenarios.
  • Knowledge graphs and Vector stores are popular Grounding solutions, and choosing one would depend on the purpose of the solution.
  • Knowledge graphs can have more accurate and reliable information over vector stores, which gives an edge for Enterprise use cases without having to add additional security and compliance layers.
  • Transform the traditional data modeling with entities and relationships into Knowledge graphs with nodes and edges.
  • Integrate the enterprise knowledge Graphs with various data sources with existing big data storage enterprises.
  • Knowledge graphs are ideal for analytical queries. Graph data lakes enable tabular data to be queried as graphs in enterprise data storage.

Frequently Asked Questions

Q1. What is a Large Language Model?

A. LLM is an AI algorithm that uses DL techniques and massively large data sets to understand, summarize, generate, and predict new content.

Q2. What is an application data graph?

A. An application data graph is a data structure storing data in the form of nodes and edges. Model them as the relationships between different data nodes.

Q3. What is a vector database?

A. A vector database stores and manages unstructured data like text, audio, and video. It excels in quick indexing and retrieval for applications like recommendation engines, machine learning, and Gen-AI.

Q4. What are embeddings in a vector store?

A. In a vector store, embeddings are numerical representations of objects, words, or data points in a high-dimensional vector space. These embeddings capture semantic relationships and similarities between items, enabling efficient data analysis, similarity searches, and machine-learning tasks.

Q5. What is the difference between structured and unstructured data?

A. Structured data is well-organized with defined tables and schema. Unstructured data, like text, images, audio, or video, is harder to analyze due to its lack of format.

The media shown in this article is not owned by Analytics Vidhya and is used at the Author’s discretion. 

Related Articles


Please enter your comment!
Please enter your name here

Latest Articles