Skip to content

Guide: Structured extraction

What is this?

Pull typed fields (facts[]) when a playbook defines a knowledge schema.

When should I use it?

You need fields (price, version, author) — not just prose Markdown.

Minimal flow

occam_playbook_resolve(url)
→ if schema present → occam_extract_knowledge(url)
→ else → occam_transcode(url) for prose
{ "name": "occam_extract_knowledge", "arguments": { "url": "https://example.com/product" } }

Expected result

  • facts[] plus metadata such as meta.koId when the schema applies.
  • confidence — heuristic extraction confidence, not a correctness guarantee.
  • receipt — extraction telemetry only (confidence, elapsedMs). This is not Occam Receipt v1: no contentHash, no signature, occam_verify does not accept it. For signed integrity, use occam_transcode or occam_claim_check on the same URL.

Session note

occam_extract_knowledge is Tier 1 for sessions: HTTP headers and Playwright storageState both apply (browser fallback uses storageState). See Guide: sessions.

What can go wrong?

No schema → use transcode. Bad selectors → playbook heal/lint/save (authoring path only).

Next