Dialogue and roadmap

Over a development team curry last Thursday (both of us!) we did a bit of planning towards the objective of having a polite.ai useable as an alpha by selected communities by the end of the year.

After early usability feedback, we’ve decided that a dialog based interface to report problematic interactions, and challenge dubious classifications is quite important at this stage.

Our early proof of concept embedded a link in each bot challenge which could be used to report inappropriate classifications and new issues. This works, but assumes the user is working on a platform where they have a browser and also takes them out of the chat context in order to report things through a traditional form based interface. In short, it was horrible and clunky.

If we are building a bot that can participate and understand language in a multi-party chat room then having it take the reports as inline dialogue is an important milestone before we release.

Dec Target

We are currently building dialogue support for room classification, reports and challenges into the personality server. Once complete this will allow basic interactions to be understood by both Matrix.org and Slack implementations.

To get a rapid prototype running, we are using Google’s Dialogflow API to do the NLP. We will however be implementing the state machine, context transitions and responses within our own code in the personality server, delegating just the entity and intent recognition to the Google API (it also has a nice line in smalltalk).  That way, we can experiment with other tools and APIs in the medium term. In particular, I’m quite interested in experimenting with an Open Source model like Raza for the production service.

The MVP should be complete during the first few months of 2018, at which point we will be ready to start testing with selected communities. If you are interested in being an early test community then please get in touch.


It is now nearly three weeks since we started the project and there has been quite a bit of activity which is worth putting an update out about.

Core Code

We’ve taken apart the proof of concept app we built for the hackathon and started restructuring it to build a scalable, maintainable service architecture. There is a new database schema, encapsulated in a set of Javascript classes that allow us to manage records of classifications and appeals.

This has allowed us to build a generic message classification and response engine, the personality-server as a standalone micro service that records all of it’s transactions and passes responses back to much thinner service specific bot implementations. This should allow us to quickly build integrations for popular chat services (more on this below).
Part of this also includes a new language and personality module which will allow us to trivially add languages and personalities to the implementation. This is important as this is a global project – we need to bake in the ability to deal with heterogenous languages and cultures.


We did a basic Matrix integration at TADHack. Now we’ve taken care of the basic core, I’m re-building this as part of a matrix app-server. We will be hosting an alpha implementation of this this on our newly federated polite.ai matrix home server and hope to make it available to the Matrix community to start testing in early Nov.

In the meantime Joe has started work on a Slack integration which looks promising, and I’m is committed to start a HipChat integration as soon as the new Matrix code is released.

Being Open

When I kicked off the project, I had a pretty good idea of the problem I was looking to solve (and the ones I wasn’t) and put something out there that was pretty good for a hackathon project description. It was more than a single sentence anyway. Since then I’ve been head down making code work to provide proof points and MVPs

If the project is going to make an actual contribution to improving the way the world communicates then we have to solve some really very small technical problems, but some very large ethical problems.  Sound policy decisions we make at the intersection of data & algorithm ownership, machine learning and modifying human communication behaviour will be crucial. This will affect what we build and the conversation about this is now probably more urgent than writing code. I’m going spend a bit of time between now and the end of the year starting the conversation with articles here.

TADHack Wins!

We had a brilliant time over the weekend at TADHack London, brought Polite.AI to life and walked away with a London location prize and, we just found out, a Global Prize too.

If you aren’t familar with TADHack, you can find out a bit more about the results of the weekend here: TADHack Global 2017 Winners

I also wrote a bit about the process on my blog.

This is great news. I’ve lots done stuff at TADHack in the past and it is a great environment to build and, more importantly, showcase new developments. We’ve also won a few hundred dollars that we intend to use to cover server costs as we build and alpha test a production ready service. Watch this space!

TADHack Pitch

This was it, the moment that Polite-AI came alive at TADHack on the 1st October.

The presentation is very rough and ready, coming at the end of about 30-hours of hacking together an initial implementation but it does give a bit of an overview of what we achieved this weekend.

Father Ted is in the room

The last 24hrs have been fairly frantic, but we now have a polite-frted in the #test:matrix.org Matrix room for our TADHack pitch. Truth told, Joe did most of the work on this before he left last night and all we’ve managed to do is break things and then put them back together again since, but we’ve learnt loads in doing so.

REST API for classification done

First job of the day was hosting the API that I had developed last week up somewhere.

It now lives at http://api.polite.ai thanks to some free GCP developer programme credits from Google!

How to use the API

POST to http://api.polite.ai/api/1.0/classify:

    "text" : <String> // Message to be classified


    "request" : { }, // your request verbatim 
    "results" : {
        "aggression" : bool, // text is aggressive
        "attack" :  bool, // text is a personal attack
        "toxicity": bool // text is toxic 


curl -i -H "Content-Type: application/json" -X POST -d '{"text":"You stink"}' http://api.polite.ai/api/1.0/classify


{"request": {"text": "You stink"}, "results": {"aggression": "1", "attack": "1", "toxicity": "1"}}