Principle:A9T9 RPA System Prompt Assembly
| Knowledge Sources | |
|---|---|
| Domains | AI_Agent, Prompt_Engineering |
| Last Updated | 2026-10-22 00:00 GMT |
Overview
Mechanism for assembling a context-aware system prompt for an AI macro agent, embedding tool definitions, environment state, and format constraints.
Description
System Prompt Assembly is the process of constructing the system prompt that guides the AI macro agent's behavior. The prompt must convey:
- Tool definitions: the available tools (`MACRO_AGENT_TOOLS`) and their schemas
- Macro format constraint: the agent must produce JS script macros, never command tables (with rationale)
- Environment state: the browser (Chrome/Firefox), OS (Windows/macOS/Linux), and XModule install status — probed fresh each turn
- OCR engine guidance: which OCR engine is configured and what engine name to write into generated macros
- uiv.* API instructions: the authoring guide for the `uiv.*` API
- Firefox overlay: browser-specific adjustments (e.g. `uiv.page.click` instead of `uiv.browser.click` on Firefox)
The `getSystemPrompt` function combines a base prompt (from `prompt_basic.ts` or a user override), the JS-first note, the environment line, and the OCR note. `detectXModuleStatus` probes the XModule2 native host for the current install state, refreshed per turn.
Usage
Use this principle when an AI agent needs a dynamically assembled system prompt that reflects the current environment and available tools.
Theoretical Basis