Skip to main content

createModelEntityExtractor

@forge/monorepo


@forge/monorepo / backend/src / createModelEntityExtractor

Function: createModelEntityExtractor()

createModelEntityExtractor(deps): EntityExtractor

Defined in: backend/src/knowledge/graph.ts:475

The default EntityExtractor: one model call per chunk — AC-2.

Thin on purpose. The provider call lives in models/extraction.ts behind boundary rule R3, so this is the adapter between that function and the port — which means a deployment can replace the extractor entirely (a smaller model, a local one, a rules-based one for a known corpus) without touching the pipeline.

model is a factory rather than a value because a LanguageModel is resolved from a policy per tenant, and a single resolved model captured at construction would be the same one for every tenant in the deployment.

Parameters

deps

extract

(text) => Promise<{ extraction: RawExtraction; usage: { inputTokens: number; outputTokens: number; }; }>

id?

string

Returns

EntityExtractor