# Saving your work #

Prompt engineering involves trial and error\. Keep track of your experimentation and save model\-and\-prompt combinations that generate the output you want\.

When you save your work, you can choose to save it as different asset types\. Saving your work as an asset makes it possible to share your work with collaborators in the current project\.

<!-- <table> -->

Table 1: Asset types

| Asset type            | When to use this asset type                                                                                                                                                            | What is saved                                                                                                                                           | How to retrieve the asset               |
| --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------- |
| Prompt template asset | When you find a combination of prompt static text, prompt variables, and prompt engineering parameters that generate the results you want from a specific model and want to reuse it\. | Prompt text, model, prompt engineering parameters, and prompt variables\.  <br>**Note**: The output that is generated by the model is not saved\.       | From the **Saved prompt templates** tab |
| Prompt session asset  | When you want to keep track of the steps involved with your experimentation so you know what you've tried and what you haven't\.                                                       | Prompt text, model, prompt engineering parameters, and model output for up to 500 prompts that are submitted during a prompt engineering session\.      | From the **History** tab                |
| Notebook asset        | When you want to work with models programmatically, but want to start from the Prompt Lab interface for a better prompt engineering experience\.                                       | Prompt text, model, prompt engineering parameters, and prompt variable names and default values are formatted as Python code and stored as a notebook\. | From the **Assets** page of the project |

<!-- </table ""> -->

Each of these asset types is available from the project's **Assets** page\. Project collaborators with the **Admin** or **Editor** role can open and work with them\. Your prompt template and prompt session assets are locked automatically, but you can unlock them by clicking the lock icon (![Lock icon](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/images/lockicon-new.png))\.

## Saving your work ##

To save your prompt engineering work, complete the following steps:

<!-- <ol> -->

1.  From the header of the prompt editor, click **Save work**, and then click **Save as**\.
2.  Choose an asset type\.
3.  Name the asset, and then optionally add a description\.
4.  Choose the task type that best matches your goal\.
5.  *If you save the prompt as a notebook asset only*: Select **View in project after saving**\.
6.  Click **Save**\.

<!-- </ol> -->

## Working with prompts saved in a notebook ##

When you save your work as a notebook asset, a Python notebook is built\.

To work with a prompt notebook asset, complete the following steps:

<!-- <ol> -->

1.  Open the notebook asset from the **Assets** tab of your project\.
2.  Click the Edit icon (![edit notebook icon](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/images/edit.svg)) to instantiate the notebook so you can step through the code\.
    
    The notebook contains runnable code that manages the following steps for you:
    
    <!-- <ul> -->
    
     *  Authenticates with the service.
     *  Defines a Python class.
     *  Defines the input text for the model and declares any prompt variables. You can edit the static prompt text and assign values to prompt variables.
     *  Uses the defined class to call the watsonx.ai inferencing API and pass your input to the foundation model.
     *  Shows the output that is generated by the foundation model.
    
    <!-- </ul> -->
    
3.  Use the notebook as is, or change it to meet the needs of your use case\.
    
    The Python code that is generated by using the Prompt Lab executes successfully. You must test and validate any changes that you make to the code.

<!-- </ol> -->

## Working with saved prompt templates ##

To continue working with a saved prompt, open it from the **Saved prompt templates** tab of the Prompt Lab\.

When you open a saved prompt template, **Autosave** is on, which means that any changes you make to the prompt will be reflected in the saved prompt template asset\. If you want the prompt template that you saved to remain unchanged, click **New prompt** to start a new prompt\.

For more information, see [Building reusable prompts](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/fm-prompt-variables.html)\.

## Working with saved prompt sessions ##

To continue working with a saved prompt session, open it from the **History** tab of the Prompt Lab\.

To review previous prompt submissions, you can click a prompt entry from the history to open it in the prompt editor\. If you prefer the results from the earlier prompt, you can reset it as your current prompt by clicking **Restore**\. When you restore an earlier prompt, your current prompt session is replaced by the earlier version of the prompt session\.

## Learn more ##

<!-- <ul> -->

 *  [Security and privacy for foundation models](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/fm-security.html)

<!-- </ul> -->

**Parent topic:**[Prompt Lab](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/fm-prompt-lab.html)

<!-- </article "role="article" "> -->