Cloudscape Design System
  • Get started
  • Foundation
  • Components
  • Patterns
  • Demos
  • Gen AI
  • GitHub 
Cloudscape Design System
  • Get started
  • Foundation
  • Components
  • Patterns
  • Demos
  • Gen AI
  • GitHub 
  • About

Gen AI

  • AI tools
    1
  • LLMs.txt files

  • Foundation
    3
  • Visual affordance
  • Colors
  • Iconography

  • Patterns
    18
  • Pattern abstraction
  • Generative AI chat
  • Ingress
  • Generative AI output label
  • Generative AI loading states
  • Progressive steps
  • Follow-up questions
  • User authorized actions
  • Variables
  • Shortcut menus
  • Response regeneration
  • Artifact previews
  • Conversational history
  • Support prompts
  • Thinking
  • Timeline overview
  • In-chat context
  • Agent management

  • Components
    5
  1. Cloudscape Design System
    • Gen AI: Patterns
    • In-chat context
    1. Cloudscape Design System
    2. Gen AI: Patterns
    3. In-chat context

    In-chat context

    This pattern covers ways users provide context to an agent during a chat interaction.

    On this page

    1. Key UX concepts
    2. Common use cases
    3. General guidelines
    4. Writing guidelines
    5. Accessibility guidelines

    About this page

    Published: June 17, 2026

    Did this page help you?

    Your feedback helps us improve our documentation.
    Provide additional feedback

    Key UX concepts

    Match the method to the context source

    The way context enters the conversation should reflect where it lives. External or third-party services may need authorization outside of the user’s environment. Local files need upload affordances. Knowledge in the user's head needs natural language.

    Confirm what was understood

    After context is provided, the agent should acknowledge what it received and how it will use it. This builds trust that the context was correctly interpreted and gives users a chance to correct misunderstandings before the agent acts on them.

    Minimize setup friction

    Context-adding should feel lightweight, not like filling out a form. Pre-fill what can be inferred, collapse completed steps, and avoid asking for information the system already has. The goal is to get from "user has context" to "agent has context" in as few interactions as possible.

    Common use cases

    Connecting an external service as context

    Users connect a third-party service to give the agent access to existing resources. A multi-step inline flow handles authorization and resource selection directly in the conversation.

    Generative AI assistant

    JD
    I have a repo. Connect my existing third-party repository so I can keep working on it in this chat.
    Great – let me connect to your third-party account so I can access your code.

    Connect to repository
    Successfully connected as John-Doe-Dev

    I need permission to read your repositories. This is a one-time authorization.

    Uploading local files as context

    Users attach local files alongside their prompt to give the agent immediate access to relevant content like configuration files, documents, or images.

    Generative AI assistant

    What can I help you with?
    JD
    I need help setting up a deployment pipeline for my project.
    I can help with that! Do you have any configuration files you can share for context?
    • buildspec.yaml
      2.4 KB

    Providing context in the prompt

    Users state project details, preferences, or constraints in natural language alongside their request. The agent confirms what it understood and applies it going forward. Use follow-up questions to clarify or gather additional details after context is provided.

    Generative AI assistant

    What can I help you with?
    JD
    I need help setting up CI/CD. Our stack is React, TypeScript, and DynamoDB. We use a monorepo with packages under /apps and follow conventional commits.
    Generating a response

    General guidelines

    Do

    • Collapse steps after they have been completed to keep the conversation focused on what's next and to save vertical space.
    • Use follow-up questions to clarify or gather additional details after context is provided.
    • Use inline chat interactions for multi-step context flows like authorization and resource selection.

    Don't

    • Don't require users to leave the conversation to configure conversational context in a separate settings page.
    • Don't show multiple context-adding steps simultaneously. Complete one before presenting the next.

    Writing guidelines

    General writing guidelines

    • Use sentence case, but continue to capitalize proper nouns and brand names correctly in context.

    • Use end punctuation, except in headers and buttons. Don’t use exclamation points.

    • Use present-tense verbs and active voice.

    • Don't use please, thank you, ellipsis (...), ampersand (&), e.g., i.e., or etc. in writing.

    • Avoid directional language.

      • For example: use previous not above, use following not below.

    • Use device-independent language.

      • For example: use choose or select not click.

    Component-specific guidelines

    Expandable section header

    • Use a short, action-oriented label that describes what the user needs to do.

      • For example: Connect to repository or Select repository.

    Success indicator

    • Confirm what context was connected or added. Include identifying details so users know exactly what context the agent now has. Follow writing guidelines for

      • For example: Successfully connected as John-Doe-Dev or Connected to repository.

    Authorization prompt

    • Explain what permission is needed and why in one sentence.

      • For example: I need permission to read your repositories. This is a one-time authorization.

    Accessibility guidelines

    General accessibility guidelines

    • Follow the guidelines on alternative text and Accessible Rich Internet Applications (ARIA) regions for each component.

    • Make sure to define ARIA labels aligned with the language context of your application.

    • Don't add unnecessary markup for roles and landmarks. Follow the guidelines for each component.

    • Provide keyboard functionality to all available content in a logical and predictable order. The flow of information should make sense.

    Did this page help you?

    Your feedback helps us improve our documentation.
    Provide additional feedback
    • About
    • Connect
    • Privacy 
    • Site terms 
    • © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Made with ❤️ at AWS