Skip to content

Commit 592c72f

Browse files
committed
Create web-researcher and docs-researcher (both Flash) for scout to spawn.
1 parent ae79d46 commit 592c72f

File tree

7 files changed

+101
-9
lines changed

7 files changed

+101
-9
lines changed

.agents/base2/base2-factory.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export const base2 = (model: ModelName): Omit<SecretAgentDefinition, 'id'> => ({
2626
},
2727
outputMode: 'last_message',
2828
includeMessageHistory: true,
29-
toolNames: ['spawn_agents', 'end_turn'],
29+
toolNames: ['spawn_agent_inline', 'spawn_agents', 'end_turn'],
3030
spawnableAgents: ['scout', 'planner', 'editor', 'reviewer', 'context-pruner'],
3131

3232
systemPrompt: `You are Buffy, a strategic coding assistant that orchestrates complex coding tasks through specialized sub-agents.

.agents/base2/scout.ts

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,12 @@ const definition: SecretAgentDefinition = {
88
id: 'scout',
99
publisher,
1010
model: 'google/gemini-2.5-flash',
11+
reasoningOptions: {
12+
effort: 'low',
13+
exclude: true,
14+
},
1115
displayName: 'Lewis & Clark',
12-
spawnableAgents: ['file-explorer', 'researcher'],
16+
spawnableAgents: ['file-explorer', 'web-researcher', 'docs-researcher'],
1317
toolNames: ['spawn_agents', 'end_turn'],
1418

1519
inputSchema: {
@@ -30,14 +34,17 @@ Then answer the question to the best of your ability.
3034
3135
You cannot use any other tools beyond the ones provided to you. (No abiltity to read files, write files, or run terminal commands, etc.)
3236
37+
Note: when you spawn the file-explorer, it takes a params field, which is an object with a prompts field, which is an array of strings.
38+
Note: No need to spawn multiple file-explorer agents, but you can spawn multiple web-researcher or docs-researcher agents.
39+
3340
${PLACEHOLDER.FILE_TREE_PROMPT}
3441
${PLACEHOLDER.KNOWLEDGE_FILES_CONTENTS}`,
3542

3643
instructionsPrompt: `Instructions:
37-
1. Use <thinking> tags to think about which agent(s) to spawn.
38-
2. Spawn the file explorer, researcher, or both at the same time with the spawn_agents tool.
39-
3. Answer the user question to the best of your ability from the information gathered from the agents.
40-
4. Use the end_turn tool.`,
44+
In your thinking, consider which agent(s) to spawn.
45+
1. Spawn the file-explorer, web-researcher, docs-researcher, or any combination of the above at the same time with the spawn_agents tool. Do not spawn any more agents after this step. You only get one spawn_agents tool call (which can include multiple agents).
46+
2. Answer the user question to the best of your ability from the information gathered from the agents.
47+
3. Use the end_turn tool.`,
4148
}
4249

4350
export default definition

.agents/docs-researcher.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { publisher } from './constants'
2+
import { docsResearcher } from './factory/docs-researcher'
3+
4+
import type { SecretAgentDefinition } from './types/secret-agent-definition'
5+
6+
const definition: SecretAgentDefinition = {
7+
id: 'docs-researcher',
8+
publisher,
9+
...docsResearcher('google/gemini-2.5-flash'),
10+
}
11+
12+
export default definition

.agents/factory/docs-researcher.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import type { SecretAgentDefinition } from '../types/secret-agent-definition'
2+
import type { Model } from '@codebuff/common/constants'
3+
4+
export const docsResearcher = (
5+
model: Model,
6+
): Omit<SecretAgentDefinition, 'id'> => ({
7+
model,
8+
displayName: 'Doc',
9+
spawnerPrompt: `Expert at reading technical documentation to find relevant information.`,
10+
inputSchema: {
11+
prompt: {
12+
type: 'string',
13+
description:
14+
'A question you would like answered using technical documentation.',
15+
},
16+
},
17+
outputMode: 'last_message',
18+
includeMessageHistory: false,
19+
toolNames: ['read_docs', 'end_turn'],
20+
spawnableAgents: [],
21+
22+
systemPrompt: `You are an expert researcher who can read documentation to find relevant information. Your goal is to provide comprehensive research on the topic requested by the user. Use read_docs to get detailed documentation.`,
23+
instructionsPrompt: `Instructions:
24+
1. Use the read_docs tool to get detailed documentation relevant to the user's question.
25+
2. Provide a comprehensive report of the documentation. Include key findings, relevant insights, and actionable recommendations.
26+
3. End your response with the end_turn tool.
27+
`.trim(),
28+
})

.agents/factory/web-researcher.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import type { SecretAgentDefinition } from '../types/secret-agent-definition'
2+
import type { Model } from '@codebuff/common/constants'
3+
4+
export const webResearcher = (
5+
model: Model,
6+
): Omit<SecretAgentDefinition, 'id'> => ({
7+
model,
8+
displayName: 'Weeb',
9+
spawnerPrompt: `Expert at browsing the web to find relevant information.`,
10+
inputSchema: {
11+
prompt: {
12+
type: 'string',
13+
description: 'A question you would like answered using web search',
14+
},
15+
},
16+
outputMode: 'last_message',
17+
includeMessageHistory: false,
18+
toolNames: ['web_search', 'end_turn'],
19+
spawnableAgents: [],
20+
21+
systemPrompt: `You are an expert researcher who can search the web to find relevant information. Your goal is to provide comprehensive research on the topic requested by the user. Use web_search to find current information.`,
22+
instructionsPrompt:
23+
`Provide comprehensive research on the topic. Use web_search to find current information.
24+
In your report, include key findings, relevant insights, and actionable recommendations.
25+
Always end your response with the end_turn tool.`.trim(),
26+
27+
handleSteps: function* ({ agentState, prompt, params }) {
28+
yield {
29+
toolName: 'web_search' as const,
30+
input: { query: prompt || '', depth: 'standard' as const },
31+
}
32+
yield 'STEP_ALL'
33+
},
34+
})

.agents/web-researcher.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { publisher } from './constants'
2+
import { webResearcher } from './factory/web-researcher'
3+
4+
import type { SecretAgentDefinition } from './types/secret-agent-definition'
5+
6+
const definition: SecretAgentDefinition = {
7+
id: 'web-researcher',
8+
publisher,
9+
...webResearcher('google/gemini-2.5-flash'),
10+
}
11+
12+
export default definition

common/src/tools/params/tool/read-docs.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,12 @@ export const readDocsParams = {
1313
.string()
1414
.min(1, 'Library title cannot be empty')
1515
.describe(
16-
`The exact library or framework name (e.g., "Next.js", "MongoDB", "React"). Use the official name as it appears in documentation, not a search query.`,
16+
`The library or framework name (e.g., "Next.js", "MongoDB", "React"). Use the official name as it appears in documentation if possible. Only public libraries available in Context7's database are supported, so small or private libraries may not be available.`,
1717
),
1818
topic: z
1919
.string()
20-
.optional()
2120
.describe(
22-
`Optional specific topic to focus on (e.g., "routing", "hooks", "authentication")`,
21+
`Specific topic to focus on (e.g., "routing", "hooks", "authentication")`,
2322
),
2423
max_tokens: z
2524
.number()

0 commit comments

Comments
 (0)