Extract typed knowledge¶
Canonical tool: occam_extract_knowledge
Extract typed structured fields from a page (e.g. title, price, author) as facts[], driven by the
site's playbook knowledge_schema.
When to use¶
- You need specific data points, not prose — and the host has a resolvable schema
(check with
occam_playbook_resolvefirst). - No schema for the host → use
occam_transcodeand read the markdown.
Parameters¶
| Parameter | Type | Default | Required | Description |
|---|---|---|---|---|
url |
string | — | yes | HTTP(S) URL or search handle (same host you'd pass to resolve) |
backend_policy |
string | http_then_browser |
no | http, browser, or http_then_browser |
session_profile |
string? | null | no | Headers profile id |
Returns¶
Success envelope:
ok: true,url,playbookId,pageClassfacts[]—{name, value, selector}— typed fields as extracted; unsigned, as-is from DOMmeta.koId,latencyMs,backend?,confidence— heuristic confidence, not a correctness guaranteereceipt— extraction telemetry only (confidence,elapsedMs). Not Receipt v1. NocontentHash, no signature, not accepted byoccam_verify.
Failure envelope: ok: false, url, failureCode, message, playbookId?, pageClass?,
partialFacts[]?, agentHints?, latencyMs.
Failure codes¶
invalid_arguments, workers_unavailable, playbook_not_found, knowledge_schema_missing,
page_class_unmatched, knowledge_schema_empty, plus transcode fetch taxonomy. See
failure codes.
Example¶
Call:
Trimmed response:
{
"ok": true,
"playbookId": "shop.example",
"pageClass": "product",
"facts": [
{ "name": "title", "value": "Widget Pro", "selector": "h1.product-title" }
],
"confidence": 0.9,
"receipt": { "confidence": 0.9, "elapsedMs": 850 }
}
The receipt field is telemetry — do not feed it to occam_verify.
Related¶
- occam_playbook_resolve
- occam_transcode — prose + Receipt v1
- Receipts — Receipt v1 vs telemetry