Information should be easily accessible and ubiquitous. Often data requires complex user experiences through limited devices. Instead, what if data can be conversational through commonly used communications tools like Facebook Messenger and Amazon Alexa voice recognition.
Sonar bot provides a natural language interface to local government open data and demographic services that helps people ask questions of their community.
This project is a prototype concept that is still evolving. It currently supports:
- Facebook messenger
- Slack
- Alexa Echo Skills
- /sonar map of 201 4th St NE, Washington, DC
- /sonar tell me about trash at 201 4th St NE, Washington, DC
- @sonar what are the bus stops at stanton park, Washington, DC
- Speak: safety of 201 4th St NE, Washington, DC
- Speak: Add note dangerous intersection at 2nd & constitution, Washington, DC
- /sonar see notes at 201 4th St NE, Washington, DC
/sonar map of 708 10th St NE, Washington, DC
/sonar tell me about trash at 708 10th St NE, Washington, DC
- Help help {Dataset}
- Hello Hello Sonar.
- Hal Open the pod bay doors HAL.
- Ping ping {Dataset}
- GetPopulation give me the population of {Location}
- GetPopulation how many people live nearby {Location}
- GetPopulation what is the population of {Location}
- GetPopulation population {Location}
- GetPopulation people in {Location}
- GetCrime safety of {Location}
- GetData what is the {Dataset} of {Location}
- GetData what is the nearest {Dataset} at {Location}
- GetData tell me about {Dataset} at {Location}
- GetData ask about {Dataset} at {Location}
- GetData when is {Dataset} for {Location}
- SummarizeData how many {Dataset} at {Location} since {TimePeriod}
- SummarizeData in past {TimePeriod} how many {Dataset} at {Location}
- AddNote add note {Note} at {Location}
- GetMap map of {Location}
- GetMap see {Dataset} at {Location}
- ExitApp stop
Sonar is built with ClaudiaJS and hosted on Amazon Web Services.
To start developing, you will need to use an Amazon developer account.
First run trhough the Installing and Configuring Claudia.js documentation, specifically the parts about installing Claudia globally (npm install claudia -g
) and Configuring Access Credentials. Then:
- Clone this repo
npm install
- Update your preferred AWS region in
package.json
andclaudia.json
- Create (first time):
npm run create
- Creating will deploy the appropriate API endpoints and lambda functions, but you must also then configure the platforms you want. For example,
- For Alexa:
claudia update --configure-alexa-skill
- For Slack:
claudia update --configure-slack-slash-command
- etc
- For Alexa:
- Updates:
npm run update
- will re-deploy your code to AWS.
To use the geoenrichment services for population, you will need to add an ArcGIS Token to the Amazon API Gateway Stage Variables
- Visit Amazon API Gateway
- Within your API, click on "Stages"
- Click on "latest"
- Click on tab "Stage Variables"
- Click on "Add Stage Variable"
- In Name text input, enter
arcgisToken
and in Value text input enter your token - Click on the gray checkmark to the far right side
npm run create
or claudia create --region us-east-1 --api-module bot
npm run update
or claudia update
Requires AWS CLI.
npm run logs
or aws logs filter-log-events --log-group-name /aws/lambda/claudia-test
Copyright Esri
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
A copy of the license is available in the repository's LICENSE file.