Welcome to Flask-Assistant!

A flask extension serving as an API.AI SDK to provide an easy way to create virtual assistants which may be integrated with platforms such as Google Actions (Google Home).

Flask-Assistant allows you to focus on building the core business logic of conversational user interfaces while utilizing API.AI’s Natural Language Processing to interact with users.


  • Maping of user-triggered Intents to action view functions
  • Context support for crafting dialogue dependent on the user’s requests
  • Define prompts for missing parameters when they are not present in the users request or past active contexs
  • A convenient syntax resembling Flask’s decoratored routing
  • Internal API.AI schema generation and registration

A Minimal Assistant

from flask import Flask
from flask_assistant import Assistant, tell

app = Flask(__name__)
assist = Assistant(app)

def hello_world():
    speech = 'Microphone check 1, 2 what is this?'
    return tell(speech)

if __name__ == '__main__':

As you can see, structure of an Assistant app resembles the structure of a regular Flask app.


  1. Initialized an Assistant object with a Flask app and the route to your webhook URL.
  2. Used the action decorator to map the greetings intent to the proper action function.
    • The action decorator accepts the name of an intent as a parameter
    • The decorated function serves as the action view function, called when an API.AI request sent on behalf of the send-message intent is received
  3. The action function returns an ask response containing text/speech which prompts the user for the next intent.

Check out the Quick Start to see how to quickly build an assistant