# Tune Instructions

Aissistant's behavior is driven by the **instructions** and **contexts** provided. There are three levels of instructions and contexts, **Global**, **Session**, and **Interaction**, that can be used to efficiently fine-tune the behavior of Aissistant.&#x20;

### Instruction Levels

Below is a summary of three levels of contexts & instructions

<table><thead><tr><th width="144">Level</th><th width="121">Place to configure</th><th width="113">Trigger</th><th width="135">Lifecycle</th><th>Suited use case</th></tr></thead><tbody><tr><td>Global</td><td>Workspace</td><td>Always</td><td>Throughout entire session</td><td>High level, global, and important guidance that applies to all circumstance.</td></tr><tr><td>Session (Contextual)</td><td>Smart Taggers</td><td>Triggered with Sub Agents</td><td>Once triggered, throughout entire session</td><td>Related to specific topic, and important to be sticky to the session once the topic is identified. For example, some workflow, procedure, or guidance to handle a specific topic.</td></tr><tr><td>Interaction (Transient)</td><td>Assets</td><td>Triggered with current user input </td><td>Only the current interaction </td><td>e.g., FAQ (Frequently Asked Questions). It can also be used to provide information on workflow, procedures, or guidance, especially when they are hard to describe in a simple format, for example, diagnosis. </td></tr></tbody></table>

### What can Instructions do and can not do?

In general, instruction can be used to change the response, however, can not be used to retrieve information (this can be done through smart action) or output tag / comment / action (this is done through sub agents or smart actions)

| Can do                                                                   | Can not do                                                                                                 |
| ------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------- |
| Dictate the format, length or tone of the response                       | Create tag (this can be done via Sub Agent)                                                                |
| Direct specific response under provided circumstances                    | Retrieve information from API or Database (this can be done via Smart Action)                              |
| Demand AI to pay attention to specific information when compose response | Create summary or comment in the Agent Platform (this can be done via Sub Agent)                           |
| Ask AI to follow described logic or sequence in diagnosis                | Keep the conversation / ticket open                                                                        |
| Provide guidelines for AI response (specific ones work better)           | Outbound actions like send email / notification or change the database (this can be done via Smart Action) |

### What can Context Do?

Context, whether in Global, Tag or Asset, is usually used to provide contextual information for AI to generate the best informed response.&#x20;

### Global Instructions & Contexts&#x20;

Global instructions and contexts are defined in the Workspace Configuration, which take effect in all interactions throughout the session. Those instructions and contexts are supposed to be abstract, high-level, and/or important information for AI, e.g., instructions like "be succinct and no more than 160 characters in response", "never confirm the appointment in the conversation, instead tell users that you will let the team know and someone will reach out for confirmation.", etc.&#x20;

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

{% hint style="info" %}
Other special type of instructions and contexts include business name, identity, purpose, and tasks, etc, which are also in the workspace configuration. Those special instructions are also global and can substantially change the behavior of Aissistant in specific circumstance.&#x20;
{% endhint %}

### Session (Contextual) Instructions & Contexts&#x20;

Session instructions and contexts are defined in Sub Agents which often represents specific topics or contexts. Therefore the instructions and contexts are also called "contextual instruction" and "contextual context" respectively, which are only triggered when the conversation match the Sub Agent scenarios.

Comparing with Global ones, session instructions and contexts are often more effective because it reduces chance of confusion to AI instead of providing a massive amount of information, some of which might be conflicting, to AI as Global instructions do. For context specific instruction or information, we highly recommend to organize them in the sub agents.

{% hint style="info" %}
Session instructions and contexts, once triggered, stay throughout the entire session. This is the major difference between the information in Session instruction & context vs. Interaction instruction & context, which only exists in the current interaction.
{% endhint %}

{% hint style="info" %}
Information retrieved from "[Smart Action](/integrations.md)" is also considered as session contexts.
{% endhint %}

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

### Interaction Instructions & Contexts

Interaction instruction and contexts are defined in assets which can be [domain](/tutorial/turn-assets-into-ai/domain-website.md), [webpage](/tutorial/turn-assets-into-ai/web-page.md), [Google Doc](/tutorial/turn-assets-into-ai/google-drive-doc.md) and others. Those information are triggered by the current interaction and only exist in the lifecycle of current interaction, therefore transient.&#x20;

Please refer to "[Turn assets into AI](/tutorial/turn-assets-into-ai.md)" for details on how to use assets to provide information to AI.


---

# 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://doc.aissist.io/tutorial/tune-instructions.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.
