Tock Architecture
This chapter presents the general architecture of a Tock platform: components and dependencies, flows, proxy configuration, etc.
Functional Architecture
Two major components are available:
- the NLU engine: Natural Language Understanding (see Tock Studio)
- the conversational framework integrated into NLU services and various connectors such as Messenger, Google Assistant or Slack (see developer manual and connectors).
The NLU platform is independent of the conversational part. It is possible to use the NLU without having to master the complexity induced by conversation management. In some important use cases, such as the Internet of Things, using an NLU model alone is relevant.
Technical architecture
Tock is composed of several application components (containers when using Docker) and a MongoDB database.
The Docker and Docker Compose descriptors provided (ie. the
Dockerfile
anddocker-compose.yml
) describe the architecture of Tock.A complete example can be found in the file
docker-compose-bot-open-data.yml
available in the repositorytock-docker
.
MongoDB database
The Mongo database must be configured in replica set, i.e. with at least 3 instances deployed. This is mandatory because Tock uses the Change Streams functionality which has as a prerequisite the installation in replica set.
This is also a good practice to ensure high availability of the database.
Application components
Here is a quick description of the different application components (and Docker images provided with Tock):
- Tock Studio interfaces and tools:
-
tock/bot_admin
: Tock Studio -
NLU part:
tock/build_worker
: rebuilds models automatically whenever neededtock/duckling
: parses dates and primitive types using Duckling-
tock/nlp_api
: parses sentences based on models built in Tock Studio -
Conversational part:
tock/bot_api
: API to develop bots (Tock Bot API mode)tock/kotlin_compiler
(optional): script compiler to enter them directly in the Stories and Answers interface of Tock Studio
A final component, the bot itself, must be added and made accessible to partners and external channels with which we wish to integrate.
Of course the implementation of the bot is not provided with Tock (everyone implements their own functionalities for their needs) but an example is available in
docker-compose-bot-open-data.yml
.
Deployment modes
- The NLU platform mode alone (without conversational part):
- The Tock Bot API mode (recommended for most cases), allowing to develop in Kotlin or another language through the Tock conversational API:
- The Tock Bot integrated mode (historical) allowing to develop in Kotlin only using all the possibilities of Tock but accessing the MongoDB database directly from the bot: