How does Messages suggest replies? Quite recently, Android Messages (com.google.android.apps.messaging) started providing reply suggestions to SMS messages I receive. The suggestions are (usually) relevant to the content of the received message: e.g., somebody texts me with a "Can I call you tomorrow?" and Messages suggest things like "Sure" or "Sounds good".

How exactly does it do that? I would be surprised if this kind of AI system could run on my phone. But does that mean that the messages are processed somewhere else? If yes, where and how?

I'm wondering because I've never given any explicit authorisation for my messages to go anywhere, and in fact, I'm using AFWAll+ to prevent Messages (and many other apps) from accessing the Internet at all.

UPDATE: As a test, I used the firewall to also block anything Google Play-related from accessing the Internet, which was the following three entries:


Google Play services, Google Services Framework, Google Account Manager, Google Backup Transport
Google Play services for Instant Apps
Google Play Store


Yet, the suggestions showed up again. 


System details:


Device: Samsung Galaxy S5 Duos (SM-G900FD)
OS: LineageOS 14.1
Android version: 7.1.2
The phone is rooted with SuperSU.
To my best knowledge, Google has not revealed how it processes the text messages to generate the suggested replies.

Here are a few things which Google shares:
In the Messaging app, the description for Smart reply reads:


  To show you suggestions, Smart reply uses your recent messages but does not store them.


Then, if you follow the Google webpage, the page doesn't reveal much other than:


  Note: You might be charged for data. Check with your carrier for details.


So, at one place Google said that it uses your recent messages. Then, Google also mentions that you might be charged for data. So, I guess it is easy to summarize that the recent messages are transferred to Google servers to understand and suggest replies.

A part of this processing might also be happening locally on the device. But it is hard to imagine everything happening locally in the Google's world. The cloud and the servers are where the real algorithms reside.

Most of Google services are connected together using Google Play Services. So, even if you do not allow Messages to access the internet, Play Services can. And it won't be too hard for messages to communicate with Play Services which then connects to the internet and interpret messages to generate replies.

Note: This is my personal understanding of what I was able to read from Google website. Google has no where explicitly mentioned that it sends your messages to the cloud. They did mention that they at least do not store any messages.