> For the complete documentation index, see [llms.txt](https://help.metaforms.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.metaforms.ai/survey-programming-decipher/legacy-to-unified-transition/programming-with-the-ai-assistant.md).

# Programming with the AI Assistant

**Step 1:** Access the **Agent Chat** (AI Assistant) tab to provide instructions for automated survey creation.

<figure><img src="/files/7feyFb48vBBMDk8UQ7lk" alt=""><figcaption></figcaption></figure>

**Step 2:** The system analyzes your questionnaire and prepares the first set of questions, applying appropriate AI rules.

**Note:** The time taken by AI to generate output depends on the complexity of the questions being programmed. The initial few generations will take some time as the AI reads the AI rules and the QNR to understand the context.

<figure><img src="/files/2xM7pME8zV0etkn8nlTf" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/RjudeY0nnQqOZduMc27X" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/mNJZX6mCxTmNYndmgBm8" alt=""><figcaption></figcaption></figure>

**Step 3:** Provide the prompt to create questions in the AI Assistant chat box.

<figure><img src="/files/cMFN6mvH9s48i8LKmmOA" alt=""><figcaption></figcaption></figure>

**Step 4:** Review and accept all generated questions.

<figure><img src="/files/K8gtn8yzQ6QDvWNjTMgB" alt=""><figcaption></figcaption></figure>

## No more "Apply" button for template instructions

In the **Legacy Workflow**, users had to manually click the **Apply** button above each template instruction to insert the required code/XML for that specific step.

In the **Unified Flow**, there is **no Apply button**. Users can proceed using the chat window while creating questions, and the template instructions will be applied automatically by the AI. If your template doesn't have template instructions set up, you don't need to worry about this. If needed, you can provide an additional prompt in the AI Assistant chat window (only when required).

**Step 5:** Template instructions are applied automatically—no need to manually apply node tag setups as in legacy.

<figure><img src="/files/0SwnvKxEOJpm5Oz7zR90" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/Wc3aKmHdcQXs8vccwpsW" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/wU1rpYm4HkMttLcghBlc" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/2bbHDEYJnKTQPQ2LH4Ed" alt=""><figcaption></figcaption></figure>

## Edit with AI – no need to select code

In the **Legacy Workflow**, when editing a specific section, you had to:

1. Select the specific XML section where the edit was needed.
2. Press **Ctrl + K** to open the Edit with AI widget.
3. Provide the prompt in that widget to make the edits.

In the **Unified Flow**, you don't need to select the XML at all. Simply describe the required changes in the AI Assistant chat box—the AI will figure out where the update needs to be made and apply it across multiple questions if needed. If you want to target the edits to a specific place, you can include the QID directly in your prompt.

**Step 6:** To make bulk edits—like removing brackets from all comments—just instruct the AI Assistant in chat. The AI locates and updates all relevant sections automatically.

<figure><img src="/files/EgfEADFeci2vPlkXW4Jw" alt=""><figcaption></figcaption></figure>

**Step 7:** For subsequent question generations, the AI decides placement automatically.

<figure><img src="/files/IMPcXaWdGEYpLFg1Khof" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/IBagULB78r2RhZatkm4X" alt=""><figcaption></figcaption></figure>

## Handling deleted questions

When you delete a question, the deletion is treated as **intentional**. So when you click "generate next set of questions," the AI will not regenerate the deleted ones. If you want them back, provide a prompt like:

"Create deleted questions"

**Step 9:** Sync your project to update XML and quotas

<figure><img src="/files/4c0JsG3WnbaJL9sBAdwH" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://help.metaforms.ai/survey-programming-decipher/legacy-to-unified-transition/programming-with-the-ai-assistant.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.
