Skip to main content

EntityExtractor

@retinue/monorepo


@retinue/monorepo / backend/src / EntityExtractor

Interface: EntityExtractor

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

Turns a chunk into entities and relationships.

A port separate from EmbeddingProvider, not a widening of it. Embedding is cheap, deterministic and batchable; extraction is none of those. Keeping them apart is what lets a deployment with GraphRAG off supply an embedder and nothing else — if this were one port, every deployment would have to configure a language model to index a document.

usage is optional and reported when the provider gives it, because AC-9 needs the bill to be visible before it arrives rather than reconstructed from an invoice.

Properties​

id​

readonly id: string

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

Methods​

extract()​

extract(chunk): Promise<{ extraction: RawExtraction; usage?: { inputTokens?: number; outputTokens?: number; }; }>

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

Parameters​

chunk​

ExtractionChunk

Returns​

Promise<{ extraction: RawExtraction; usage?: { inputTokens?: number; outputTokens?: number; }; }>