LlmGraphProjector

data class LlmGraphProjector(ai: <Error class: unknown class>, relations: Relations = Relations.empty(), policy: ProjectionPolicy = DefaultProjectionPolicy(), llmOptions: <Error class: unknown class> = LlmOptions(), authorityResolver: AuthorityResolver = StructuralAuthorityResolver()) : GraphProjector

LLM-based graph projector. Uses an LLM to classify propositions into relationship types from both the DataDictionary schema and Relations predicates.

Builder Usage (Java)

LlmGraphProjector projector = LlmGraphProjector
.withLlm(llmOptions)
.withAi(ai)
.withRelations(relations)
.withLenientPolicy();

Direct Construction (Kotlin)

val projector = LlmGraphProjector(
ai = ai,
relations = relations,
policy = LenientProjectionPolicy(),
llmOptions = llmOptions,
)

Parameters

ai

AI service for LLM calls

relations

Relation predicates to include as candidate relationship types

policy

Policy to filter propositions before projection

llmOptions

LLM configuration

authorityResolver

Resolves the source authority stamped onto each projected edge

Constructors

Link copied to clipboard
constructor(ai: <Error class: unknown class>, relations: Relations = Relations.empty(), policy: ProjectionPolicy = DefaultProjectionPolicy(), llmOptions: <Error class: unknown class> = LlmOptions(), authorityResolver: AuthorityResolver = StructuralAuthorityResolver())

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open override fun project(proposition: Proposition, schema: <Error class: unknown class>): ProjectionResult<ProjectedRelationship>

Projects a single proposition to a graph relationship.

Link copied to clipboard
open override fun projectAll(propositions: List<Proposition>, schema: <Error class: unknown class>): ProjectionResults<ProjectedRelationship>

Projects a list of propositions, applying the configured policy to each.

Link copied to clipboard

Override the resolver that stamps each projected edge with its source authority.

Link copied to clipboard

Use a DefaultProjectionPolicy with default confidence threshold.

fun withDefaultPolicy(confidenceThreshold: Double): LlmGraphProjector

Use a DefaultProjectionPolicy with the given confidence threshold.

Link copied to clipboard

Use a LenientProjectionPolicy with default confidence threshold.

fun withLenientPolicy(confidenceThreshold: Double): LlmGraphProjector

Use a LenientProjectionPolicy with the given confidence threshold.

Link copied to clipboard
fun withLlmOptions(llmOptions: <Error class: unknown class>): LlmGraphProjector

Override LLM options after construction.

Link copied to clipboard

Set the projection policy.

Link copied to clipboard

Set the relation predicates.