@ahkohd/yagami
v0.1.7
Published
Local-first web search agent
Readme
Yagami
https://github.com/user-attachments/assets/eced71f9-f60d-4b8b-929d-ecd5a3fd54f7
Local-first web search agent
Yagami gives you:
- Agentic web search:
search,search-advanced,code,company,similar - Deterministic extraction:
fetch(browse & present) - Async deep agentic web search:
deep start/deep check
Install
npm i -g @ahkohd/yagamiQuick start
yagami start
yagami doctor
yagami search "latest updates in browser automation"
yagami fetch https://example.com --max-chars 2000
yagami deep start "Research FlashAttention in LLMs with citations" --effort thorough
yagami deep check <researchId>
yagami stopPi package
Commands
yagami start/stop/status/reload/doctor— Daemon lifecycle & health checks (status --cache --tokensfor detailed stats)yagami search <query>— Agentic web search (default: collated source records)yagami search-advanced <query>— Agentic web search with filters (--include-domains,--category, etc.)yagami code <query>— Agentic code/docs-focused searchyagami company <name>— Agentic company searchyagami similar <url>— Agentic alternative/similar-site discoveryyagami fetch <url>— Deterministic single-page extractionyagami deep start <instructions>— Starts async deep agentic web searchyagami deep check <researchId>— Checks deep agentic search status/resultyagami config ...— Read/write~/.config/yagami/config.jsonyagami theme preview— Preview CLI theme styling
Useful flags:
--jsonfor machine-readable output--profilefor latency breakdown on search commands
HTTP API
The CLI talks to a local HTTP daemon (default: http://127.0.0.1:43111).
Core endpoints:
GET /healthPOST /statsPOST /reloadPOST /stopPOST /mcp(MCP over HTTP JSON-RPC)GET /mcp(returns 405; SSE stream not enabled)DELETE /mcp(terminate MCP session)POST /search,POST /search/streamPOST /search/advanced,POST /search/advanced/streamPOST /code-context,POST /code-context/streamPOST /company-research,POST /company-research/streamPOST /find-similar,POST /find-similar/streamPOST /fetchPOST /deep-research/start,POST /deep-research/check
You can configure daemon bind address with config keys (host, port) or env (YAGAMI_HOST, YAGAMI_PORT).
MCP over HTTP
POST /mcp exposes the Yagami MCP server (tools are discoverable via tools/list).
Configuration
Config file (recommended)
Default path: ~/.config/yagami/config.json (or $XDG_CONFIG_HOME/yagami/config.json).
Recommended local setup:
{
"host": "127.0.0.1",
"port": 43111,
"llmApi": "openai-completions",
"llmBaseUrl": "http://127.0.0.1:1234/v1",
"llmApiKey": "",
"llmModel": "qwen3.5-9b",
"searchEngine": "duckduckgo",
"browseLinkTimeoutMs": 7000,
"cacheTtlMs": 600000,
"maxMarkdownChars": 120000,
"operationConcurrency": 4,
"browseConcurrency": 8,
"theme": "ansi"
}Common local endpoints:
- vLLM:
http://127.0.0.1:8000/v1 - SGLang:
http://127.0.0.1:30000/v1 - Ollama:
http://127.0.0.1:11434/v1 - LM Studio:
http://127.0.0.1:1234/v1
If you run an anthropic-messages compatible local gateway:
{
"llmApi": "anthropic-messages",
"llmBaseUrl": "http://127.0.0.1:4000",
"llmApiKey": "",
"llmModel": "minimax-m2.5"
}llmApiKey is empty by default. If your local endpoint ignores auth, leave it empty.
For a custom search endpoint template:
{
"searchEngine": "custom",
"searchEngineUrlTemplate": "https://searx.example/search?q={query}&language=en"
}Canonical config.json keys
host(string, default:127.0.0.1)port(integer, default:43111)llmApi(openai-completions|anthropic-messages, default:openai-completions)llmBaseUrl(string; default:http://127.0.0.1:1234/v1, orhttps://api.anthropic.comforanthropic-messages)llmApiKey(string, default: empty string)llmModel(string, optional; if empty YAGAMI auto-detects via provider model-list endpoint)searchEngine(duckduckgo|bing|google|brave|custom, default:duckduckgo)searchEngineUrlTemplate(string URL template, optional; supports{query}placeholder; if set, overrides presets)browseLinkTimeoutMs(integer milliseconds, default:7000)cacheTtlMs(integer milliseconds for URL browse cache TTL, default:600000)maxMarkdownChars(integer markdown extraction cap forpresent(), default:120000)operationConcurrency(integer concurrent operation slots, default:4)browseConcurrency(integer concurrent browse slots, default:8)theme(ansi|none, default:ansi)themeTokens(object of token overrides, e.g.{ "domain": "cyan", "error": "red bold" })- built-in token names:
domain,title,duration,error,dim,cyan,bold
- built-in token names:
File parsing notes
ui.<key>: same keys as above under auiobject (merged over top-level)colors/themeColors: compatibility aliases forthemeTokens
Config CLI
yagami config path
yagami config show
yagami config get llmApi
yagami config set llmApi openai-completions
yagami config set port 43111 --json-value
yagami config set browseLinkTimeoutMs 7000 --json-value
yagami config set cacheTtlMs 600000 --json-value
yagami config set maxMarkdownChars 120000 --json-value
yagami config set operationConcurrency 4 --json-value
yagami config set browseConcurrency 8 --json-value
yagami config unset themeTokens.domainEnvironment variables
YAGAMI_CONFIG_FILE(default:$YAGAMI_RUNTIME_DIR/config.json)YAGAMI_RUNTIME_DIR(default:$XDG_CONFIG_HOME/yagamior~/.config/yagami)YAGAMI_HOST(default:127.0.0.1)YAGAMI_PORT(default:43111)YAGAMI_LLM_API(openai-completions|anthropic-messages, default:openai-completions)YAGAMI_LLM_BASE_URL(default:http://127.0.0.1:1234/v1, orhttps://api.anthropic.comforanthropic-messages)YAGAMI_LLM_API_KEY(default: empty string)YAGAMI_LLM_MODEL(optional)YAGAMI_SEARCH_ENGINE(duckduckgo|bing|google|brave|custom, default:duckduckgo)YAGAMI_SEARCH_ENGINE_URL_TEMPLATE(optional URL template, e.g.https://searx.example/search?q={query})YAGAMI_CDP_URL(default:ws://127.0.0.1:9222)YAGAMI_LIGHTPANDA_HOST(default: host parsed fromYAGAMI_CDP_URL)YAGAMI_LIGHTPANDA_PORT(default: port parsed fromYAGAMI_CDP_URL)YAGAMI_LIGHTPANDA_AUTO_START(default:true)YAGAMI_LIGHTPANDA_AUTO_STOP(default:true)YAGAMI_BROWSE_LINK_TIMEOUT_MS(default:7000)YAGAMI_QUERY_TIMEOUT_MS(default:180000)YAGAMI_CACHE_TTL_MS(default:600000)YAGAMI_MAX_HTML_CHARS(default:250000)YAGAMI_MAX_MARKDOWN_CHARS(default: value fromconfig.json, else120000)YAGAMI_MAX_DOCUMENTS(default:200)YAGAMI_OPERATION_CONCURRENCY(default:4)YAGAMI_BROWSE_CONCURRENCY(default:8)YAGAMI_RESEARCH_MAX_PAGES(default:12)YAGAMI_RESEARCH_MAX_HOPS(default:2)YAGAMI_RESEARCH_SAME_DOMAIN_ONLY(default:false)YAGAMI_TOOL_EXECUTION(sequential|parallel, default:parallel)YAGAMI_THEME(ansi|none, default:ansi)YAGAMI_THEME_TOKENS(JSON token overrides)YAGAMI_NO_COLOR(disable color when truthy)YAGAMI_MARKDOWN_RENDER(default: render markdown only on TTY; set0,false,off, ornoto force plain text output)
