Skip to main content

Customize agent context and instructions

You can choose to customize the instructions that the agent uses when building and editing apps. These instructions are useful for ensuring that apps meet your organization's standards or design rules. Depending on how broadly you want the instructions to apply, you can set them at the organization level using Building context, or at the app level using AGENTS.md.

Organization-level instructions​

Organization admins can add Building context that applies to all apps built with the app builder. Building context is applied as custom instructions in the system prompt when the user makes any changes via prompting in the Chat tab, similar to the way AGENTS.md files work. Building context is valuable for defining design practices, coding conventions, data usage recommendations, and other guidelines across your organization.

note

Building context is added to your organization's system prompt. Retool performs regular caching to ensure that this system prompt is reused between API calls to the AI provider. As a result, adding building context has a minimal impact on your organization's AI credit spend.

Create building context​

To add building context, navigate to Settings > Building context. Add your instructions in Markdown format, and click Publish to apply your changes to all apps.

Edits to building context are tracked in your audit logs as UPDATE_ORG_AGENT_CONTEXT.

Restore previous versions​

Click to view the previous versions of your building context. Click on the previous version to show a read-only preview. Click Restore to replace the current draft with the value of the previous version. Make further edits if necessary, and click Publish to apply your changes to all apps.