Seek.js

Packages

The Seek packages, what each one does, and the dependency policy

Packages

Project status: v0, in development

None of these packages are published to npm yet; the ones in the repository are still stubs. The names and boundaries below are the intended design.

Seek is deliberately small. Five pieces, each of which you can ignore if you do not need it.

PackagePurpose
@seekjs/cliBuild-time: wraps Pagefind, emits the index bundle and context files
@seekjs/coreHeadless runtime: state machine, search, streaming
@seekjs/element<seek-search> web component — works in any HTML
@seekjs/reactuseSeek() hook, built on core directly
templates/One-file serverless function per host (Cloudflare / Vercel / Netlify)

@seekjs/cli

The only thing you run at build time.

seek build ./dist
seek deploy --template cloudflare

build invokes the Pagefind binary over a directory of built HTML, writes Pagefind's sharded index into the output, and adds small context files (site title, detected languages, URL base, prompt hints) that the answer endpoint reads at query time. No model is called, so it costs nothing and finishes in seconds.

deploy copies a function template into your project so you can commit it, review it, and hold your own key.

@seekjs/core

The headless runtime: a state machine over idle → searching → results → asking → streaming → answered, plus the Pagefind query wrapper, the streaming parser for the answer endpoint, and the [n] → URL citation mapping.

No DOM, no framework, no rendering. Everything else is built on this, and you can build on it directly if neither the web component nor the React hook fits.

@seekjs/element

A <seek-search> custom element, so a plain HTML site — Hugo, Jekyll, Sphinx, MkDocs, or a single handwritten page — gets the full experience with two lines and no build step.

<script type="module" src="/_seek/element.js"></script>

<seek-search index="/pagefind/" endpoint="/api/seek/answer"></seek-search>

@seekjs/react

const { query, setQuery, results, ask, answer, citations, status } = useSeek({
  index: "/pagefind/",
  endpoint: "/api/seek/answer",
});

A hook over @seekjs/core, not a wrapper around the web component — so React apps get real React state and no custom-element interop.

templates/

One file per host, copied into your repository. It holds your API key, defines the search tool over your index, enforces the numbered-citation rule, and streams the answer back.

It is a template rather than a dependency on purpose: the endpoint is the only part of Seek that costs money to run, so it should be code you can read in one sitting and change without waiting for a release.

Dependency policy

PackageDependencies
@seekjs/cliPagefind (a Rust binary)
@seekjs/corenone
@seekjs/elementnone
@seekjs/reactReact (peer only)
templates/none — plain fetch against the provider's HTTP API

One real dependency, Pagefind. LangChain and the heavyweight vendor LLM SDKs are deliberately not used: the answer endpoint is a single fetch to an HTTP API, and pulling in a framework to do that would add more code, more churn, and more supply-chain surface than the thing it replaces.

Retired packages

The earlier four-module design is gone and will not be revived: @seekjs/parser, @seekjs/compiler, @seekjs/ai-edge, and the custom .msp binary index. The reasoning is in Architecture.

On this page