Skip to content

cayu.knowledge.semantic_watch

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 decide_knowledge_semantic_watch
async decide_knowledge_semantic_watch(request: KnowledgeSemanticWatchRequest, *, config: KnowledgeSemanticWatchConfig, policy: KnowledgeSemanticWatchPolicy | None) -> KnowledgeSemanticWatchAuthority

Release source · Runtime guarantees · Capability guides

from cayu import KnowledgeSemanticWatchAuthority

Durable-safe request evidence and accepted application decision.

Bases: _WatchModel.

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] 1
invocation KnowledgeSemanticWatchInvocation required
evidence KnowledgeSemanticWatchEvidence required
decision KnowledgeSemanticWatchDecision required
KnowledgeSemanticWatchAuthority.validate_schema_version(value: object) -> object
KnowledgeSemanticWatchAuthority.copy_models(value: object) -> object
KnowledgeSemanticWatchAuthority.validate_authority() -> KnowledgeSemanticWatchAuthority

Release source · Runtime guarantees · Capability guides

from cayu import KnowledgeSemanticWatchCandidate

Durable-safe exact knowledge match presented to application policy.

Bases: _WatchModel.

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
reference KnowledgeRevisionRef required
record_type Literal['knowledge_entry', 'knowledge_chunk'] required
record_id str required
representation str required
content_hash str required
fused_rank int required
fused_score float required
best_rank int required
channel_matches tuple[KnowledgeSemanticWatchChannelMatch, ...] required
KnowledgeSemanticWatchCandidate.copy_reference(value: object) -> object
KnowledgeSemanticWatchCandidate.validate_identity(value: str, info) -> str
KnowledgeSemanticWatchCandidate.validate_content_hash(value: str) -> str
KnowledgeSemanticWatchCandidate.validate_rank(value: object, info) -> int
KnowledgeSemanticWatchCandidate.validate_score(value: object) -> float
KnowledgeSemanticWatchCandidate.copy_channel_matches(value: object) -> tuple[KnowledgeSemanticWatchChannelMatch, ...]
KnowledgeSemanticWatchCandidate.validate_reference_identity() -> KnowledgeSemanticWatchCandidate

Release source · Runtime guarantees · Capability guides

from cayu import KnowledgeSemanticWatchChannelMatch

Safe rank evidence from one independently ranked recall lane.

Bases: _WatchModel.

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
channel str required
index_version str required
rank int required
reasons tuple[str, ...] required
raw_score float | None None
KnowledgeSemanticWatchChannelMatch.validate_identity(value: str, info) -> str
KnowledgeSemanticWatchChannelMatch.validate_rank(value: object) -> int
KnowledgeSemanticWatchChannelMatch.validate_reasons(value: object) -> tuple[str, ...]
KnowledgeSemanticWatchChannelMatch.validate_raw_score(value: object) -> float | None

Release source · Runtime guarantees · Capability guides

from cayu import KnowledgeSemanticWatchConfig

Application-owned identities and bounds for one watch profile.

Bases: _WatchModel.

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] 1
watch_identity str required
watch_version str required
recall_profile_identity str required
recall_profile_version str required
policy_identity str required
policy_version str required
policy_timeout_seconds float 5.0
max_candidates int 10
knowledge_namespace str DEFAULT_KNOWLEDGE_NAMESPACE
knowledge_aspect_groups tuple[tuple[str, ...], ...] ()
required_channels tuple[str, ...] (KNOWLEDGE_LEXICAL_CHANNEL,)
KnowledgeSemanticWatchConfig.validate_schema_version(value: object) -> object
KnowledgeSemanticWatchConfig.validate_identity(value: str, info) -> str
KnowledgeSemanticWatchConfig.validate_timeout(value: object) -> float
KnowledgeSemanticWatchConfig.validate_max_candidates(value: object) -> int
KnowledgeSemanticWatchConfig.validate_aspect_groups(value: object) -> tuple[tuple[str, ...], ...]
KnowledgeSemanticWatchConfig.validate_required_channels(value: object) -> tuple[str, ...]
KnowledgeSemanticWatchConfig.validate_authority_separation() -> KnowledgeSemanticWatchConfig

Release source · Runtime guarantees · Capability guides

from cayu import KnowledgeSemanticWatchConflict

A watch operation conflicts with an immutable durable outcome.

Bases: ValueError.

KnowledgeSemanticWatchConflict.__init__(code: str) -> None

Release source · Runtime guarantees · Capability guides

from cayu import KnowledgeSemanticWatchDecision

Exact application-policy route for one watch request.

Bases: _WatchModel.

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] 1
request_sha256 str required
disposition KnowledgeSemanticWatchDisposition required
policy_identity str required
policy_version str required
code str required
annotations Mapping[str, Any] Field(default_factory=dict)
KnowledgeSemanticWatchDecision.validate_schema_version(value: object) -> object
KnowledgeSemanticWatchDecision.validate_request_sha256(value: str) -> str
KnowledgeSemanticWatchDecision.validate_identity(value: str, info) -> str
KnowledgeSemanticWatchDecision.copy_annotations(value: object) -> dict[str, Any]
KnowledgeSemanticWatchDecision.freeze_annotations(value: Mapping[str, Any]) -> Mapping[str, Any]
KnowledgeSemanticWatchDecision.serialize_annotations(value: Mapping[str, Any]) -> dict[str, Any]

Release source · Runtime guarantees · Capability guides

from cayu import KnowledgeSemanticWatchDisposition

Application-policy disposition for one bounded watch 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
IGNORE class attribute 'ignore'
EMIT class attribute 'emit'
ROUTE_TO_REVIEW class attribute 'route_to_review'

Release source · Runtime guarantees · Capability guides

from cayu import KnowledgeSemanticWatchEvaluator

Explicit orchestration over existing recall and application policy.

KnowledgeSemanticWatchEvaluator.__init__(store: KnowledgeStore, recall_engine: RecallEngine, *, config: KnowledgeSemanticWatchConfig, policy: KnowledgeSemanticWatchPolicy | None) -> None
KnowledgeSemanticWatchEvaluator.config() -> KnowledgeSemanticWatchConfig
async KnowledgeSemanticWatchEvaluator.evaluate(*, operation_id: str, observation_id: str, observation_source_type: str, observation_source_id: str, observation_text: str, access_scope: KnowledgeAccessScope | None=None) -> KnowledgeSemanticWatchReceipt

Release source · Runtime guarantees · Capability guides

from cayu import KnowledgeSemanticWatchEvidence

Safe bounded projection of one exact recall result.

Bases: _WatchModel.

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] 1
engine_version str required
situation_sha256 str required
fusion RetrievalFusionDiagnostics required
sources tuple[RecallSourceDiagnostic, ...] required
required_channels tuple[str, ...] required
candidates tuple[KnowledgeSemanticWatchCandidate, ...] required
recall_candidate_count int required
omitted_candidate_count int required
complete bool required
truncation_reasons tuple[str, ...] ()
KnowledgeSemanticWatchEvidence.validate_schema_version(value: object) -> object
KnowledgeSemanticWatchEvidence.validate_engine_version(value: str) -> str
KnowledgeSemanticWatchEvidence.validate_situation_sha256(value: str) -> str
KnowledgeSemanticWatchEvidence.copy_fusion(value: object) -> object
KnowledgeSemanticWatchEvidence.copy_sources(value: object) -> tuple[RecallSourceDiagnostic, ...]
KnowledgeSemanticWatchEvidence.validate_required_channels(value: object) -> tuple[str, ...]
KnowledgeSemanticWatchEvidence.copy_candidates(value: object) -> tuple[KnowledgeSemanticWatchCandidate, ...]
KnowledgeSemanticWatchEvidence.validate_counts(value: object, info) -> int
KnowledgeSemanticWatchEvidence.validate_complete(value: object) -> bool
KnowledgeSemanticWatchEvidence.validate_truncation_reasons(value: object) -> tuple[str, ...]
KnowledgeSemanticWatchEvidence.validate_evidence() -> KnowledgeSemanticWatchEvidence
KnowledgeSemanticWatchEvidence.fingerprint() -> str

Release source · Runtime guarantees · Capability guides

from cayu import KnowledgeSemanticWatchInvocation

Durable-safe identity for an observation before recall or policy execution.

Bases: _WatchModel.

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] 1
operation_id str required
observation_id str required
observation_source_type str required
observation_source_id str required
observation_sha256 str required
observation_bytes int required
watch_identity str required
watch_version str required
recall_profile_identity str required
recall_profile_version str required
policy_identity str required
policy_version str required
knowledge_namespace str required
knowledge_aspect_groups tuple[tuple[str, ...], ...] required
required_channels tuple[str, ...] required
max_candidates int required
access_scope KnowledgeAccessScope required
KnowledgeSemanticWatchInvocation.validate_schema_version(value: object) -> object
KnowledgeSemanticWatchInvocation.validate_identity(value: str, info) -> str
KnowledgeSemanticWatchInvocation.validate_observation_sha256(value: str) -> str
KnowledgeSemanticWatchInvocation.validate_observation_bytes(value: object) -> int
KnowledgeSemanticWatchInvocation.validate_max_candidates(value: object) -> int
KnowledgeSemanticWatchInvocation.validate_aspect_groups(value: object) -> tuple[tuple[str, ...], ...]
KnowledgeSemanticWatchInvocation.validate_required_channels(value: object) -> tuple[str, ...]
KnowledgeSemanticWatchInvocation.copy_access_scope(value: object) -> object
KnowledgeSemanticWatchInvocation.freeze_access_scope(value: KnowledgeAccessScope) -> KnowledgeAccessScope
KnowledgeSemanticWatchInvocation.serialize_access_scope(value: KnowledgeAccessScope) -> dict[str, Any]
KnowledgeSemanticWatchInvocation.fingerprint() -> str
KnowledgeSemanticWatchInvocation.access_scope_sha256() -> str

Release source · Runtime guarantees · Capability guides

from cayu import KnowledgeSemanticWatchPolicy

Application authority for one copied, bounded watch request.

Bases: Protocol.

async KnowledgeSemanticWatchPolicy.decide_semantic_watch(request: KnowledgeSemanticWatchRequest) -> KnowledgeSemanticWatchDecision

Release source · Runtime guarantees · Capability guides

from cayu import KnowledgeSemanticWatchPolicyError

Watch evaluation failed closed before durable routing.

Bases: RuntimeError.

KnowledgeSemanticWatchPolicyError.__init__(code: str) -> None

Release source · Runtime guarantees · Capability guides

from cayu import KnowledgeSemanticWatchReceipt

Store-authored immutable outcome for one exact watch invocation.

Bases: _WatchModel.

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] 1
operation_id str required
invocation_sha256 str required
request_sha256 str required
authority KnowledgeSemanticWatchAuthority required
committed_at datetime required
replayed bool False
KnowledgeSemanticWatchReceipt.validate_schema_version(value: object) -> object
KnowledgeSemanticWatchReceipt.validate_operation_id(value: str) -> str
KnowledgeSemanticWatchReceipt.validate_sha256(value: str, info) -> str
KnowledgeSemanticWatchReceipt.copy_authority(value: object) -> object
KnowledgeSemanticWatchReceipt.validate_committed_at(value: datetime) -> datetime
KnowledgeSemanticWatchReceipt.validate_replayed(value: object) -> bool
KnowledgeSemanticWatchReceipt.validate_receipt() -> KnowledgeSemanticWatchReceipt

Release source · Runtime guarantees · Capability guides

from cayu import KnowledgeSemanticWatchRequest

Copied bounded policy input; observation text is never persisted by Cayu.

Bases: _WatchModel.

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] 1
invocation KnowledgeSemanticWatchInvocation required
observation_text str required
recall_situation RecallSituation required
evidence KnowledgeSemanticWatchEvidence required
KnowledgeSemanticWatchRequest.validate_schema_version(value: object) -> object
KnowledgeSemanticWatchRequest.copy_models(value: object) -> object
KnowledgeSemanticWatchRequest.copy_recall_situation(value: object) -> object
KnowledgeSemanticWatchRequest.validate_observation_text(value: str) -> str
KnowledgeSemanticWatchRequest.validate_binding() -> KnowledgeSemanticWatchRequest
KnowledgeSemanticWatchRequest.fingerprint() -> str

Release source · Runtime guarantees · Capability guides

from cayu import load_knowledge_semantic_watch_receipt
async load_knowledge_semantic_watch_receipt(store: KnowledgeStore, *, operation_id: str, access_scope: KnowledgeAccessScope | None=None) -> KnowledgeSemanticWatchReceipt | None

Release source · Runtime guarantees · Capability guides

MAX_KNOWLEDGE_SEMANTIC_WATCH_ANNOTATION_BYTES

Section titled “MAX_KNOWLEDGE_SEMANTIC_WATCH_ANNOTATION_BYTES”
from cayu import MAX_KNOWLEDGE_SEMANTIC_WATCH_ANNOTATION_BYTES
MAX_KNOWLEDGE_SEMANTIC_WATCH_ANNOTATION_BYTES = 4096

Release source · Runtime guarantees · Capability guides

from cayu import MAX_KNOWLEDGE_SEMANTIC_WATCH_CANDIDATES
MAX_KNOWLEDGE_SEMANTIC_WATCH_CANDIDATES = 20

Release source · Runtime guarantees · Capability guides

MAX_KNOWLEDGE_SEMANTIC_WATCH_OBSERVATION_BYTES

Section titled “MAX_KNOWLEDGE_SEMANTIC_WATCH_OBSERVATION_BYTES”
from cayu import MAX_KNOWLEDGE_SEMANTIC_WATCH_OBSERVATION_BYTES
MAX_KNOWLEDGE_SEMANTIC_WATCH_OBSERVATION_BYTES = RECALL_MAX_QUERY_BYTES

Release source · Runtime guarantees · Capability guides

MAX_KNOWLEDGE_SEMANTIC_WATCH_POLICY_REQUEST_BYTES

Section titled “MAX_KNOWLEDGE_SEMANTIC_WATCH_POLICY_REQUEST_BYTES”
from cayu import MAX_KNOWLEDGE_SEMANTIC_WATCH_POLICY_REQUEST_BYTES
MAX_KNOWLEDGE_SEMANTIC_WATCH_POLICY_REQUEST_BYTES = 256000

Release source · Runtime guarantees · Capability guides

MAX_KNOWLEDGE_SEMANTIC_WATCH_RECEIPT_BYTES

Section titled “MAX_KNOWLEDGE_SEMANTIC_WATCH_RECEIPT_BYTES”
from cayu import MAX_KNOWLEDGE_SEMANTIC_WATCH_RECEIPT_BYTES
MAX_KNOWLEDGE_SEMANTIC_WATCH_RECEIPT_BYTES = 384000

Release source · Runtime guarantees · Capability guides

prepare_knowledge_semantic_watch_invocation

Section titled “prepare_knowledge_semantic_watch_invocation”
from cayu import prepare_knowledge_semantic_watch_invocation
prepare_knowledge_semantic_watch_invocation(*, operation_id: str, observation_id: str, observation_source_type: str, observation_source_id: str, observation_text: str, access_scope: KnowledgeAccessScope, config: KnowledgeSemanticWatchConfig) -> KnowledgeSemanticWatchInvocation

Release source · Runtime guarantees · Capability guides

from cayu import project_knowledge_semantic_watch_evidence
project_knowledge_semantic_watch_evidence(result: RecallResult, *, max_candidates: int, required_channels: Sequence[str]=(KNOWLEDGE_LEXICAL_CHANNEL,)) -> KnowledgeSemanticWatchEvidence

Release source · Runtime guarantees · Capability guides