Tangowork chatbot uses Contentful to help customers with legal problems

An illustration depicting two message bubbles covered by a scripted parchemtn, depicting a conversation with a legal bot
February 18, 2021


Looking for answers to your legal questions can be a daunting task. So many laws, so little time. And if you’re in the difficult position of unemployment or in the middle of contract renegotiations, you might not have much time to spare.

Thankfully, you can chat with Beagle if you live in British Columbia, Canada. Beagle can help answer your everyday legal questions quickly and pleasantly. The project is run by People’s Law School, a non-profit society in British Columbia dedicated to making the law accessible to everyone.

To create Beagle, People’s Law School partnered with Tangowork for their chatbot expertise and Agentic Digital Media for their design skills. Tangowork chose Contentful to manage content and Rasa to power the chatbot AI. In this post, we discuss the reasons we chose Contentful as our content platform and the way we approached tool integration.

Screenshot of a messenger chat with the beagle chatbot

Contentful: One platform to manage content across channels

A successful chatbot requires a tremendous amount of content — having a chatbot tell you that it can’t answer your question isn’t a great experience. So Beagle’s team of lawyers spent several months writing and editing over three thousand replies across 71 topics.

We realized that the chatbot’s approachable and easy-to-read content deserved to live in several locations. After writing so many replies, it felt like a shame to use them in only one spot! We decided these helpful replies would also live on People’s Law School website. 

But no one liked the idea of managing content in two places. We explored the concept of a “headless” content management system — systems that manage just the content through APIs, leaving you to decide where that content is used. We tried them all, but nothing seemed to be mature enough for our project. 

Then we tried the Contentful content platform. Others had already used the platform to power chatbots, so we ran some experiments to see just how well it might fit our needs. We liked what we saw! 

Using Contentful and Rasa for the chatbot

We use Rasa, an open-source chatbot engine, to analyze input and decide how to respond. Rasa doesn’t generate language — all possible responses have to be written in advance. Rasa simply returns the name of a template to use. Then we retrieve that template from Contentful.

For example, in response to “i got laid off,” Rasa returns laidOff. Then a piece of middleware, built by our development team, calls the Contentful API and requests the content associated with laidOff. Contentful responds with the content, and then we format the text and send it to the chatbot:

Screenshot of texting the beagle chatbot i got laif off

Content is delivered from Contentful straight to the chatbot.

Using Contentful for the website

The chatbot response to “i got laid off” works perfectly as the introductory paragraph to a webpage. The chatbot buttons, such as “What to know,” appear as website headings. Individual chatbot speech bubbles show as website subheadings and paragraphs. (Read more about the website project in How you can grow your website traffic 51%—overnight—by radically increasing speed.)

Screenshot of website for getting temporarily laid off: Content is identical in both the chatbot and the website — it’s just reformatted.

Certain pieces of text aren’t appropriate for both the chatbot and the website. For example, we use emoji more liberally in chat. For those instances, we surround the text in question with a span tag like this: <span class="chatOnly">Cool, eh? 😎</span>. The text is then suppressed in the channel where it doesn’t apply.

Screenshot of the contentful content model for the I got laid off page

The Contentful editing interface is easy for content authors to understand.

Screenshot of Contentful beagle chatbot laid off message

Unified content management in Contentful makes high-quality content easier

People’s Law School has a rigorous standard for content. After multiple drafts by their legal content developers, content passes to a plain language reviewer, who performs another check to ensure it’s as clear and easy to read as possible. Finally, it’s reviewed for accuracy by an external lawyer.

 If this legal review process had to happen twice — once for website content and once for chatbot content — it would be unsustainable. Contentful allows us to manage a single set of content and publish it on a website and on a chatbot.

It doesn’t need to stop there. We can theoretically produce PDFs or other printed collateral via Contentful. We’re preparing for this expansion by using maximum-resolution images in Contentful’s media library in case we go down that path. (Contentful resizes and downsamples images on the fly for delivery to the website and chatbot.)

The lawyers at People’s Law School are thrilled with Contentful as their unified content management solution. “Contentful is fast, easy to use and flexible,” Drew Jackson, lawyer and project lead, says. “There’s nothing we’ve tried to do with it that it couldn’t handle. And I’m relieved that when the law changes, we don’t have to update both the website and the chatbot. We change the content once, and it updates everywhere.”

You can read more about how Contentful supports better digital experiences.

About the author

Don't miss the latest

Get updates in your inbox
Discover how to build better digital experiences with Contentful.
add-circle arrow-right remove style-two-pin-marker subtract-circle remove