Skip to content

cayu.knowledge.curator

Public Cayu API. Definitions are grouped by their public source module, and definitions from private implementation modules appear on their package’s page; adding a symbol does not move existing links. The import shown at each entry is a supported public namespace. Read the Python API overview and install the required extra.

from cayu import CandidatePolicyDisposition

Application-policy disposition before independent evaluation.

Bases: StrEnum.

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
ACCEPTED class attribute 'accepted'
REJECTED class attribute 'rejected'

Release source · Runtime guarantees · Capability guides

from cayu import group_learning_signals

Group copied signals deterministically by scope and bounded batch size.

group_learning_signals(signals: Iterable[LearningSignal], *, max_signals_per_batch: int=50) -> list[LearningBatch]

Release source · Runtime guarantees · Capability guides

from cayu import KnowledgeCandidateGenerator

Provider-neutral candidate generation over one copied bounded batch.

Bases: Protocol.

async KnowledgeCandidateGenerator.generate_candidates(batch: LearningBatch) -> list[LearningCandidate]

Release source · Runtime guarantees · Capability guides

from cayu import KnowledgeCandidatePolicy

Optional application-owned content rejection or transformation hook.

Bases: Protocol.

async KnowledgeCandidatePolicy.apply_candidate_policy(candidate: LearningCandidate, signals: tuple[LearningSignal, ...]) -> KnowledgeCandidatePolicyDecision

Release source · Runtime guarantees · Capability guides

from cayu import KnowledgeCandidatePolicyDecision

Application-owned rejection or bounded transformation result.

Bases: _CuratorModel.

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
schema_version Literal[1] LEARNING_SCHEMA_VERSION
disposition CandidatePolicyDisposition required
code StrictStr required
notes StrictStr | None None
candidate LearningCandidate | None None
KnowledgeCandidatePolicyDecision.validate_code(value: str) -> str
KnowledgeCandidatePolicyDecision.validate_notes(value: str | None) -> str | None
KnowledgeCandidatePolicyDecision.copy_candidate(value: object) -> object
KnowledgeCandidatePolicyDecision.validate_disposition() -> KnowledgeCandidatePolicyDecision

Release source · Runtime guarantees · Capability guides

from cayu import KnowledgeCurator

Explicit governed knowledge curation over Cayu’s revision store.

KnowledgeCurator.__init__(store: _CuratorStore, *, candidate_generator: KnowledgeCandidateGenerator, evaluator: LearningEvaluator, config: KnowledgeCuratorConfig, access_scope: KnowledgeAccessScope | None=None, candidate_policy: KnowledgeCandidatePolicy | None=None, activation_policy: KnowledgeActivationPolicy | None=None, clock: Callable[[], datetime] | None=None) -> None
KnowledgeCurator.config() -> KnowledgeCuratorConfig
KnowledgeCurator.access_scope() -> KnowledgeAccessScope

Return the exact copied access boundary enforced by this curator.

async KnowledgeCurator.aclose(*, timeout_s: float=10.0) -> bool

Seal and drain publications retained beyond their curation callers.

async KnowledgeCurator.__aenter__() -> KnowledgeCurator
async KnowledgeCurator.__aexit__(*_exc_info: object) -> None
async KnowledgeCurator.curate(batch: LearningBatch) -> LearningBatchResult

Generate, independently evaluate, govern, and persist knowledge.

Release source · Runtime guarantees · Capability guides

from cayu import KnowledgeCuratorConfig

Application-owned policy and resource bounds for reviewed curation.

Bases: _CuratorModel.

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
schema_version Literal[1] LEARNING_SCHEMA_VERSION
candidate_generator_identity StrictStr required
evaluator_identity StrictStr required
policy_identity StrictStr | None None
pipeline_version StrictStr 'cayu.knowledge-curator.v1'
namespace StrictStr DEFAULT_KNOWLEDGE_NAMESPACE
labels dict[str, str] Field(default_factory=dict)
visibility KnowledgeVisibility KnowledgeVisibility.GLOBAL
allowed_kinds tuple[StrictStr, ...] BUILTIN_KNOWLEDGE_KINDS
created_by StrictStr 'knowledge_curator'
governance KnowledgeGovernanceConfig Field(default_factory=KnowledgeGovernanceConfig)
max_signals StrictInt 50
max_signal_bytes StrictInt 16 * 1024
max_batch_bytes StrictInt 256 * 1024
max_candidates StrictInt 20
max_candidate_bytes StrictInt 64 * 1024
max_candidate_text_bytes StrictInt 32 * 1024
max_candidate_title_bytes StrictInt 4 * 1024
max_candidate_batch_bytes StrictInt 512 * 1024
max_source_references_per_signal StrictInt 20
max_source_references_per_candidate StrictInt 100
max_source_reference_bytes StrictInt 16 * 1024
max_metadata_bytes StrictInt 16 * 1024
max_evaluator_notes_bytes StrictInt 16 * 1024
max_evaluator_concurrency StrictInt 4
max_in_flight_publications StrictInt 100
candidate_generator_timeout_seconds StrictFloat 120.0
evaluator_timeout_seconds StrictFloat 120.0
candidate_policy_timeout_seconds StrictFloat 30.0
chunk_target_bytes StrictInt DEFAULT_KNOWLEDGE_CHUNK_TARGET_BYTES
chunk_overlap_bytes StrictInt DEFAULT_KNOWLEDGE_CHUNK_OVERLAP_BYTES
max_chunks StrictInt 100
KnowledgeCuratorConfig.validate_identity(value: str, info) -> str
KnowledgeCuratorConfig.validate_policy_identity(value: str | None) -> str | None
KnowledgeCuratorConfig.copy_labels(value: Any) -> dict[str, str]
KnowledgeCuratorConfig.copy_governance(value: object) -> object
KnowledgeCuratorConfig.copy_allowed_kinds(value: object) -> tuple[str, ...]
KnowledgeCuratorConfig.validate_positive_int(value: int, info) -> int
KnowledgeCuratorConfig.validate_text_capacity(value: int, info) -> int
KnowledgeCuratorConfig.validate_nonnegative_overlap(value: int) -> int
KnowledgeCuratorConfig.validate_timeout(value: float, info) -> float
KnowledgeCuratorConfig.validate_bounds() -> KnowledgeCuratorConfig
KnowledgeCuratorConfig.fingerprint() -> str

Release source · Runtime guarantees · Capability guides

from cayu import LearningBatch

One already-grouped, explicitly submitted curation batch.

Bases: _CuratorModel.

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
schema_version Literal[1] LEARNING_SCHEMA_VERSION
id StrictStr required
signals tuple[LearningSignal, ...] required
LearningBatch.validate_id(value: str) -> str
LearningBatch.copy_signals(value: object) -> object
LearningBatch.validate_signal_identity() -> LearningBatch
LearningBatch.scope() -> str
LearningBatch.fingerprint() -> str

Release source · Runtime guarantees · Capability guides

from cayu import LearningBatchOutcome

Outcome of the batch-wide candidate-generation boundary.

Bases: StrEnum.

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
COMPLETED class attribute 'completed'
GENERATOR_FAILED class attribute 'generator_failed'
GENERATOR_TIMED_OUT class attribute 'generator_timed_out'
GENERATOR_INVALID class attribute 'generator_invalid'

Release source · Runtime guarantees · Capability guides

from cayu import LearningBatchResult

Bounded public result for one explicit curation invocation.

Bases: _CuratorModel.

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
schema_version Literal[1] LEARNING_SCHEMA_VERSION
batch_id StrictStr required
batch_fingerprint StrictStr required
configuration_fingerprint StrictStr required
scope StrictStr required
outcome LearningBatchOutcome required
code StrictStr required
signal_count StrictInt required
candidate_count StrictInt required
signals tuple[LearningSignalResult, ...] required
candidates tuple[LearningCandidateResult, ...] ()
processed_at datetime required
LearningBatchResult.validate_identity(value: str, info) -> str
LearningBatchResult.validate_fingerprint(value: str, info) -> str
LearningBatchResult.copy_candidates(value: object) -> object
LearningBatchResult.copy_signals(value: object) -> object
LearningBatchResult.validate_processed_at(value: datetime) -> datetime
LearningBatchResult.validate_count(value: int, info) -> int
LearningBatchResult.validate_result_contract() -> LearningBatchResult

Release source · Runtime guarantees · Capability guides

from cayu import LearningCandidate

One generator-proposed reusable knowledge item.

Bases: _CuratorModel.

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
schema_version Literal[1] LEARNING_SCHEMA_VERSION
proposal_key StrictStr required
text StrictStr required
signal_ids tuple[StrictStr, ...] required
title StrictStr | None None
kind StrictStr 'fact'
aspects tuple[StrictStr, ...] ()
impact_targets tuple[StrictStr, ...] ()
confidence_hint StrictFloat | None None
source_references tuple[LearningSourceReference, ...] ()
metadata dict[str, Any] Field(default_factory=dict)
LearningCandidate.validate_identity(value: str, info) -> str
LearningCandidate.validate_text(value: str) -> str
LearningCandidate.validate_title(value: str | None) -> str | None
LearningCandidate.copy_signal_ids(value: object) -> tuple[str, ...]
LearningCandidate.copy_taxonomy(value: object, info) -> tuple[str, ...]
LearningCandidate.copy_source_references(value: object) -> object
LearningCandidate.validate_confidence_hint(value: float | None) -> float | None
LearningCandidate.copy_metadata(value: Any) -> dict[str, Any]
LearningCandidate.validate_sources() -> LearningCandidate
LearningCandidate.fingerprint() -> str

Release source · Runtime guarantees · Capability guides

from cayu import LearningCandidateOutcome

Durable or fail-closed outcome for one generated candidate.

Bases: StrEnum.

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
PENDING_PERSISTED class attribute 'pending_persisted'
ACTIVE_PERSISTED class attribute 'active_persisted'
EXISTING_PENDING class attribute 'existing_pending'
EXISTING_ACTIVE class attribute 'existing_active'
EXISTING_ARCHIVED class attribute 'existing_archived'
EXISTING_DELETED class attribute 'existing_deleted'
EVALUATOR_REJECTED class attribute 'evaluator_rejected'
POLICY_REJECTED class attribute 'policy_rejected'
ACTIVATION_REJECTED class attribute 'activation_rejected'
INVALID class attribute 'invalid'
FAILED class attribute 'failed'
CONFLICT class attribute 'conflict'

Release source · Runtime guarantees · Capability guides

from cayu import LearningCandidateResult

Bounded public result for one generated candidate.

Bases: _CuratorModel.

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
schema_version Literal[1] LEARNING_SCHEMA_VERSION
proposal_key StrictStr required
candidate_fingerprint StrictStr required
outcome LearningCandidateOutcome required
code StrictStr required
decision LearningDecision | None None
entry_id StrictStr | None None
entry_revision StrictInt | None None
entry_status KnowledgeStatus | None None
warning_code StrictStr | None None
LearningCandidateResult.validate_required_identity(value: str, info) -> str
LearningCandidateResult.validate_fingerprint(value: str) -> str
LearningCandidateResult.copy_decision(value: object) -> object
LearningCandidateResult.validate_optional_identity(value: str | None, info) -> str | None
LearningCandidateResult.validate_revision(value: int | None) -> int | None
LearningCandidateResult.validate_outcome_contract() -> LearningCandidateResult

Release source · Runtime guarantees · Capability guides

from cayu import LearningDecision

One independent evaluator decision for one exact candidate.

Bases: _CuratorModel.

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
schema_version Literal[1] LEARNING_SCHEMA_VERSION
verdict LearningVerdict required
code StrictStr required
notes StrictStr | None None
confidence StrictFloat | None None
metadata dict[str, Any] Field(default_factory=dict)
LearningDecision.validate_code(value: str) -> str
LearningDecision.validate_notes(value: str | None) -> str | None
LearningDecision.validate_confidence(value: float | None) -> float | None
LearningDecision.copy_metadata(value: Any) -> dict[str, Any]

Release source · Runtime guarantees · Capability guides

from cayu import LearningEvaluator

Independent evaluation of one candidate against its copied signals.

Bases: Protocol.

async LearningEvaluator.evaluate_candidate(candidate: LearningCandidate, signals: tuple[LearningSignal, ...]) -> LearningDecision

Release source · Runtime guarantees · Capability guides

from cayu import LearningSignal

One deterministic application observation; it is not knowledge.

Bases: _CuratorModel.

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
schema_version Literal[1] LEARNING_SCHEMA_VERSION
id StrictStr required
deduplication_key StrictStr required
kind StrictStr required
scope StrictStr required
summary StrictStr required
source_references tuple[LearningSourceReference, ...] required
occurred_at datetime required
metadata dict[str, Any] Field(default_factory=dict)
LearningSignal.validate_identity(value: str, info) -> str
LearningSignal.validate_summary(value: str) -> str
LearningSignal.copy_source_references(value: object) -> object
LearningSignal.copy_metadata(value: Any) -> dict[str, Any]
LearningSignal.validate_occurred_at(value: datetime) -> datetime
LearningSignal.validate_sources() -> LearningSignal
LearningSignal.fingerprint() -> str

Release source · Runtime guarantees · Capability guides

from cayu import LearningSignalOutcome

Participation outcome for one submitted signal.

Bases: StrEnum.

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
CANDIDATE_GENERATED class attribute 'candidate_generated'
NO_CANDIDATE_GENERATED class attribute 'no_candidate_generated'
BATCH_FAILED class attribute 'batch_failed'

Release source · Runtime guarantees · Capability guides

from cayu import LearningSignalResult

How one submitted signal participated in an explicit curation call.

Bases: _CuratorModel.

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
schema_version Literal[1] LEARNING_SCHEMA_VERSION
signal_id StrictStr required
signal_fingerprint StrictStr required
outcome LearningSignalOutcome required
code StrictStr required
candidate_proposal_keys tuple[StrictStr, ...] ()
LearningSignalResult.validate_identity(value: str, info) -> str
LearningSignalResult.validate_fingerprint(value: str) -> str
LearningSignalResult.copy_candidate_proposal_keys(value: object) -> tuple[str, ...]
LearningSignalResult.validate_outcome() -> LearningSignalResult

Release source · Runtime guarantees · Capability guides

from cayu import LearningSourceReference

One bounded exact source reference carried into KnowledgeEvidence.

Bases: _CuratorModel.

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
schema_version Literal[1] LEARNING_SCHEMA_VERSION
source_type StrictStr required
source_id StrictStr | None None
source_uri StrictStr | None None
source_revision StrictStr | None None
source_hash StrictStr | None None
locator dict[str, Any] Field(default_factory=dict)
role KnowledgeEvidenceRole KnowledgeEvidenceRole.ORIGIN
metadata dict[str, Any] Field(default_factory=dict)
LearningSourceReference.validate_source_type(value: str) -> str
LearningSourceReference.validate_optional_identity(value: str | None, info) -> str | None
LearningSourceReference.validate_source_uri(value: str | None) -> str | None
LearningSourceReference.copy_json_fields(value: Any, info) -> dict[str, Any]
LearningSourceReference.validate_exact_source() -> LearningSourceReference
LearningSourceReference.identity_material() -> dict[str, Any]
LearningSourceReference.fingerprint() -> str

Release source · Runtime guarantees · Capability guides

from cayu import LearningVerdict

Independent evaluator verdict for one exact candidate.

Bases: StrEnum.

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
ACCEPTED class attribute 'accepted'
REJECTED class attribute 'rejected'

Release source · Runtime guarantees · Capability guides

from cayu import validate_learning_batch

Copy and validate a batch against one curator’s pre-provider bounds.

Durable job producers use the same boundary as KnowledgeCurator before enqueueing work, so an oversized request cannot consume queue storage and fail only after a worker has claimed it.

validate_learning_batch(batch: LearningBatch, *, config: KnowledgeCuratorConfig) -> LearningBatch

Release source · Runtime guarantees · Capability guides