Quickstart guide for AI assistant
A quick guide to build your first AI assistant app from our template.
Are you looking to build an AI assistant app? This guide is for you!
We will cover all the steps required to build your first AI assistant app in three different sections:
- Creating and configuring your app in the monday platform
- Running the sample app on your local environment
- Connecting your local environment to the monday platform
By the end, you'll have your own functioning app by the end of it! If at any point you want to see how the code works, check out our live coding session.
Creating and configuring your app
We're going to start in the monday.com UI. If you haven't got a monday account yet, sign up for one here.
Enable the AI assistant beta
Since the AI Assistant is still in preview mode, you'll need to enable it on your account once you create one. The account admin also needs to enable developer mode to test the app.
- Click on your profile picture in the top right corner.
- Select monday.labs.
- Type Developer mode in the search bar.
- Click Activate and close the modal.
- Wait for the page to refresh.
- Type Ai apps assistant for developers in the search bar.
- Click Activate and close the modal.
- Wait for the page to refresh and open a monday board.
- Accept the terms in the Welcome to AI Assistant popup.
Create an app
You're ready to create your app once you've enabled the AI assistant beta!
- Click on your profile picture in the top right corner.
- Select Developers. This will open the Developer Center in a new tab.
- On the new tab, click Create app.
- Change the name of your app and hit Save.
Create an AI assistant feature in your app
After creating an app, you can add an AI assistant feature. In this step, you'll also need to select a location for your feature too.
- Navigate to the Features tab and select Create feature.
- On the pop-up, click Filter by type and select AI. This will show you all the locations where the AI assistant is supported.
- Choose the Board header AI assistant.
- Click Empty feature and then Create.
- Rename the feature and select the Wide shape.
- Click Save to save your changes.
Running your local environment
Download the example code
Download the example code from Github. You can either download the zip file from Github or use the git clone command:
git clone https://github.com/yuhgto/monday-ai-prompt-template
Install ngrok (recommended) or use the monday tunnel
In this guide, we recommend using a service called ngrok to connect your local environment to the internet securely. You'll need to set up a free account and install the software to use it. If you do not want to use ngrok, you can also use the monday tunnel to expose your local environment to the internet.
You can skip to the next step if you've used ngrok before. If you decide you want to use the monday tunnel, its flow is effortless, and we will explain it in the next section.
To use ngrok:
- Download and install the software from the ngrok website.
- Create an ngrok account.
- Get your authtoken from your account dashboard.
- Add your authtoken to your local installation by running ngrok config add-authtoken .
Note for Mac users
Sometimes, when setting up ngrok via
brew
, you may see a permissions error. If that happens, you can open thefinder
, left click + control on the installation file, and then click open for this to work.
Set your environment variables
Now you can add the relevant API keys as environment variables.
- Create a new file called
.env.local
. - Copy the contents of
.env
into this file. - Paste in your OpenAI API key as the
OPENAI_API_KEY
. - Paste your monday API key as
MONDAY_API_KEY
. You can learn how to access your API token here. - Get your app's client secret from the main app page.
Don't want to connect to an OpenAI account?
You can edit
/app/api/prompts/route.ts
to connect to any API you choose!
Run the app locally
Once you set up the example code and ngrok, it's time to run your app.
- In your terminal, navigate to the code you downloaded:
cd monday-ai-prompt-template
. - Install the dependencies using npm:
npm install
. - Start your development server, which will run on port 3000:
npm run dev
.
Connecting your local environment to monday.com
You can complete these steps using either ngrok (recommended) or the monday tunnel.
ngrok (recommended)
Create an ngrok tunnel on port 3000
- Run
ngrok http 3000
in a new terminal window. - Copy the URL that is returned.
Paste the ngrok URL as a new build
- Copy your ngrok URL.
- Open your app and go to the AI assistant feature you created.
- Click the New build button.
- Paste your ngrok URL as the custom URL.
- Click Create build.
monday tunnel
Use the following steps if ngrok doesn't work for you.
Create a monday tunnel on port 3000
- Run
npx @mondaydotcomorg/tunnel --port 3000
in a new terminal window. - Copy the URL that is returned.
Paste the monday tunnel's URL as a new build
- Copy your monday tunnel URL.
- Open your app and go to the AI assistant feature you created.
- Click the New build button.
- Paste your monday tunnel URL as the custom URL and click Create build.
Test your app on an actual board
- Open a monday.com board.
- Click AI assistant and choose your app.
- Type something and see your app update it in real-time!
Join our developer community!
We've created a community specifically for our devs where you can search through previous topics to find solutions, ask new questions, hear about new features and updates, and learn tips and tricks from other devs. Come join in on the fun! 😎
Updated about 1 year ago