Advanced prompts terminology - Amazon Bedrock

Advanced prompts terminology

The following terminology is helpful in understanding how advanced prompts work.

  • Session – A group of InvokeAgent requests made to the same agent with the same session ID. When you make an InvokeAgent request, you can reuse a sessionId that was returned from the response of a previous call in order to continue the same session with an agent. As long as the idleSessionTTLInSeconds time in the Agent configuration hasn't expired, you maintain the same session with the agent.

  • Turn – A single InvokeAgent call. A session consists of one or more turns.

  • Iteration – A sequence of the following actions:

    1. (Required) A call to the foundation model

    2. (Optional) An action group invocation

    3. (Optional) A knowledge base invocation

    4. (Optional) A response to the user asking for more information

    An action might be skipped, depending on the configuration of the agent or the agent's requirement at that moment. A turn consists of one or more iterations.

  • Prompt – A prompt consists of the instructions to the agent, context, and text input. The text input can come from a user or from the output of another step in the agent sequence. The prompt is provided to the foundation model to determine the next step that the agent takes in responding to user input

  • Base prompt template – The structural elements that make up a prompt. The template consists of placeholders that are filled in with user input, the agent configuration, and context at runtime to create a prompt for the foundation model to process when the agent reaches that step. For more information about these placeholders, see Placeholder variables in Amazon Bedrock agent prompt templates). With advanced prompts, you can edit these templates.