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

# Auto System Prompt Block

> Automatically generate system prompts to improve AI model guidance

<Frame>
  <img src="https://mintcdn.com/odella/MNHyQg3-ZFMTYSp3/block-reference/assets/auto_system_prompt_light.png?fit=max&auto=format&n=MNHyQg3-ZFMTYSp3&q=85&s=a54c4c95d388a5093125312bbd43cb5b" alt="Auto System Prompt Block Screenshot (Light Mode)" className="block dark:hidden" width="838" height="358" data-path="block-reference/assets/auto_system_prompt_light.png" />

  <img src="https://mintcdn.com/odella/MNHyQg3-ZFMTYSp3/block-reference/assets/auto_system_prompt_dark.png?fit=max&auto=format&n=MNHyQg3-ZFMTYSp3&q=85&s=c13b60526efcc339f42b86591270186b" alt="Auto System Prompt Block Screenshot (Dark Mode)" className="hidden dark:block" width="840" height="326" data-path="block-reference/assets/auto_system_prompt_dark.png" />
</Frame>

## Overview

The Auto System Prompt Block is designed to automatically generate system prompts that enhance the guidance for AI models in other blocks, such as the Ask AI Block. By taking a user-provided prompt as input, this block creates a tailored system prompt that helps define the goal and context for the AI model, resulting in more focused and relevant outputs.

## Inputs

<ParamField path="Input" type="string" required>
  A question and/or task for the agent to complete. Required. The input can be provided as:

  * A string
  * An array of strings (will be joined with newlines)
  * A chat message
  * An array of chat messages (messages will be joined with newlines)
    Other input types will be coerced to strings when possible.
</ParamField>

## Outputs

<ResponseField name="Name" type="string">
  The name of the generated agent, typically including an emoji indicating its specialty (e.g. "💰 Finance Agent").
</ResponseField>

<ResponseField name="System Prompt" type="string">
  The generated role/system prompt for the agent, tailored to the input task.
</ResponseField>

<ResponseField name="Duration" type="number">
  The time in milliseconds that the block took to execute.
</ResponseField>

## Editor Settings

<ParamField path="GPT Model" type="string" default="gpt-3.5-turbo">
  The specific GPT model to use for generating the system prompt. Available models are dynamically populated based on the LLM provider configuration. Has a "Use Input" toggle to accept the model via input instead.
</ParamField>

## Error Handling

The block will retry failed attempts up to 3 times with exponential backoff when encountering errors:

* For rate limit (429) errors, it will display "API rate limit exceeded, retrying..."
* For timeout (408) errors, it will display "API timed out, retrying..."
* Other 4xx errors will fail immediately with an error message
* The maximum retry time is 5 minutes

## Default Values

If the AI fails to generate a proper response, the block will fall back to these defaults:

* Default Name: "Default Agent"
* Default Role: "You are an AI critical thinker research assistant. Your sole purpose is to write well written, critically acclaimed, objective and structured reports on given text."

## Notes

* The block requires an LLM provider to be configured in the workflow context
* The block will automatically coerce various input types to strings
* The generated agent roles are tailored to specific domains (finance, business, travel, etc.)
* The block supports legal expertise and can target specific legal specialties when applicable

## Example Usage

1. Connect a Text block containing your task/question to the Input port
2. Select your desired GPT model in the settings
3. Connect the Name and System Prompt outputs to other blocks that need agent configuration
4. The block will generate a domain-specific agent name and role based on the input

<Frame>
  <img src="https://mintcdn.com/odella/63rQpScaEp0bDpCd/images/auto-system-prompt-example.png?fit=max&auto=format&n=63rQpScaEp0bDpCd&q=85&s=87011372e86a013de47c852a17897889" alt="Auto System Prompt Example" width="2482" height="1522" data-path="images/auto-system-prompt-example.png" />
</Frame>
