Intelligent apps are emerging as the next frontier in analytics and application development. Learn how to build intelligent apps on MongoDB powered by Google Cloud with TensorFlow for machine learning and DialogFlow for artificial intelligence. Get your developers and data scientists to finally work together to build applications that understand your customer, automate their tasks, and provide knowledge and decision support.
3. Analytics is a Constant Underachiever
2000
Business Intelligence
Data Warehouse, OLAP, Ad-
hoc, Reporting, Dashboards
Big Data
Hadoop, MapReduce,
Predictive, ML, Real-time
2010
AI
Intelligent Things, IoT,
Systems of Engagement
2018
“In 2018, 75% of AI projects will underwhelm because they fail to model operational
considerations, causing business leaders to reset the scope of AI investments.”
FORRESTER.COM/PREDICTIONS
4. $40B+ eCommerce platform
experience of millions of mobile
gamers
metadata for every single item
for sale on eBay.com
world’s leading design
collaboration platform
20M+ users
$150B+ traded
reinvent travel for millions of
customers
lab and clinical analysis for
innovative medicines
personal and business finance
management worldwide
Applications Change Our World
6. What’s an Intelligent App?
Applications are combining real-time analytics, machine learning and AI to better
understand the customer, automate tasks, and provide knowledge and decision
support
7. Why Is This Hard?
Intelligent App
Developers
Data
Scientists
RELEASE DEFINE
BUILD
AGILE
DAT
A
PREP
BUILD
MODEL
GET
INSIGHT
VIZ
DEPLOY
TRAIN/EVAL
Data
Engineers
S
E
R
V
E
A
C
Q
U
I
R
E
M
O
N
I
T
O
R
S
C
A
L
E
P
R
E
P
A
R
E
11. Stitch: MongoDB Serverless Platform
Streamlines app development
with simple, secure access to data and
services
thousands of lines less code to write and no
infrastructure to manage
Gets your apps to market
faster and reduces
operational costs
12. SwagStore: How We Built It
UI components
Routes
Application Flow Control
Google Authentication
Twilio Notifications
Functions
Rules
Triggers
Service Integrations
Flexible Document Model
Easy to Work With Data
16. Intelligent SwagStore: How We Built It
SwagStore
Google Cloud ML
trains and tunes model using
TensorFlow WALS Algorithm
Google Cloud Endpoints
serve recommendations
Stitch initiates
recommendations
developer data scientist developer
data engineer
17. Production Recommendations on GCP
Google Analytics
BigQuery
Intelligent Web
Application
Rec API
App Engine
Cloud
Endpoints
Model Training
Cloud Machine Learning
Orchestration
Cloud Composer
ML Data
Training
Model files
Browser
Client
Mobile Client
18. The Recommendation API
Google Analytics
BigQuery
Rec API
App Engine
Cloud
Endpoints
Model Training
Cloud Machine Learning
ML Data
Training
Model files
UserID
User factor x
Item factors
Item ID &
User ID
Maps
Sort & Filter
Item
Index
List
Item ID &
User ID
Maps
Item ID
List
ML Model
19. Training Recommendation Model
1. install the model code
2. place data into your Cloud Storage Bucket
3. run training script
./mltrain.sh train gs://recserve_jfmlrecengine/swag_pageviews.csv
--data-type web_views
4. trained model data
(numpy arrays) is saved
back into Cloud Storage
Bucket
20. Tuning Recommendation Model
Hyperparameter tuning optimizes your machine learning model for
most accuracy - “the art of data science”
1. hyperparameters passed to the tuning job on
Cloud ML Engine
2. model writes a TensorFlow summary with the
metric that evaluates the quality of the model
3. summary metric enables the search process of the
Cloud ML Engine hyperparameter tuning service to
rank the trials
./mltrain.sh tune
gs://recserve_jfmlrecengine/swag_pageviews.csv -
-data-type web_views
21. AI does AI
Systematic exploration
of the model space, using
the techniques finessed in
AlphaGo, yields super-human
performance in AI network design
The X axis is model size. The Y axis is accuracy
22. Generate Recommendations
model.py : generate_recommendations - input
user: row index of the user in the rating matrix
items: list of indexes for items that the user has viewed
latent factors: row and column factors generated by training the model
number of desired recommendations
https://jfmlrecengine.appspot.com/recommendation
?userId=5448543647176335931&numRecs=6
{"items":
["299824032"
,"299935287"
,"299865757"
,"299959410"
,"298157062"
,"299816215"
]}
23. Serving Recommendations with Stitch
MongoDB Stitch send a HTTP GET
request to Google Cloud Endpoint
to obtain recommendations
For user who is logged in
Get list of product
recommendations
Update user profile with that
list
Service Integrations make it
simple for your app to use any
third party service
Functions:
build complex logic
orchestrate data between clients and services
scale to meet usage
27. Intelligent SwagStore: How We Built It
SwagStore
Google DialogFlow:
Intent, Entities, Webhooks
Stitch - Intent Fulfilment Slack - Front End
developer
data scientist
developer
data engineer
28. DialogFlow + Stitch Architecture
Stitch HTTP
Service
Webhook
Stitch Functions to
retrieve products
from MongoDB
29. Me: “Can you help me find a jacket ?”
ChatBot: “What color would you like?”
Me: “White”
ChatBot: “I found you a
white Egmont Jacket”
Rich and Natural Conversations
Stitch Service Integrations
31. Enabling DialogFlow Fulfillment With Stitch
perform $find given
parameters requested by
DialogFlow: product
type and product color
return item from SwagStore
Catalog to DialogFlow
{
"fulfillmentText": "I found you
a white Egmont Packable Jacket.
Check it out here: https://mdb-
swag-
store.netlify.com/products/299824
032"
}