AI & Data Driven Enterprise
Collection of practical usage and demonstration heavy posts about the practical intersection of AI, Data, and Knowledge

AI Agents & Knowledge Graphs

Created on 2024-11-04 21:11

Published on 2024-11-05 05:00

AI Agents

A genre of software applications operated through multimodal conversational interactions and equipped with varying degrees of autonomy. Today, conversational interactions are increasingly handled by Large Language Models (LLMs), while autonomy is managed through external function integration.

Generic Architecture Depicting Loose Coupling AI Agents and Data Spaces (Databases, Knowledge Graphs, and Document Collections) -- click to see animated version

Knowledge Graphs

What are they?

A collection of Entities, Entity Types, and Entity Relationship Types that enable reasoning and inference.

Knowledge Graph Types?

Why are they important?

They provide a powerful foundation for creating a System of Intelligence derived from existing Systems of Record and Systems of Engagement.

How are they created?

By describing entity and entity relationship types using a variety of open standards-based notations and associated serialization formats. For example, we could represent “New York is a city in the USA” as:

Meaning:

Labeled Property Graphs (LPGs)

Representation is modeled on a node, relationship (vertex), and node structure basis, oriented toward software interaction by programmers. Entity denotation is literal, i.e., label-based, leaving the software programmer to handle relationship type semantics in his or her code.

New York & USA Representation Example

Using the new Graph Query Language (GQL), this would be represented as:

RDF-based Knowledge Graphs

Representation is modeled using a subject, predicate, object (or entity, attribute, value) structure aligned with controlled natural language. Notations and serialization formats are typically dual-purpose (e.g., JSON-LD, RDF-Turtle, RDF-XML).

Entity denotation is based on structured identifiers, which can include hyperlinks, providing web-like navigability for interactions by human operators and software agents.

New York & USA Representation Example

Using RDF-Turtle Notation, this would be represented as:

Using RDF-Turtle Notation, and leveraging hyperlinks for denotation of subjects and predicates, and a hyperlink or literal for objects:

How Do AI Agents and Knowledge Graphs Work Together?

The statistical nature of LLMs renders them suboptimal as the sole technology for effectively interacting with the fluid nature of knowledge. Knowledge Graphs complement LLMs as reliable sources of knowledge curated by domain experts. Achieving this synergy requires LLMs that support external function integration with Knowledge Graphs using Retrieval-Augmented Generation (RAG) or Graph Retrieval-Augmented Generation (GraphRAG) processing pipelines.

RAG

This approach typically uses external function integration primarily focused on vector-indexing of knowledge documents, providing richer context for prompt-response generation pipelines. Its coarse-grained nature, however, can lead to factual-sounding inaccuracies (a.k.a. hallucinations).

GraphRAG

This approach also relies on interactions with Knowledge Graphs via external functions. These functions may provide an entire Knowledge Graph or query results (e.g., SQL, SPARQL, GraphQL, or GQL) to offer rich context, reducing hallucinations through prompt-query templates.

How are AI Agents with Knowledge Graph bindings packaged?

In various ways:

  1. As custom AI Agents (or Assistants) associated with an LLM platform provider (e.g., OpenAI) that offers a store (e.g., the OpenAI Custom GPT Store).

  2. Via Chatbot widgets integrated into webpages.

  3. Via OpenAI-compliant APIs described by YAML or JSON documents.

Use Case Example

Here are three simple use case examples showcasing AI Agent interactions enhanced by loosely coupled Knowledge Graph interactions:

Click on Image to watch demonstration of the Virtuoso Support Agent from the OpenAI Custom GPT Store
Click to watch the Virtuoso Support Agent interact with a Chief Data Officer (CDO) oriented FAQ Knowledge Graph
Click to watch the Virtuoso Support Agent interact with a Product Knowledge Graph

Each of these examples is based on the following:

  1. Virtuoso Platform -- provides loosely coupled SQL, SPARQL, and GraphQL access to Data Spaces (databases, knowledge graphs, and document collections).

  2. OpenLink AI Layer -- which provides a conversational interface into Virtuoso.

Conclusion

The relationship between AI Agents and Knowledge Graphs is symbiotic, delivering a best-of-both-worlds approach that evolves software interaction into a much more productive form. This is achieved through multimodal natural language interfacing and loose coupling with Knowledge Graphs, enabling direct functionality interaction without the lossiness of command lines or basic Graphical User Interface (GUI) widgets.

  1. Create AI Agents declaratively (rather than imperatively) by describing their desired functionality.

  2. Create and enrich Knowledge Graphs for use by AI Agents.

  3. Loosely couple AI Agents and Knowledge Graphs leveraging RAG, GraphRAG, or a combination of both pipelines, as needed.

Related