// 1. Register the material.
const source = await pb.sources.register({ type: "document", name: "Acme MSA.pdf" });
// 2. Coerce it into graph structure through a shape (staged).
// `source` takes the text to extract from; pass the registered source's
// id as `external_id` to keep the provenance link.
await pb.extract({
source: { text: documentText, external_id: source.id },
shapeId: "shp_contract_terms",
apply: false,
});
// 3. Read what landed, scoped to the source.
const entities = await pb.sources.entities(source.id);