From 92eea4ea618c38ae09e2263af347f5ccaf5eba67 Mon Sep 17 00:00:00 2001 From: JAE Date: Thu, 26 Mar 2026 23:12:17 +0000 Subject: [PATCH] fix: prevent LLM from using tools on casual conversation The system prompt told the model to "use tools whenever helpful" which caused Llama-3.3-70b to fire every tool on simple inputs like "hi". New prompt explicitly instructs conversational responses for chat and tool use only when explicitly requested. --- packages/web-ui/example/src/main.ts | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/packages/web-ui/example/src/main.ts b/packages/web-ui/example/src/main.ts index b493d4f..29b3997 100644 --- a/packages/web-ui/example/src/main.ts +++ b/packages/web-ui/example/src/main.ts @@ -9,13 +9,13 @@ import { CustomProvidersStore, createJavaScriptReplTool, IndexedDBStorageBackend, + ModelSelector, ProviderKeysStore, ProvidersModelsTab, ProxyTab, SessionListDialog, SessionsStore, SettingsDialog, - ModelSelector, SettingsStore, setAppStorage, } from "@jaeswift/jae-web-ui"; @@ -308,8 +308,19 @@ const createAgent = async (initialState?: Partial) => { if (agentUnsubscribe) agentUnsubscribe(); agent = new Agent({ initialState: initialState || { - systemPrompt: - "You are JAE, a helpful AI assistant and coding agent with access to tools including web search, image generation, JavaScript REPL, text-to-speech, and artifact creation. Use these tools whenever helpful.", + systemPrompt: `You are JAE, a friendly AI assistant and coding agent. + +IMPORTANT RULES: +- For casual conversation (greetings, questions, chat), just respond naturally in plain text. Do NOT use any tools for simple conversation. +- Only use tools when the user explicitly asks you to do something that requires them: + - Web Search: when user asks to look something up online + - Image Generation: when user asks to create/generate an image + - JavaScript REPL: when user asks to run code or create an interactive artifact + - Text-to-Speech: when user asks to read something aloud + - Memory: when user asks to remember or recall something + - Artifacts: when user asks to create a file, document, or visual output +- If the user just says "hi" or asks a question, respond conversationally WITHOUT calling any tools. +- Be concise and helpful. Do not demonstrate tools unprompted.`, model: getModel("venice", "llama-3.3-70b"), thinkingLevel: "off", messages: [], @@ -573,11 +584,15 @@ ${sidebar} }} >
-${!hasMessages ? html` +${ + !hasMessages + ? html`
-` : html``} +` + : html`` +}
${chatPanel}