PropositionPipeline

Pipeline for extracting propositions from chunks. Coordinates extraction and entity resolution.

Construction

There is no public constructor. The only entry point is the companion factory withExtractor, which seeds a pipeline with a PropositionExtractor. From there, configure the pipeline with the fluent copy-builders, each of which returns a new instance:

Example usage:

val pipeline = PropositionPipeline
.withExtractor(LlmPropositionExtractor(ai))
.withRevision(reviser, propositionRepository) // Optional

val result = pipeline.process(chunks, context)

This pipeline does NOT persist anything

process, processChunk, and processOnce all return UNSAVED results. The pipeline writes nothing to any repository on its own. To make results durable, the caller MUST persist them explicitly via PersistablePropositions.persist, passing a propositionRepository and a namedEntityDataRepository, within the caller's own transaction scope. If you do not call persist, nothing is stored — the returned result is discarded when it goes out of scope.

When a PropositionReviser is configured with a PropositionRepository, the pipeline will compare new propositions against existing ones and classify them as new, merged, reinforced, or contradicted. Revision still does not persist — the classified results must be persisted by the caller as above.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Whether revision is enabled for this pipeline

Functions

Link copied to clipboard
fun process(chunks: List<<Error class: unknown class>>, context: SourceAnalysisContext): PropositionResults

Process multiple chunks through the pipeline.

Link copied to clipboard
fun processChunk(chunk: <Error class: unknown class>, context: SourceAnalysisContext): ChunkPropositionResult

Process a single chunk through the pipeline. Extracts propositions and resolves entities.

Link copied to clipboard
fun processOnce(text: String, sourceId: String, context: SourceAnalysisContext, historyStore: ChunkHistoryStore? = null, contentHasher: ContentHasher = Sha256ContentHasher, additionalGrounding: List<String> = emptyList()): ChunkPropositionResult?

Process a text once, with hash-based deduplication. Ideal for one-shot ingestion of documents, notes, or other static text.

Link copied to clipboard

Register a listener for pipeline events.

Link copied to clipboard

Set the ExtractionExecutionStrategy used to dispatch the stateless per-chunk extraction stage of process.

Link copied to clipboard

Add a mention filter to validate entity mentions before creating entities. When enabled, low-quality mentions (vague references, overly long spans, etc.) are filtered out before entity resolution.

Link copied to clipboard

Add a reviser to compare new propositions against existing ones. When enabled, propositions are classified as new, merged, reinforced, or contradicted.