How to make an Insights Backup
You can schedule to receive daily dumps of conversations in the Insights from us. This is useful if you e.g. want to routinely analyze your message data, or feed it to your own logging systems.
The setup for this process for Kindly happens totally within our Kindly Platform, under Settings -> General -> Advanced.
For this you will need either:
- Google Cloud, a GCS Bucket, and a user for Kindly to use.
- Amazon Web Services, a S3 Bucket, and a user for Kindly to use
☁️ Googe cloud - GCS bucket
Setup user for Kindly with GCS permissions
Step 1: Create a GCS bucket (skippable if you already have one)
Go to the GCS dashboard and click Create, go with default settings. Make sure public access is OFF.
Step 2: Create an Service Account
Go to the IAM dashboard, and click Create a policy.
On Grant this service account access to project step, give the service account the Storage Object Creator
You can skip giving access to users.
Step 3: Create key for the Service Account
Right after creating the Service Account, go to details of the service account. You can use the search function to help with finding the account.
After going into details page you should go to Keys tab and click on Add Key and Create new key. Select JSON as the key format. Now your browser should download a file.
Step 4: Setup GCS in Kindly
Navigate to Workspace -> Settings -> Insights Backup app.kindly.ai/workspace/[ID]/settings/message-backups
Fill out the Bucket Name and Path fields. The Google Application Credential is the content of the file you downloaded at Step 3.
Schedule
If enabled in Kindly, the job will execute every night. It will upload a file for each language in the bot to a path structure like e.g. YYYY-MM-DD/INBOX-(BOTID)_BOTNAME-LOCALE-FILEPART. This file will include norwegian conversations for BOTNAME from 12am to 12pm, 31st of aug.
Data payload example
"data": [
{
"id": "1107ff573fb78f4ffa6666a2",
"language_code": "en",
"taken_over": false,
"completed_takeover": false,
"takeover_by_agent_id": 4040,
"created": "2023-09-18T07:42:15.265000Z",
"updated": "2023-09-18T07:42:20.571000Z",
"messages": [
{
"message": "Hi! I'm Kindly's Chatbot. I can answer questions about Kindly and our services. How can I help you? 🟢<br>\n<br>Feel free to ask me a question! You can also use one of the buttons below to get started.",
"from_bot": true,
"sender": "BOT",
"score": null,
"created": "2023-09-18T07:42:15.321000Z",
"exchange_id": "c2db8b5d-6386-438c-b7ca-00a1cdc969bd",
"is_followup": false,
"exchange_type": "greeting",
"reply_type": "STANDARD",
"reply_candidates": [],
"suggestions": []
},
{
"message": "How are you?",
"from_bot": true,
"sender": "BOT",
"score": null,
"created": "2023-09-18T07:42:20.526000Z",
"exchange_id": "c83969eb-4486-4612-9d10-d09ee364169c",
"is_followup": false,
"exchange_type": "usersays",
"reply_type": "STANDARD",
"reply_candidates": [],
"suggestions": []
}
],
"feedback": [],
"context": {
"_name": "Kindly Chatbot",
"_organization_name": "Kindly Chatbot",
"_web_path": "/blog/chatbot-faq-example",
"_web_host": "www.kindly.ai",
"_web_url": "https://www.kindly.ai/blog/chatbot-faq-example",
"some_random_variable": "Some random value",
},
"web_host": "www.kindly.ai",
"web_path": "/blog/chatbot-faq-example",
"labels": [
{
"id": "2g65d747-b644-456e-b0a6-0e66c3c2dde9",
"name": "Support"
}
]
},
]☁️ Amazon Web Services - S3 bucket
Setup user for Kindly with S3 permissions
Step 1: Create a S3 bucket (skippable if you already have one)
Go to the S3 dashboard and click Create bucket, go with default settings. Make sure public access is OFF.
Step 2: Create an IAM Policy
Go to the IAM dashboard, and click Create a policy.
Go to the JSON tab, add the following (note the wildcard at the end is needed for allowing all paths within the bucket):
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": "s3:PutObject",
"Resource": "arn:aws:s3:::MY_BUCKET/*"
}
]
}Remember to replace MY_BUCKET with your actual bucket name
Step 3: Create a Group
Create a group and attach the policy from step 2.
Step 4: Create a User, and get the public key / private key
Create a user for Kindly to use, it only needs Programmatic access, add this user to the group from step 3, skip tags.
On the success-page, copy the Access key ID (public key), and the Secret access key (private key).
Step 5: Use the key-pair in Kindly
Navigate to Workspace -> Settings -> Insights Backup app.kindly.ai/workspace/[ID]/settings/message-backups

Schedule
If enabled in Kindly, the job will execute every night. It will upload a file for each language in the bot to a path structure like e.g. YYYY-MM-DD/INBOX-(BOTID)_BOTNAME-LOCALE-FILEPART. This file will include norwegian conversations for BOTNAME from 12am to 12pm, 31st of aug.
Data payload example
"data": [
{
"id": "1107ff573fb78f4ffa6666a2",
"language_code": "en",
"taken_over": false,
"completed_takeover": false,
"takeover_by_agent_id": 4040,
"created": "2023-09-18T07:42:15.265000Z",
"updated": "2023-09-18T07:42:20.571000Z",
"messages": [
{
"message": "Hi! I'm Kindly's Chatbot. I can answer questions about Kindly and our services. How can I help you? 🟢<br>\n<br>Feel free to ask me a question! You can also use one of the buttons below to get started.",
"from_bot": true,
"sender": "BOT",
"score": null,
"created": "2023-09-18T07:42:15.321000Z",
"exchange_id": "c2db8b5d-6386-438c-b7ca-00a1cdc969bd",
"is_followup": false,
"exchange_type": "greeting",
"reply_type": "STANDARD",
"reply_candidates": [],
"suggestions": []
},
{
"message": "How are you?",
"from_bot": true,
"sender": "BOT",
"score": null,
"created": "2023-09-18T07:42:20.526000Z",
"exchange_id": "c83969eb-4486-4612-9d10-d09ee364169c",
"is_followup": false,
"exchange_type": "usersays",
"reply_type": "STANDARD",
"reply_candidates": [],
"suggestions": []
}
],
"feedback": [],
"context": {
"_name": "Kindly Chatbot",
"_organization_name": "Kindly Chatbot",
"_web_path": "/blog/chatbot-faq-example",
"_web_host": "www.kindly.ai",
"_web_url": "https://www.kindly.ai/blog/chatbot-faq-example",
"some_random_variable": "Some random value",
},
"web_host": "www.kindly.ai",
"web_path": "/blog/chatbot-faq-example",
"labels": [
{
"id": "2g65d747-b644-456e-b0a6-0e66c3c2dde9",
"name": "Support"
}
]
},
]