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

Creating a Product Support AI Agent using Natural Language

Created on 2024-10-22 17:13

Published on 2024-10-22 17:49

So far in this series, I've addressed the fundamental notion that recent AI innovations are transforming the very nature of software as we know it. We are no longer confined to primitive command-line and graphical user interfaces (GUIs) to activate the functionality encoded in software. This shift is exemplified through the emergence of "deceptively simple" AI agents that can seamlessly interact with users using natural language. These agents can be constructed to tackle diverse tasks, such as:

  1. Processing information from RSS or Atom feeds, which can be bundled collectively in OPML documents.

  2. Executing queries using SQL, SPARQL, SPASQL, or GraphQL directly from within a Large Language Model (LLM), laying the foundation for implementing advanced Retrieval-Augmented Generation (RAG) and GraphRAG processing pipelines that enhance response quality.

In this article, I will consolidate these insights by introducing another AI Agent focusing on Product Support, a critical aspect of Customer Service. The key differentiator here is the use of loose coupling, which enables an agentic solution where the underlying data spaces (databases, knowledge graphs, and documents) handle change sensitivity across the following lines:

1. Linking to Existing Information Sources

Identify the locations of existing information sources related to a given product (such as notes in Plain Text, JSON, or various RDF document types) and symbolically link them to a common access point—an HTTP-accessible folder. This approach centralizes access to all relevant documentation and resources.

2. Connecting Systems-of-Record

Establish connections to data source names (e.g., ODBC DSNs, JDBC URLs, SPARQL Query Service Endpoint URLs) associated with systems-of-record oriented support applications. Update information through application interfaces or APIs provided by these systems.

3. Creating a Harmonization Layer

Construct a harmonization layer atop these connections, manifesting an entity relationship that comprises machine-computable entity relationship type semantics. This layer unifies diverse data formats into a coherent model, enabling seamless integration and querying.

4. Defining Declarative Query Services

Develop query services aligned with your preferred declarative query language (such as SQL, SPARQL, or GraphQL). This allows for precise querying across harmonized data, providing flexibility and power in extracting insights.

Building and Deploying Your Product Support AI Agent

With these foundational steps in place, you can describe and deploy your Product Support AI Agent using the following guidelines:

1. Register Services with an LLM

Register OpenAI-compliant services with an LLM that supports external function calling, such as OpenAI and Mistral offerings. This capability allows the LLM to invoke external functions when handling complex queries or tasks.

2. Define Query Services Using OpenAPI Specifications

Describe your query services—endpoint URLs, operations, and invocation arguments—using terms from the OpenAPI specification in YAML or JSON documents. This formalization standardizes interactions between the LLM and external data services.

3. Implement Vector Indexing for Relevant Text Documents

Index relevant text documents using vector indexing, enabling efficient similarity searches and retrieval of contextually relevant content. This step significantly enhances the agent’s ability to respond to user inquiries with high accuracy.

4. Create Predefined Query Templates

Develop predefined query templates using your preferred query languages to address issues requiring high precision in response quality. This step ensures that common support scenarios are covered with refined queries.

5. Test Your Assistant with Random Sampling

Conduct tests using a random sampling of prompts to validate the accuracy and reliability of your AI agent. This testing phase allows you to refine and optimize the agent’s responses before deployment.

6. Deploy Your Assistant to a Web Environment

Deploy your AI agent to a website via a chatbot widget, an AI Agent Store (such as OpenAI GPT Store), or provide its OpenAI-compliant API for use in other environments like LangChain or LlamaIndex.

Basic Virtuoso Product Support Agent Example

"Basic" implying this is a smaller version of the edition deployed to our live sites and the OpenAI GPT Store.

Virtuoso Agent

This document uses natural language to describe an AI Agent that provides support to customers, partners, and prospects for our Virtuoso Data Spaces (DBMS, Knowledge Graph, and Document Management) platform. The description includes:

  1. Predefined prompt-response patterns, including query templates.

  2. Association with the SPASQL Query Service for executing SPARQL queries within SQL.

Live use of the Virtuoso Product Support Agent (click to watch demo)

Virtuoso Product Support Agent Overview

Name: Virtuoso Product Support Agent

Features

Query Processing Features

Fine-tuning

enabled: True

description: The Virtuoso Support Agent can incorporate indexed PDF content into responses when applicable. The Virtuoso Support Agent can learn and improve its response accuracy over time by incorporating {prompt}:{response} pairs from users or administrators.

It's recommended to test predefined prompts first before invoking functions or matching queries with relevant sections of the indexed document.

responseScope: The Virtuoso Support Agent SHOULD only answer questions related to Virtuoso, the software application from OpenLink Software.

sparqlProcessingBehavior:

Break the sentence down to its subject, predicate, and object basic structure.

Assign subject to {S}, predicate to {P}, and object to {O} parts of matching predefined_prompt template.

Perform template match and query execution.

predefined_prompt example:

Functions

Commands

Available Commands:

/help: Provides help on using the bot or solving common issues.

/query: Assists in formulating or fine-tuning SPARQL queries.

/config: Guides on configuring Virtuoso.

/troubleshoot: Helps diagnose and resolve problems.

/performance: Offers guidance on optimizing Virtuoso's performance.

Rules

Preferences

Formats

Initialization

Upon activation, the Virtuoso Support Agent greets the user, shares their current preferences, and awaits further instructions. If preferences are invalid or empty, it guides the user through the configuration process and confirms their preferences. The agent is always ready to adjust responses based on new fine-tuning templates.

Conclusion

The AI innovations discussed in this series highlight the disruptive changes occurring in software development and user interaction. By embracing loose coupling and leveraging the integration of LLMs, you can create powerful AI agents that deliver efficient, context-aware solutions for Product Support and beyond. These agents transcend the limitations of traditional interfaces, providing natural and intuitive interactions while ensuring precise and reliable outcomes.

Related