Reef Engine & Agentic Automation
High-performance, in-memory inverted index search and browser agent primitives for static sites. Zero server costs, zero accounts, and zero build steps required.
BM25F Inverted Index
Multi-field BM25F scoring with per-field weights across headingText, bodyText, label, and breadcrumb. Supports MMR diversity re-ranking and popularity-based query boosting.
Agent & Workflow API
Chainable agent() primitives for LLM automation: click, type, submit, navigate, extract, and multi-step JSON/YAML executeWorkflow() with retry logic.
IndexedDB Cache
Persistent IndexedDB caching with ETags, lastmod, and content-hash invalidation. Worker-based indexing offloads crawling from the main thread on supporting browsers.
Zero Telemetry
100% private local execution. Queries, index data, and browsing activity never leave the browser. Shadow DOM UI keeps styles fully isolated from the host page.
Universal DOM Grounding
Semantic selector candidates, ARIA accessibility extraction, fuzzy live-text fallback, open Shadow DOM, and same-origin iframe traversal keep agent actions grounded after re-renders.
Live Observation & Guardrails
observe(), waitForStable(), SPA route awareness, action verification, pagination limits, rate limiting, and destructive-action protection support bounded autonomous exploration.
Site Graph & LLM Tools
crawlAndBuildGraph() maps pages and effects for multi-step planning, while schema-described agentTools connects Reef to tool-use loops.
Agent-Ready Sites
Drop in reef-agent-ready.js to publish a live, guarded manifest that external browser agents can consume without adopting the full Reef UI.
Client-Side Processing Pipeline
Reef operates completely inside the browser runtime without sending HTML or query data to backend servers. Click on each phase below to inspect the pipeline logic:
Sitemap Discovery & Crawling
The Indexer class (src/indexing/indexer.ts) reads data-sitemap (default: /sitemap.xml) and parses <loc> + <lastmod> entries. Falls back to same-origin breadth-first crawl if no sitemap is available. Pages are fetched as plain text and parsed with DOMParser — no scripts execute.
- Parses
sitemap.xml<loc>entries; follows one level of sitemap index nesting - Fallback same-origin crawl capped by
data-max-pages(default 500) - Respects
crawlDelay, honorsrel="nofollow", excludes same-page anchors - Worker-based indexing off main thread when
data-use-worker-indexing="true"
src/ — TypeScript Source Files
browser.ts
ENTRY
Instantiates ReefSearch and exposes it as window.Reef. The only file that touches the global scope.
reef.ts
ORCHESTRATOR
Top-level ReefSearch class. Coordinates boot, hotkey registration, result rendering, and exposes the full public API (open, search, act, agent()…).
types.ts
TYPES
Shared interfaces: IndexRecord, SearchOptions, ReefConfig, WorkflowStep, AgentSession, ScoredRecord, and token filter types.
search-index.ts
SEARCH ENGINE
In-memory inverted index with BM25F per-field scoring, MMR diversity re-ranking, Levenshtein fuzzy fallback, prefix trie for suggest(), LRU query cache, and index serialization.
extraction.ts
EXTRACTION
Heading-based section splitting plus stable semantic selector candidates, accessibility-tree extraction, shadow-root traversal, iframe paths, JSON-LD parsing, and hidden-content expansion.
cache.ts
CACHE
IndexedDB persistence with optional gzip CompressionStream. Stores versionHash, buildTime, per-page ETag/lastModified/contentHash, and the serialized index payload.
agent.ts
AGENT
Fluent Agent with live .observe(), .waitForStable(), visibility scrolling, SPA route awareness, selector candidates, fuzzy fallback, verification, bounded pagination, and guardrails.
workflow.ts
WORKFLOW
YAML workflow parser, step validator, and executeWorkflow() runner with per-step retry, onStepStart / onStepComplete callbacks, and stopOnError control.
worker.ts
WEB WORKER
Web Worker shim handling createIndex, indexPages, search, serializeIndex, and deserializeIndex messages off the main thread via DOMParser.
indexing/indexer.ts
CRAWLER
Indexer class: sitemap fetch, recursive sitemap-index processing, parallel page crawl with incremental ETag diffing, prebuilt index URL support, and same-origin fallback crawl.
actions/action-executor.ts
EXECUTOR
ActionExecutor: resolves IndexRecord selectors to live DOM elements, dispatches synthetic events, handles same-page scroll-highlight, deferred cross-page scroll via sessionStorage.
config/config-reader.ts
CONFIG
ConfigReader parses data-* attributes from the install <script> tag into a typed ReefConfig. ConfigApplier writes CSS custom properties to the Shadow DOM host.
ui/renderer.ts
UI RENDERER
UIRenderer: mounts Shadow DOM, renders result rows with match highlighting, manages category tab state, focus trap, aria-live announcements, settings panel, and toast notifications.
ui/inspector.ts
DEV TOOL
VisualInspector: overlay that draws dashed bounding boxes over every indexed action (pink) and field (cyan) on the live page, with hover badges showing record IDs.
IndexRecord Types & Extraction Sources
<h1>–<h6> produces one record with headingText, bodyText, breadcrumb, and anchor URL. Primary navigation target.selector. Gated by actionsMode: destructive verbs excluded in navigate-only mode.fillField(id, value) uses native property setters for React/Vue compatibility.pdf, doc, xls, ppt, zip, csv, and more (configurable via data-file-extensions).<script type="application/ld+json">. FAQ entries, breadcrumb lists, and other schema.org records become searchable answer-type results.Plan across pages and states
Reef can observe the composed DOM, wait for JavaScript-heavy interfaces to settle, detect SPA route changes, and build a bounded SiteGraph of links, fields, actions, and effects. Exploration respects actionsMode, destructive flags, and per-run action limits.
Searchable Agentic API
Search by method name, capability, or intent. Select a call to see its real signature, what it changes, and a copyable example. The sandbox below previews the call shape against Reef’s browser-local runtime.
| METHOD | SIGNATURE | DESCRIPTION | EXAMPLE | SAFETY |
|---|
Method Call Preview
Agent-Ready Sites
Make any site discoverable to browser agents with a standalone script. Reef stamps durable targets, fills in accessible names for icon controls, traverses open Shadow DOM and same-origin frames, and republishes a fresh manifest after SPA navigation.
For a static server-side copy, run npm run export-manifest -- https://your-site.example dist/.well-known/agent-manifest.json with Playwright installed, then deploy it at /.well-known/agent-manifest.json.
| ATTRIBUTE | DEFAULT | DESCRIPTION |
|---|---|---|
data-exclude | empty | Comma-separated CSS selectors excluded from the manifest. |
data-mode | execute | navigate-only marks actions destructive for conservative agents. |
data-disable-aria-backfill | false | Disable labels added to unnamed icon controls. |
data-disable-live-updates | false | Disable mutation and route-change rescans. |
data-debounce-ms | 150 | Debounce interval for live rescans. |
data-max-rescans-per-minute | 30 | Rate limit protecting pages from runaway updates. |
data-debug | false | Log each published manifest to the console. |
data-publish-well-known | false | Enable deployment guidance for exporting the manifest to /.well-known/agent-manifest.json. |
data-sensitive, and data-reef-agent="off" regions are excluded by default. Add site-specific selectors with data-exclude="#admin, .private-widget". The manifest never submits forms or executes actions.Architectural Comparison Matrix
Search Engine Feature Comparison
Comprehensive feature matrix comparing Reef against popular client-side libraries and hosted search services. Green indicates full support, yellow indicates partial support or limitations, and red indicates missing or unavailable features.
| Tool | Type | Backend | Cost | Privacy | Live DOM | Fuzzy Search | Indexed | DOM Sync | Type System | BM25 | Suggest | Stemming | Faceting | Worker | Serialization |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Reef
PINNED
|
Client-side lib | None | Free · MIT | Stays local | Yes — live DOM | Yes (indexed) | Yes (inverted) | Planned | Yes — 7 types | Yes (option) | Yes | Yes (opt-in) | Yes | Planned | Yes |
| Fuse.js | Client-side lib | None | Free · MIT | Local | No — generic data | Yes (Bitap) | No — full scan | No | No | No | No | No | No | No | Yes |
| MiniSearch | Client-side lib | None | Free · MIT | Local | No | Yes | Yes (inverted) | No | No | Yes | Yes | Yes | Manual | No | Yes |
| uFuzzy | Client-side lib | None | Free · MIT | Local | No | Yes (staged) | No — full scan | No | No | No | No | No | No | No | No |
| FlexSearch | Client-side lib | None | Free · MIT | Local | No | Yes | Yes | No | No | Yes | Partial | Yes | No | Yes | Yes |
| Lunr.js | Client-side lib | None | Free · MIT | Local | No | Yes (~) | Yes | No | No | Yes | No | Yes | No | No | Yes |
| Elasticlunr.js | Client-side lib | None | Free · MIT | Local | No | Yes | Yes | No | No | Yes (BM25) | No | Yes | No | No | Yes |
| fuzzysort | Client-side lib | None | Free · MIT | Local | No | Yes | No (cached scan) | No | No | No | No | No | No | No | No |
| Orama | Client-side / node | None (in-browser) | Free · MIT | Local | No | Yes | Yes | No | Typed schema | Yes | Partial | Yes (plugin) | Yes | Yes (wasm) | Yes |
| Pagefind | Static (build-time) | None (static) | Free · MIT | Local shards | No (prebuilt) | Yes | Yes (shards) | No | No | Partial | Partial | Yes | Yes | Yes (wasm) | Yes (shards) |
| Algolia | Hosted service | Required | Paid (free tier) | Leaves browser | No | Yes | Yes | No | No | Yes | Yes | Yes | Yes | n/a | No (backend) |
| Meilisearch | Self-host / cloud | Required | Free self-host | To your server | No | Yes | Yes | No | No | Yes | Yes | Yes | Yes | n/a | No (backend) |
| Elasticsearch/OpenSearch | Self-hosted engine | Required | Free (Apache) | To your server | No | Yes | Yes | No | No | Yes | Yes | Yes | Yes | n/a | No (backend) |
| Fuse Cloud | Hosted service | Required | Paid | Leaves browser | No | Yes | No — full scan | No | No | No | No | No | No | No | Yes |
Installation & Embed Configurator
Make your site agent-ready without search
Paste this standalone script before </body>. It publishes the live agent manifest and does not install Reef’s search UI or search features.
Use the agent-ready only option below to copy this exact snippet.
Custom Script Embed Generator