Integrating Contentful with LivePerson knowledge bases

Published on October 20, 2021

2021-10 Knoweldge Base Integration

In this tutorial, we’ll show you how to build a knowledge base in LivePerson that pulls content from Contentful. With this integration, you will use content that is organized and managed in Contentful’s centralized content hub to power knowledge bases. This will provide more brand consistency in your knowledge bases.

LivePerson’s Knowledge AI enables brands to expose their FAQs to end-users, based on the trained domain and can be integrated with the LivePerson bots ecosystem. Learn more LivePerson knowledge bases.

Before we get started

To complete this tutorial you will need the following:

Create your content model within Contentful

To get started, we’ll create a simple content model in Contentful. The  content model represents the content types you plan to create. 

Learn about models, content types and fields in Contentful

In this example, we will only use the four fields required by the knowledge base and we’ll use the same content type for metadata and content.  The fields we’ll need are:

  • External id: A string; unique ID assigned to the article.

  • Title: The article title. This should be a complete sentence or question that the user might ask.

  • Tags:  A list of relevant keywords. These highlight the key noun(s) or word(s) in the training phrases. For example, for an article about health insurance, the tags should be "health," “insurance,” “benefits.” These should be words, not sentences.

  • Summary:  A short response or message to be sent to the user. If you include a web link, be aware that it might not display correctly across all channels. For channels, like SMS/Messaging, that send HTML as plain text, you might need to show the URL by itself, not wrapped in HTML.

Prepare delivery the API endpoint in Contentful

To pull the content into a LivePerson knowledge base from Contentful, we need a Content Delivery API endpoint similar to this: 

A Content Delivery API is a read-only API for delivering content from Contentful to apps, websites and other media. Content is delivered as JSON data. Images, videos and other media are delivered as files. The API can return up to 1,000 entries in one result. If your knowledge base has more, you can write a middle layer to fetch entries and cache them.

Using this endpoint, we can fetch all the entries of a specific content type, which is precisely what we need for LivePerson knowledge base.

Create a knowledge base within LivePerson

Next, we’ll need to create a new knowledge base within LivePerson.

logging into liveperson

Log into LivePerson and go to Conversational AI > Knowledge AI > Add Knowledge Base > External Knowledge Base.

Create a new knowledgebase in liveperson

Provide a knowledge base name, select  “other” as the content provider and select the domain relevant to your use case. 

Creating a knowledgebase in liveperson part 2

Connect Contentful to your LivePerson knowledge base

After creating the knowledge base, go to Get Content Metadata. Provide the endpoint for the Content Delivery API from the previous step and the JOLT spec to map Contentful JSON to the LivePerson knowledge base. We’ll cover this in more detail below and there is additional information on JOLT spec and mapping content in LivePerson available.

Connect liveperson knowledgebase to Contentful

Below is the JOLT spec for our use case. In this step, we are fetching content metadata for all the content from Contentful, which includes external id, title and tags. 

Content Delivery API:

JOLT spec:

Now we will go to Get Content and repeat the same process with the JOLT spec below. In this step, we are fetching the content based on the external id. For simplicity we are just mapping title, summary and external id. You can map more fields as needed for your use case.

Content Delivery API:

JOLT spec:

If you need more detail, LivePerson provides information on setting up external knowledge bases

Pull your content into the knowledge base 

Once you have completed these steps, use the Sync Articles button to pull the content from Contentful into the LivePerson knowledge base you created.

Sync Articles Button

Go to the Articles tab, to see all the content that is pulled from Contentful.

See content that is pulled from Contentful

Now you have successfully created an external knowledge base in LivePerson that pulls content from Contentful.

Learn more about using Contentful to centralize knowledge base content.

Subscribe for updates

Build better digital experiences with Contentful updates direct to your inbox.

Related articles

Illustrated graphic representing what is REST API
Guides

What is a REST API?

October 4, 2021

GraphQL and REST are two different approaches for building APIs. Let's dig into both of them, with examples to demonstrate how they handle data retrieval.
Guides

GraphQL vs. REST: Exploring how they work

August 16, 2023

Headless commerce is here to stay. Let's take a look at the key terms, the benefits, critical characteristics of headless commerce architecture, and more.
Guides

Headless commerce explained

February 21, 2024

Contentful Logo 2.5 Dark

Ready to start building?

Put everything you learned into action. Create and publish your content with Contentful — no credit card required.

Get started