SearchBot is a TypeScript NPM package and CLI for running a small tool-calling search agent. It ships as @teichai/searchbot with:
- a downloadable
searchbotCLI - a ready-made OpenRouter + search tools preset
- an importable base harness for custom agents
- helpers for adding, replacing, and disabling tools
Built-in tools:
webSearch: DuckDuckGo HTML search with normalized JSON results.pageSearch: page fetching and compact relevant text extraction.pageFind: exact-term verification on fetched pages.
npm install @teichai/searchbotnpx @teichai/searchbot init my-harness
OPENROUTER_API_KEY=sk-or-... npx @teichai/searchbot ask "What is OpenRouter?"
npx @teichai/searchbot web "latest TypeScript release" --max-results 5
npx @teichai/searchbot page "https://example.com" --query "domain examples"
npx @teichai/searchbot tools listimport { createSearchBot } from '@teichai/searchbot';
const bot = createSearchBot({
openRouterApiKey: process.env.OPENROUTER_API_KEY!,
model: 'openai/gpt-oss-20b'
});
const result = await bot.ask('What is OpenRouter?');
console.log(result.finalAnswer);
console.log(result.trace.evidence);import { createSearchBot, createTool } from '@teichai/searchbot';
const echoTool = createTool({
name: 'echo',
description: 'Echo text back to the model.',
parameters: {
type: 'object',
properties: { text: { type: 'string' } },
required: ['text']
},
async execute(input: { text: string }) {
return { text: input.text };
}
});
const bot = createSearchBot({
openRouterApiKey: process.env.OPENROUTER_API_KEY!,
tools: {
includeDefaults: true,
add: [echoTool],
disable: ['pageFind']
}
});See docs/README.md for CLI, library, tool, provider, and package documentation.
OpenRouter attribution headers are sent with every built-in OpenRouter request:
HTTP-Referer: https://github.com/TeichAI/SearchBotX-Title: SearchBot by Tei