diff --git a/apps/x/packages/core/src/application/assistant/skills/index.ts b/apps/x/packages/core/src/application/assistant/skills/index.ts index 0d167a52..97217f76 100644 --- a/apps/x/packages/core/src/application/assistant/skills/index.ts +++ b/apps/x/packages/core/src/application/assistant/skills/index.ts @@ -10,6 +10,7 @@ import organizeFilesSkill from "./organize-files/skill.js"; import slackSkill from "./slack/skill.js"; import backgroundAgentsSkill from "./background-agents/skill.js"; import createPresentationsSkill from "./create-presentations/skill.js"; +import webSearchSkill from "./web-search/skill.js"; const CURRENT_DIR = path.dirname(fileURLToPath(import.meta.url)); const CATALOG_PREFIX = "src/application/assistant/skills"; @@ -82,6 +83,12 @@ const definitions: SkillDefinition[] = [ summary: "Discovering, executing, and integrating MCP tools. Use this to check what external capabilities are available and execute MCP tools on behalf of users.", content: mcpIntegrationSkill, }, + { + id: "web-search", + title: "Web Search", + summary: "Searching the web or researching a topic. Guidance on when to use web-search vs research-search, and how many searches to do.", + content: webSearchSkill, + }, { id: "deletion-guardrails", title: "Deletion Guardrails", diff --git a/apps/x/packages/core/src/application/assistant/skills/web-search/skill.ts b/apps/x/packages/core/src/application/assistant/skills/web-search/skill.ts new file mode 100644 index 00000000..d3d0e6e1 --- /dev/null +++ b/apps/x/packages/core/src/application/assistant/skills/web-search/skill.ts @@ -0,0 +1,52 @@ +export const skill = String.raw` +# Web Search Skill + +You have access to two search tools for finding information on the internet. Choose the right one based on the user's intent. + +## Tools + +### web-search (Brave Search) +Quick, general-purpose web search. Returns titles, URLs, and short descriptions. + +**Best for:** +- Quick lookups for things that change ("current price of Bitcoin", "weather in SF") +- Current events and breaking news +- Finding a specific website or page +- Simple questions with direct answers +- Checking a fact or date + +### research-search (Exa Search) +Deep, research-oriented search. Returns full article text, highlights, and metadata (author, published date). + +**Best for:** +- Exploring a topic in depth ("what are the latest advances in CRISPR") +- Finding articles, blog posts, papers, and quality sources +- Discovering companies, people, or organizations +- Research where you need rich context, not just links +- When the user says "research", "find articles about", "look into", "deep dive" + +**Category filter:** Use the category parameter when the user's intent clearly maps to one: company, research paper, news, tweet, personal site, financial report, people. + +## How Many Searches to Do + +**CRITICAL: Always start with exactly ONE search call.** Pick the single best tool (\`web-search\` or \`research-search\`) and make one request. Wait for the result before deciding if more searches are needed. + +**NEVER call multiple search tools simultaneously.** No parallel web-search + research-search. No firing off two web-searches at once. Always sequential: one search at a time. + +Only make a follow-up search if: +- The first search returned truly uninformative or irrelevant results +- The query has clearly distinct sub-topics that the first search couldn't cover (e.g., "compare X and Y" after getting results for X only) +- The user explicitly asks you to dig deeper + +One good search is almost always enough. Default to one and stop. + +## Choosing Between the Two + +If both tools are attached, prefer: +- \`web-search\` when the user wants a quick answer or specific link +- \`research-search\` when the user wants to learn, explore, or gather sources + +If only one is attached, use whichever is available. +`; + +export default skill;