# Quick start

In this quick start guide, we will build a bot server in Python and then integrate it with Poe. Once you have created a Poe bot powered by your server, any Poe user can interact with it. The following diagram might be useful in visualizing how your bot server fits into Poe.

<figure><img src="https://435547813-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTcfB81SirqQZbLYjoxuW%2Fuploads%2Fgit-blob-5e95b1c13bf1c3670feb2d3521622b1aeba4d69b%2Fimage%20(14).png?alt=media" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
For more information on Poe server bots, check out the [poe-protocol-specification](https://poe-developers.gitbook.io/documentation/server-bots/poe-protocol-specification "mention").
{% endhint %}

## Deploying your bot

We recommend using [Modal](https://modal.com/?utm_source=poe) to deploy your bot, but you can also use any cloud provider of your choice; all you need to do is to make the bot server available at a publicly available URL and once you have that, you can skip to [integrating it with Poe](#integrating-with-poe). In order to use Modal to deploy your bot, do the following.

#### Step 1: Install the Modal client

Make sure you have Python installed. Open a terminal and run `pip install modal-client`

{% hint style="info" %}
You might have to use pip3 instead of pip depending on your version of Python.
{% endhint %}

#### Step 2: Setup your Modal token

This step involves setting up access to modal from your terminal. You only need to do this once for your computer. In the terminal, run `modal token new --source poe`. If you run into a "command not found" error, try [this](https://modal.com/docs/guide/troubleshooting#command-not-found-errors).

If that command runs successfully, you will taken to your web browser where you will be asked to log into modal using your Github account.

<figure><img src="https://435547813-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTcfB81SirqQZbLYjoxuW%2Fuploads%2Fgit-blob-d063b975ddc06a413e2a173f8664de1f6c81720e%2Flogin.png?alt=media" alt=""><figcaption></figcaption></figure>

After you login, click on "create token". You will be prompted to close the browser window after that.

<figure><img src="https://435547813-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTcfB81SirqQZbLYjoxuW%2Fuploads%2Fgit-blob-b07c55b69c728d46f817c6d036a2df4525d57bd3%2Fcreate_token.png?alt=media" alt=""><figcaption></figcaption></figure>

#### Step 3: Clone the starter code and deploy to Modal

In your terminal, run:

* `git clone https://github.com/poe-platform/server-bot-quick-start`
* `cd server-bot-quick-start`
* `pip install -r requirements.txt`
* `modal deploy echobot.py`

Modal will now deploy your app and output two urls: a) the endpoint at which your app is hosted b) an internal page where you can monitor your app. You will be using the former to integrate your bot into Poe.

## Integrating with Poe

Once you have a bot running under a publicly accessible URL, it is time to connect it to Poe. You can do that on your desktop by going to the bot creation [form](https://poe.com/create_bot?server=1). You can customize how your bot looks by providing a picture, name and description. After you fill out the server URL and click "create bot", your bot should be ready for use on all Poe clients.

## Iterating on your bot

* For faster iteration on your bot, we recommend using Modal's serve command (as in `modal serve echobot.py`). On running that command, Modal will deploy an ephemeral version of your app which live updates in response to any code change. In addition, any print/debug statements will output to your terminal.
* The README provides a brief description of the other example bots included in the repo. Feel free to iterate upon and/or deploy them.

## Where to go from here

* One of the advantages of building a bot on Poe is the ability to invoke other Poe bots. In order to learn how to do that check out: [accessing-other-bots-on-poe](https://poe-developers.gitbook.io/documentation/server-bots/accessing-other-bots-on-poe "mention").
* Check out other detailed guides that show you how to enable specific features:
  * [rendering-an-image-in-the-response](https://poe-developers.gitbook.io/documentation/server-bots/rendering-an-image-in-the-response "mention")
  * [enabling-file-upload-for-your-bot](https://poe-developers.gitbook.io/documentation/server-bots/enabling-file-upload-for-your-bot "mention")
  * [setting-an-introduction-message](https://poe-developers.gitbook.io/documentation/server-bots/setting-an-introduction-message "mention")
* Refer to the [specification](https://poe-developers.gitbook.io/documentation/server-bots/poe-protocol-specification) to understand the full capabilities offered by Poe server bots.
* Check out the [fastapi-poe](https://pypi.org/project/fastapi-poe/) library, which you can use as a base for creating Poe bots.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://poe-developers.gitbook.io/documentation/server-bots/quick-start.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
