Extend the default system prompt with additional instructions
Override the default system prompt entirely
Custom system prompts allow you to modify the agent’s behavior at a
fundamental level. Use this feature carefully as it can significantly impact
the agent’s performance and reliability.
Not recommended! If you must override the default system
prompt,
make sure to test the agent yourself.
Anyway, to override the default system prompt:
Copy
Ask AI
import { Agent } from "browsernode";import { ChatOpenAI } from "browsernode/llm";const overrideSystemMessage = `You are an AI agent that helps users with web browsing tasks.[Your complete custom instructions here...]`;// Create agent with custom system promptconst agent = new Agent( { task: "Your task here", llm: llm, overrideSystemMessage: overrideSystemMessage, });
You can customize the behavior of the planning agent by extending its system prompt:
Copy
Ask AI
const extendPlannerSystemMessage = `PRIORITIZE gathering information before taking any action.Always suggest exploring multiple options before making a decision.`;// Create agent with extended planner system promptconst llm = new ChatOpenAI(model: "gpt-4o");const plannerLLM = new ChatOpenAI(model: "gpt-4o-mini");const agent = new Agent( { task: "Your task here", llm: llm, plannerLLM: plannerLLM, extendPlannerSystemMessage: extendPlannerSystemMessage, });