Skip to main content

How to Add Context to the Divi AI Agent

Learn how to point the Divi AI Agent at the exact element, preset, variable or file you mean, using context and scope.

Of everything that changes what the Divi AI Agent gives you back, nothing matters more than telling it exactly what you mean.

A request that names a specific element, preset, or variable gets built correctly the first time; the same request left vague forces the Agent to guess, and a guess is where the wrong button, a mismatched color, or a pointless round of corrections all come from.

This article covers every way to hand the Agent that specificity: the context picker, file attachments, image and URL references, and locking a whole conversation to one module.

Adding Context to the AI Agent

Divi 5 - Adding Context to the AI Agent
  1. Open the AI Agent.

  2. Click on the Context icon Divi 5 AI Agent - Context Icon.

  3. Choose the element you want to use as context from the list.

Pro Tip: Search for what you want or browse by type. Whatever you select attaches to your message before you send it, so there's nothing left for the Agent to guess about what "it" or "this" refers to.

The Kinds of Context You Can Add

Divi 5 - The Kinds of Context You Can Add

The picker groups everything you can attach into five types, plus your site's pages and posts.

Note: For each section in the Select Context window, click the Triple dot (...) to expand the desired section.

Elements

Every module that exists on the current page appears in the Elements group.

Click one to add it as context, and the Agent works against that exact module instead of trying to guess which modules you are referring to in your prompt.

Pro Tip: You can also select an element from the page (a section, row, module), and that will become the selected context for the AI Agent.

Presets

Point at a Module Preset or an Option Group Preset you've already saved, and the Agent works from its real settings instead of you re-describing them in the request. See Presets for how to build and manage them.

Variables

Reference one of your Global Variables so the Agent uses the value you've already defined instead of inventing one. Divi 5 organizes Global Variables into seven types: colors, fonts, gradients, numbers, images, links, and text.

Canvases

Point at an off-canvas element - a popup, an off-canvas menu, or a canvas portal - so the Agent edits inside that canvas instead of your main page. See Divi 5 Canvases for what each canvas type does.

Tools

Pin a specific tool from the Agent's toolbox as context when you already know which capability you want it to reach for. What the Divi AI Agent Can Do in Divi 5 covers the full list of what's available.

Post Types

Beyond those five types, the picker also lists every page, post, product, project, Divi Library Layouts, and WordPress Menus, grouped by post type, so you can point the Agent at content that isn't open in the builder right now.

Attaching Files

Divi 5 - Attaching Files to the Divi AI Agent
  1. Click on the Attach File icon Divi AI Agent - Select a File.

  2. Select the file you want to use as context from your local computer.

You can attach:

  • JPEG and PNG images

  • TXT, HTML, and CSV text files

  • Font files

Limitations:

  • 15 attachments per chat

  • 10MB per file

  • 5MB for text files.

Note: Markdown, JSON, XML, YAML, PDF, and source-code files are not accepted. Video and audio cannot be attached at all.

Using an Image or a URL as Reference

Attachments and media references solve two different problems.

An image you attach to your message can act as a visual reference: when you ask the Agent to build a layout, it can draw on any image attached in that turn to inform the result. For more information, check out the How to Build a Page From a Screenshot or URL With the Divi AI Agent article.

Separately, when the Agent needs a specific image, video, or audio file for something it's building - filling in an image module, video module, or an audio module - it pauses and asks you for one directly in the chat, through a Media URL field where you paste a link, or a Choose from Media Library button where you pick something already on your site.

That's a different moment from attaching a file up front: it's the Agent asking you for a piece of media it's missing, not you handing it a reference.

Divi 5 - Using files as reference for the Divi AI Agent

Scoping a Conversation to One Module

Scope locks an entire conversation to a single module, so every request you send in that chat is understood as being about the selected module without you naming it again each time.

Once a scope is set, the scoped element will appear as a chip inside the prompting text area.

Click the Clear Scope icon x to remove it and go back to working across the whole page.

Divi 5 - Clear the scoped element in the AI Agent

Scope earns its keep whenever a conversation is going to be a back-and-forth about one specific element - a hero, a pricing card, a single button - rather than a single request. It's the difference between saying "this module" once and saying it in every message that follows.

How Much Context Is Too Much

More context is not automatically better.

Every module, preset, variable, and file you attach uses up part of what the Agent can hold onto in a single conversation, tracked by the Context Usage meter in the chat window.

Attach what the Agent actually needs to understand your request, not everything that might conceivably be relevant, and remove context you no longer need from the conversation.

For more details, please check out How to Manage Conversations in the Divi AI Agent article.

Did this answer your question?