9router-web-search — X∞ Compliance Layer
1. IDENTITY
Skill milik user: 9router-web-search. Mengikuti Skill Architecture Standard X∞ (wajib).
2. PURPOSE
changelog: Fix broken frontmatter delimiter, unescape code examples, add ClawHub metadata and setup checks
3. METADATA
- (lihat frontmatter di atas)
4. TRIGGER ENGINE
Aktif ketika user meminta hal yang cocok dengan deskripsi di atas. Negative trigger: di luar scope deskripsi.
5. CONTEXT ENGINE
Baca OS/ARCH/runtime sebelum bertindak. Termux Android ARM64 ≠ Ubuntu x86_64.
6. DECISION POLICY
IF uncertainty → VERIFY IF high risk → ASK/STOP IF tool unavailable → ALTERNATIVE IF action fails → RECOVER
7. REASONING POLICY
Evidence-first. Bedakan FAKTA vs HIPOTESIS. Confidence: CONFIRMED/LIKELY/POSSIBLE/UNKNOWN.
8. EXECUTION POLICY
Ambil tindakan relevan, lalu VERIFY. Jangan klaim sukses sebelum diverifikasi.
9. TOOL POLICY
Pilih tool berdasar kebutuhan+konteks. Jangan asal panggil semua tool.
10. MEMORY POLICY
Ingat hal relevan; abaikan noise. Retrieve saat dibutuhkan, update bila berubah.
11. VERIFICATION ENGINE
ACTION → VERIFY → SUCCESS? Jika tidak: DIAGNOSE → RETRY/CHANGE STRATEGY.
12. ERROR RECOVERY
transient→retry; timeout→backoff; auth→credential check; dependency→diagnosis; unknown→investigate.
13. SECURITY GUARDRAILS
NEVER log secret. REDACT API KEY/TOKEN/PASSWORD/SECRET sebelum simpan. PII: MINIMIZE→REDACT→HASH.
14. EVALUATION
Self-eval: capai goal? terverifikasi? ada asumsi? ada gagal? Kirim ke Agent Evaluation Engine.
15. OBSERVABILITY
Emit: START/PROGRESS/TOOL CALL/ERROR/RETRY/SUCCESS/FAILURE + TRACE_ID (tanpa secret).
16. PERFORMANCE OPTIMIZATION
FULL→OPTIMIZED→LOW RESOURCE mode bila terbatas. Prioritas: TASK>SAFETY>RELIABILITY.
17. SELF-IMPROVEMENT
USE→OBSERVE→EVALUATE→FIND WEAKNESS→IMPROVE→TEST→NEW VERSION (via evaluasi+regresi).
18. VERSIONING
Semver. Perubahan struktur = MAJOR. CHANGELOG wajib.
19. COMPATIBILITY
Tahu OS/ARCH/RUNTIME/versi/tool/API tersedia.
20. KNOWLEDGE SOURCES
Trust hierarchy: OFFICIAL>PRIMARY>REPUTABLE>COMMUNITY>UNKNOWN. Tandai VERIFIED/LIKELY/UNCERTAIN/OUTDATED/CONFLICTING.
21. EXIT CONDITIONS
Berhenti pada: SUCCESS/FAILURE/BLOCKED/NEED USER/NEED CREDENTIAL/NEED TOOL/NEED VERIFICATION.
9Router — Web Search
When to Use
User asks to search the web, find articles, look up current information, or check news — and a 9Router instance is available. Requires NINEROUTER_URL (and NINEROUTER_KEY if auth is enabled). See https://raw.githubusercontent.com/decolua/9router/refs/heads/master/skills/9router/SKILL.md for setup.
Preflight Check
# Fail fast with a clear message if the environment is not configured
[ -n "$NINEROUTER_URL" ] || { echo "NINEROUTER_URL is not set — see skill docs for setup"; exit 1; }
Discover
curl "$NINEROUTER_URL/v1/models/web" | jq '.data[] | select(.kind=="webSearch") | .id'
# Per-provider params (searchTypes, maxResults, required options like cx for google-pse)
curl "$NINEROUTER_URL/v1/models/info?id=tavily/search"
IDs end in /search (e.g. tavily/search). Combos (owned_by:"combo") chain providers with auto-fallback.
Endpoint
POST $NINEROUTER_URL/v1/search
| Field | Required | Notes |
|---|---|---|
model (or provider) |
yes | from /v1/models/web (e.g. tavily or brave) |
query |
yes | search query |
max_results |
no | default 5 |
search_type |
no | web (default) / news |
country, language, time_range, domain_filter |
no | provider-dependent |
Examples
curl -X POST "$NINEROUTER_URL/v1/search" \
-H "Authorization: Bearer $NINEROUTER_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"tavily","query":"9Router open source","max_results":5}'
JS:
const r = await fetch(`${process.env.NINEROUTER_URL}/v1/search`, {
method: "POST",
headers: { "Authorization": `Bearer ${process.env.NINEROUTER_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({ model: "search-combo", query: "latest LLM benchmarks", max_results: 10 }),
});
console.log(await r.json());
Response shape
{
"provider": "tavily",
"query": "9Router open source",
"results": [
{
"title": "...", "url": "https://...", "display_url": "github.com/...",
"snippet": "...", "position": 1, "score": 0.92,
"published_at": null, "favicon_url": null, "content": null,
"metadata": { "author": null, "language": null, "source_type": null, "image_url": null },
"citation": { "provider": "tavily", "retrieved_at": "2026-...", "rank": 1 }
}
],
"answer": null,
"usage": { "queries_used": 1, "search_cost_usd": 0.008 },
"metrics": { "response_time_ms": 850, "upstream_latency_ms": 700, "total_results_available": 12 },
"errors": []
}
Provider quirks
All accept query + max_results. Optional fields vary:
| Provider | Supports | Required extras |
|---|---|---|
tavily |
country, domain_filter, news topic | — |
exa |
domain_filter (incl/excl), news category | — |
brave-search |
country, language | — |
serper |
country, language, news endpoint | — |
perplexity |
country, language, domain_filter | — |
linkup |
domain_filter, time_range | depth: fast/standard/deep (option) |
google-pse |
country, language, time_range, offset | cx required (providerOptions) |
searchapi |
country, language, pagination | — |
youcom |
country, language, time_range, domain_filter, full_page | — |
searxng |
language, time_range | Self-hosted, noAuth |
Provider IS the model — "provider":"tavily" ≡ "model":"tavily".
Error Handling
| Scenario | Response |
|---|---|
NINEROUTER_URL unset |
Stop, point user to setup docs |
| HTTP 401/403 | Auth enabled — check NINEROUTER_KEY |
Provider error in errors[] |
Retry with a different provider or a combo model |
Empty results |
Broaden query, remove domain_filter, or switch provider |
Red Flags — STOP
- Never hardcode the router URL or API key in scripts — always use env vars
- Never print
NINEROUTER_KEYin logs or output - Verify time-sensitive claims against
published_atbefore presenting them as current
