# Repository Briefing: 1broseidon/ketch
> Source: https://repoforai.com/repo/1broseidon/ketch (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/1broseidon/ketch
- **Official Docs / Website**: https://ketch.run
- **Category**: RAG, Data & Memory (知识库 / 爬虫 / 记忆层)
- **Primary Language**: Go
- **License**: MIT
- **Engineering Health**: A+ (88/100 · Maintenance 35/35 · Adoption 13/25 · Releases 20/20 · License 20/20)
- **Latest Release**: v0.22.0 (2026-11-29) — https://github.com/1broseidon/ketch/releases
- **Review Snapshot**: 2026-12-04
- **Deployment / Stack Signals**: CLI, MCP
- **Momentum**: 774 ★ total (+2 24h / +13 7d) · 46 forks
- **Topics**: `ai-agents`, `cli`, `golang`, `scraping`, `search`, `web-scraping`
- **When to Use**: Best for: Agent and terminal workflows that need to discover public sources, extract readable material, and optionally look up pre-indexed library docs offline without operating a network API. Skip if: You need a shared vector store, durable full-text retention, or a hosted multi-tenant retrieval service with enforced network isolation.

## Overview
```text
### Architecture & Core Mechanics
ketch is a Go retrieval and extraction frontend, not a general-purpose RAG database. `main.go` and `cmd/` are the CLI entrypoint and command area, with Cobra and pflag in the dependency set. Search, code lookup, and crawling have separate module directories. The HTML path prefers content landmarks and prose structure, falls back to readability, and converts the selected material to Markdown; goquery, Cascadia, go-readability, and html-to-markdown are in the Go manifest alongside Rod for browser automation.

CLI invocations do not depend on a resident service. The same binary can run as a stdio MCP server using the Go MCP SDK, while the `ketch-pi` package wraps CLI JSON commands as tools for pi. Stateless execution does not mean diskless operation: effective configuration, a bbolt page cache, saved bookmarks, and an offline docs index support reuse across invocations. Bookmarks retain source metadata rather than full page bodies.

### Key Capabilities & Differentiators
Web search normalizes configured and keyless providers behind one interface. `auto` prefers configured self-hosted endpoints and keyed providers before falling back to keyless options; `--multi` queries usable backends concurrently and fuses their rankings with Reciprocal Rank Fusion. Public code search supports Grep, Sourcegraph, and authenticated GitHub Code Search. `docs` checks the local index first on its default backend and otherwise extracts source passages from live documentation; Context7 is an explicit opt-in with an anonymous quota.

`scrape` accepts URLs, JSON arrays, files, or stdin, while `crawl` traverses by breadth-first search or sitemap and supports background status tracking. Suspected JS-shell pages can be fetched again with headless Chrome. For HTML, `clean` prunes more peripheral content than `complete`; `extract` processes piped HTML without fetching or caching. Text-based PDFs use a pure-Go parser by default. Image-only PDFs need OCR outside that built-in path, and a configured external converter is authoritative rather than a best-effort fallback.

### Trade-offs & Limitations
Compared with `curl | pandoc`, ketch adds discovery, provider failover, site traversal, caching, and structured output. Compared with direct provider SDKs, it offers a common interface but should not be assumed to expose every native provider control. Keyless means no initial credential setup, not unlimited capacity or offline operation. Upstream ranking, quotas, and availability still shape live results; the v0.22.0 docs path reads the search hits it selects rather than guaranteeing coverage of an entire site.

Treat the 72-hour default page-cache TTL as a reuse policy, not a retention guarantee. A deeper crawl may refetch a cached page whose link metadata is missing; failed backfill can still return the cached content with an incomplete-link diagnostic. Bookmarks outlive cache expiry and clearing, but do not preserve bodies. Only HTTP(S) URLs are fetched after rewriting, and reachable private HTTP(S) endpoints are not blocked, so use egress restrictions when exposing tools to untrusted callers. The MIT license covers the software, not upstream service terms or reuse rights for fetched material.

### Hardware & Deployment Guide
Install a release binary via Homebrew, the `ketch-cli` npm package, or GitHub Releases, or build with `go install`; the supplied module declares Go 1.26.11. The installer covers macOS and Linux on x86-64 and ARM64 and checks the binary against the release checksum list. For agent integration, run the CLI directly or launch `ketch mcp serve` from the client. Configuration lives at `~/.config/ketch/config.json`, flags take precedence, and `ketch config` exposes effective settings and available backends. `ketch doctor` checks backend, browser, cache, and tag health.

Start with a CPU-only runner and size for fetch concurrency and document size; browser rendering and external PDF conversion add separate resource costs. No local model runtime is required. Configure Chrome for rendering, set provider credentials or a SearXNG/Degoog endpoint as needed, and index libraries in advance for offline docs lookup. v0.21.0 introduced keyless live extraction from docs; v0.21.1 made unverifiable requested versions fail instead of drifting to unversioned content. v0.22.0 made unnamed-library lookups follow search order: the first readable document, then up to two more from the same site and release.
```

## Key Capabilities
```text
- Search routing: `auto` returns the first successful backend; `--multi` runs usable providers concurrently and applies Reciprocal Rank Fusion.
- Agent integration: global `--json`, documented exit codes, and stdio MCP expose retrieval without a separately deployed API.
- Documentation retrieval: indexed libraries are available offline; the v0.22.0 unnamed-library path reads the first readable search hit and up to two more from the same site and release.
- Extraction: structure-first HTML cleanup with readability fallback, headless Chrome for JS shells, and native text extraction for text-based PDFs.
- Crawl reuse: the bbolt page cache defaults to a 72-hour TTL and can reuse resolved links; missing link metadata can require a refetch.
- Research continuity: bookmarks survive cache expiry and `cache clear`; a saved URL does not imply that its page body is still cached.
```

## Quick Start / Clone
```bash
# macOS / Linux, any of x86_64 or arm64
curl -fsSL https://ketch.run/install | sh

# Homebrew
brew install ketch

# npm
npm install -g ketch-cli

# go install
go install github.com/1broseidon/ketch@latest

# Or download a prebuilt binary (linux/darwin/windows, amd64/arm64)
# from https://github.com/1broseidon/ketch/releases
```
