> ## Documentation Index
> Fetch the complete documentation index at: https://archie.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Creating logic with AI

> Describe what your backend should do in plain words. Archie works out which functions you need, asks about anything unclear, and lets you choose what to generate.

**Add With AI** turns a plain-language description into a set of functions. It takes two steps: describe what should happen, then choose what to generate.

## Step 1: describe it

In the **Add Logic** dialog, select **Add With AI** and click **Continue**. The first step is titled **Add Logic With AI** and reads **Step 1 of 2 · Describe It**.

![The Describe It step with an empty What Should Happen box, the Improve button, the language options, and four suggestions from your data.](https://mintcdn.com/archie-e998dbf6/FcInvfd50seksJIy/images/19-logic-describe-with-ai.png?fit=max\&auto=format\&n=FcInvfd50seksJIy\&q=85\&s=afc5c462b4af2ccc6e0111a812f27d54)

1. Type what should happen in **What Should Happen?**. For example: "When an inspection fails, notify the owner, open a work order and update the risk score."
2. Optionally click **Improve** to refine your description.
3. Choose a **Language**: **Node.js**, **Python**, **Go**, **.NET**, **Java**, or **Let Archie Decide**.
4. Click **Continue**, or press <kbd>⌘</kbd> + <kbd>Enter</kbd>.

### Suggestions from your data

Under **Suggested from your data**, Archie lists ready-made descriptions based on your data model. Each one shows how many functions it expects and how they relate, such as "3 functions · side by side" or "4 functions · one feeds 3". Select one to fill in the description.

## Step 2: choose what to generate

The second step is titled **Step 2 of 2 · Choose What to Generate**. Archie summarizes how it understood your request and shows what it plans to build.

![The Choose What to Generate step. The left column shows the description, Archie's summary, and open questions. The right column shows the service name, language, and one function with a checkbox.](https://mintcdn.com/archie-e998dbf6/FcInvfd50seksJIy/images/20-logic-function-map.png?fit=max\&auto=format\&n=FcInvfd50seksJIy\&q=85\&s=0c4dbadd38503e315b57fc4a86842a7b)

* **Questions.** When something is unclear, Archie asks. A question offers options, or a text box with an **Answer** button, and Archie marks its recommendation. Answer it, or click **Skip**.
* **Service.** The service name Archie proposes, such as `bug-resolution`. Names are 3–40 characters: lowercase letters, numbers, and single hyphens, starting with a letter. You can edit it.
* **Language.** The language Archie chose, or the one you picked. You can change it.
* **Functions.** Each function has a checkbox and a short description. Clear the checkbox for any function you don't want. Click **Add Function** to add one of your own.

The footer shows how many functions are selected. Click **Edit Description** to go back to step 1, or **Cancel** to close the dialog without creating anything. When you're ready, click **Generate**, or press <kbd>⌘</kbd> + <kbd>Enter</kbd>.

> [!NOTE]
>
> Archie generates only the functions you leave selected. Nothing is created until you click **Generate**.

## After you create the service

After Archie generates the functions, open the service. Review the code in the [Code tab](https://archie.com/docs/backend/logic/working-with-a-service.md), then [deploy it](https://archie.com/docs/backend/logic/deployments.md) to make the functions callable. Set any [environment variables](https://archie.com/docs/backend/logic/environment-variables.md) the code needs before you deploy.

## FAQ

> **Why do the suggestions mention my own tables?**
>
> Suggestions are built from your data model, so they reference the tables and fields in your project.

> **Can I create more than one service?**
>
> Not yet. Each project can have one service. See [Logic](https://archie.com/docs/backend/logic.md#one-service-per-project).

> **What if I want to start from code instead?**
>
> Use [From Scratch](https://archie.com/docs/backend/logic/from-scratch.md) or [From a Code Repository](https://archie.com/docs/backend/logic/from-a-repository.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.