Published on October 20, 2021
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.
To complete this tutorial you will need the following:
A Contentful account and Contentful space — the free version is fine
An understanding of how JOLT spec works
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.
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.
Next, we’ll need to create a new knowledge base within LivePerson.
Log into LivePerson and go to Conversational AI > Knowledge AI > Add Knowledge Base > External Knowledge Base.
Provide a knowledge base name, select “other” as the content provider and select the domain relevant to your use case.
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.
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.
Once you have completed these steps, use the Sync Articles button to pull the content from Contentful into the LivePerson knowledge base you created.
Go to the Articles tab, to see all the 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.