cayu.knowledge.records
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.
BUILTIN_KNOWLEDGE_KINDS
Section titled “BUILTIN_KNOWLEDGE_KINDS”from cayu.storage import BUILTIN_KNOWLEDGE_KINDSBUILTIN_KNOWLEDGE_KINDS = ('fact', 'preference', 'procedure', 'instruction', 'skill', 'document', 'example', 'warning', 'decision', 'event', 'summary')Release source · Runtime guarantees · Capability guides
copy_knowledge_revision_refs
Section titled “copy_knowledge_revision_refs”from cayu.storage import copy_knowledge_revision_refsCopy, bound, deduplicate, and canonically order exact revision references.
copy_knowledge_revision_refs(value: Sequence[KnowledgeRevisionRef]) -> tuple[KnowledgeRevisionRef, ...]Release source · Runtime guarantees · Capability guides
DEFAULT_KNOWLEDGE_KIND
Section titled “DEFAULT_KNOWLEDGE_KIND”from cayu.storage import DEFAULT_KNOWLEDGE_KINDDEFAULT_KNOWLEDGE_KIND = 'fact'Release source · Runtime guarantees · Capability guides
DEFAULT_KNOWLEDGE_LIMIT
Section titled “DEFAULT_KNOWLEDGE_LIMIT”from cayu.storage import DEFAULT_KNOWLEDGE_LIMITDEFAULT_KNOWLEDGE_LIMIT = 10Release source · Runtime guarantees · Capability guides
DEFAULT_KNOWLEDGE_MAX_BYTES
Section titled “DEFAULT_KNOWLEDGE_MAX_BYTES”from cayu.storage import DEFAULT_KNOWLEDGE_MAX_BYTESDEFAULT_KNOWLEDGE_MAX_BYTES = 20000Release source · Runtime guarantees · Capability guides
DEFAULT_KNOWLEDGE_NAMESPACE
Section titled “DEFAULT_KNOWLEDGE_NAMESPACE”from cayu.storage import DEFAULT_KNOWLEDGE_NAMESPACEDEFAULT_KNOWLEDGE_NAMESPACE = 'default'Release source · Runtime guarantees · Capability guides
KnowledgeActorType
Section titled “KnowledgeActorType”from cayu.storage import KnowledgeActorTypeBases: StrEnum.
Fields and attributes
Section titled “Fields and attributes”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 |
|---|---|---|
APP |
class attribute |
'app' |
USER |
class attribute |
'user' |
MODEL |
class attribute |
'model' |
SYSTEM |
class attribute |
'system' |
Release source · Runtime guarantees · Capability guides
KnowledgeChunk
Section titled “KnowledgeChunk”from cayu.storage import KnowledgeChunkImmutable chunk belonging to one exact knowledge revision.
Bases: BaseModel.
Fields and attributes
Section titled “Fields and attributes”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 |
|---|---|---|
id |
str |
required |
entry_id |
str |
required |
entry_revision |
int |
1 |
text |
str |
required |
chunk_index |
int |
required |
content_hash |
str | None |
None |
source_uri |
str | None |
None |
metadata |
dict[str, Any] |
Field(default_factory=dict) |
copy_metadata (method)
Section titled “copy_metadata (method)”KnowledgeChunk.copy_metadata(value: dict[str, Any]) -> dict[str, Any]validate_id (method)
Section titled “validate_id (method)”KnowledgeChunk.validate_id(value: str) -> strvalidate_clean_nonblank_fields (method)
Section titled “validate_clean_nonblank_fields (method)”KnowledgeChunk.validate_clean_nonblank_fields(value: str, info) -> strvalidate_nonblank_text (method)
Section titled “validate_nonblank_text (method)”KnowledgeChunk.validate_nonblank_text(value: str, info) -> strvalidate_optional_clean_nonblank_fields (method)
Section titled “validate_optional_clean_nonblank_fields (method)”KnowledgeChunk.validate_optional_clean_nonblank_fields(value: str | None, info) -> str | Nonevalidate_chunk_index (method)
Section titled “validate_chunk_index (method)”KnowledgeChunk.validate_chunk_index(value: int, info) -> intvalidate_entry_revision (method)
Section titled “validate_entry_revision (method)”KnowledgeChunk.validate_entry_revision(value: int) -> intRelease source · Runtime guarantees · Capability guides
KnowledgeChunkConflict
Section titled “KnowledgeChunkConflict”from cayu.storage import KnowledgeChunkConflictA knowledge write conflicts with an occupied global chunk identity.
Bases: RuntimeError.
init (method)
Section titled “init (method)”KnowledgeChunkConflict.__init__(operation: str) -> NoneRelease source · Runtime guarantees · Capability guides
KnowledgeEntry
Section titled “KnowledgeEntry”from cayu.storage import KnowledgeEntryImmutable snapshot of one exact logical knowledge revision.
Bases: BaseModel.
Fields and attributes
Section titled “Fields and attributes”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 |
|---|---|---|
id |
str |
required |
revision |
int |
1 |
text |
str |
required |
namespace |
str |
DEFAULT_KNOWLEDGE_NAMESPACE |
labels |
dict[str, str] |
Field(default_factory=dict) |
kind |
str |
DEFAULT_KNOWLEDGE_KIND |
visibility |
KnowledgeVisibility |
KnowledgeVisibility.GLOBAL |
status |
KnowledgeStatus |
KnowledgeStatus.ACTIVE |
created_by_type |
KnowledgeActorType |
KnowledgeActorType.APP |
created_by |
str |
'app' |
created_at |
datetime |
Field(default_factory=lambda: datetime.now(UTC)) |
updated_at |
datetime |
Field(default_factory=lambda: datetime.now(UTC)) |
source_type |
str | None |
None |
source_uri |
str | None |
None |
source_id |
str | None |
None |
source_hash |
str | None |
None |
aspects |
list[str] |
Field(default_factory=list) |
impact_targets |
list[str] |
Field(default_factory=list) |
importance |
float | None |
None |
importance_source |
str | None |
None |
confidence |
float | None |
None |
last_used_at |
datetime | None |
None |
expires_at |
datetime | None |
None |
title |
str | None |
None |
metadata |
dict[str, Any] |
Field(default_factory=dict) |
copy_metadata (method)
Section titled “copy_metadata (method)”KnowledgeEntry.copy_metadata(value: dict[str, Any]) -> dict[str, Any]copy_labels (method)
Section titled “copy_labels (method)”KnowledgeEntry.copy_labels(value) -> dict[str, str]validate_id (method)
Section titled “validate_id (method)”KnowledgeEntry.validate_id(value: str) -> strvalidate_clean_nonblank_fields (method)
Section titled “validate_clean_nonblank_fields (method)”KnowledgeEntry.validate_clean_nonblank_fields(value: str, info) -> strvalidate_created_by (method)
Section titled “validate_created_by (method)”KnowledgeEntry.validate_created_by(value: object) -> strvalidate_revision (method)
Section titled “validate_revision (method)”KnowledgeEntry.validate_revision(value: int) -> intvalidate_nonblank_text (method)
Section titled “validate_nonblank_text (method)”KnowledgeEntry.validate_nonblank_text(value: str, info) -> strvalidate_optional_clean_nonblank_fields (method)
Section titled “validate_optional_clean_nonblank_fields (method)”KnowledgeEntry.validate_optional_clean_nonblank_fields(value: str | None, info) -> str | Nonecopy_string_list (method)
Section titled “copy_string_list (method)”KnowledgeEntry.copy_string_list(value, info) -> list[str]validate_optional_unit_interval (method)
Section titled “validate_optional_unit_interval (method)”KnowledgeEntry.validate_optional_unit_interval(value, info) -> float | Nonevalidate_timezone_aware_datetime (method)
Section titled “validate_timezone_aware_datetime (method)”KnowledgeEntry.validate_timezone_aware_datetime(value: datetime | None, info) -> datetime | Nonevalidate_timestamp_order (method)
Section titled “validate_timestamp_order (method)”KnowledgeEntry.validate_timestamp_order() -> KnowledgeEntryRelease source · Runtime guarantees · Capability guides
KnowledgeEntryReadLimitExceeded
Section titled “KnowledgeEntryReadLimitExceeded”from cayu.storage import KnowledgeEntryReadLimitExceededAn authorized entry exceeds a caller-owned read byte ceiling.
Bases: ValueError.
init (method)
Section titled “init (method)”KnowledgeEntryReadLimitExceeded.__init__(entry_id: str, *, revision: int, payload_bytes: int, max_bytes: int) -> NoneRelease source · Runtime guarantees · Capability guides
KnowledgeEvidence
Section titled “KnowledgeEvidence”from cayu.storage import KnowledgeEvidenceImmutable exact source evidence for one knowledge revision.
Bases: BaseModel.
Fields and attributes
Section titled “Fields and attributes”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 |
|---|---|---|
id |
str |
required |
entry_id |
str |
required |
entry_revision |
int |
1 |
chunk_id |
str | None |
None |
role |
KnowledgeEvidenceRole |
KnowledgeEvidenceRole.ORIGIN |
source_type |
str |
required |
source_id |
str | None |
None |
source_uri |
str | None |
None |
source_revision |
str | None |
None |
source_hash |
str | None |
None |
locator |
dict[str, Any] |
Field(default_factory=dict) |
disposition |
KnowledgeEvidenceDisposition |
KnowledgeEvidenceDisposition.LIVE |
created_at |
datetime |
Field(default_factory=lambda: datetime.now(UTC)) |
metadata |
dict[str, Any] |
Field(default_factory=dict) |
validate_required_identity (method)
Section titled “validate_required_identity (method)”KnowledgeEvidence.validate_required_identity(value: str, info) -> strvalidate_entry_id (method)
Section titled “validate_entry_id (method)”KnowledgeEvidence.validate_entry_id(value: str) -> strvalidate_optional_identity (method)
Section titled “validate_optional_identity (method)”KnowledgeEvidence.validate_optional_identity(value: str | None, info) -> str | Nonevalidate_chunk_id (method)
Section titled “validate_chunk_id (method)”KnowledgeEvidence.validate_chunk_id(value: str | None) -> str | Nonevalidate_entry_revision (method)
Section titled “validate_entry_revision (method)”KnowledgeEvidence.validate_entry_revision(value: int) -> intcopy_json_objects (method)
Section titled “copy_json_objects (method)”KnowledgeEvidence.copy_json_objects(value: dict[str, Any], info) -> dict[str, Any]validate_created_at (method)
Section titled “validate_created_at (method)”KnowledgeEvidence.validate_created_at(value: datetime) -> datetimevalidate_stable_source_identity (method)
Section titled “validate_stable_source_identity (method)”KnowledgeEvidence.validate_stable_source_identity() -> KnowledgeEvidenceRelease source · Runtime guarantees · Capability guides
KnowledgeEvidenceConflict
Section titled “KnowledgeEvidenceConflict”from cayu.storage import KnowledgeEvidenceConflictA knowledge write conflicts with an occupied global evidence identity.
Bases: RuntimeError.
init (method)
Section titled “init (method)”KnowledgeEvidenceConflict.__init__(operation: str) -> NoneRelease source · Runtime guarantees · Capability guides
KnowledgeEvidenceDisposition
Section titled “KnowledgeEvidenceDisposition”from cayu.storage import KnowledgeEvidenceDispositionBases: StrEnum.
Fields and attributes
Section titled “Fields and attributes”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 |
|---|---|---|
LIVE |
class attribute |
'live' |
DETACHED |
class attribute |
'detached' |
RETAINED |
class attribute |
'retained' |
Release source · Runtime guarantees · Capability guides
KnowledgeEvidenceResult
Section titled “KnowledgeEvidenceResult”from cayu.storage import KnowledgeEvidenceResultBounded evidence for one exact authorized knowledge revision.
Bases: BaseModel.
Fields and attributes
Section titled “Fields and attributes”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 |
|---|---|---|
entry_id |
str |
required |
entry_revision |
int |
required |
evidence |
list[KnowledgeEvidence] |
Field(default_factory=list) |
truncated |
bool |
False |
limit |
int |
required |
max_bytes |
int |
required |
total_evidence_known |
int |
required |
validate_entry_id (method)
Section titled “validate_entry_id (method)”KnowledgeEvidenceResult.validate_entry_id(value: str) -> strvalidate_entry_revision (method)
Section titled “validate_entry_revision (method)”KnowledgeEvidenceResult.validate_entry_revision(value: int) -> intcopy_evidence (method)
Section titled “copy_evidence (method)”KnowledgeEvidenceResult.copy_evidence(value) -> list[KnowledgeEvidence]validate_limits (method)
Section titled “validate_limits (method)”KnowledgeEvidenceResult.validate_limits(value: int, info) -> intvalidate_total (method)
Section titled “validate_total (method)”KnowledgeEvidenceResult.validate_total(value: int) -> intvalidate_truncated (method)
Section titled “validate_truncated (method)”KnowledgeEvidenceResult.validate_truncated(value) -> boolvalidate_result (method)
Section titled “validate_result (method)”KnowledgeEvidenceResult.validate_result() -> KnowledgeEvidenceResultRelease source · Runtime guarantees · Capability guides
KnowledgeEvidenceRole
Section titled “KnowledgeEvidenceRole”from cayu.storage import KnowledgeEvidenceRoleBases: StrEnum.
Fields and attributes
Section titled “Fields and attributes”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 |
|---|---|---|
ORIGIN |
class attribute |
'origin' |
SUPPORTING |
class attribute |
'supporting' |
Release source · Runtime guarantees · Capability guides
KnowledgeRevisionConflict
Section titled “KnowledgeRevisionConflict”from cayu.storage import KnowledgeRevisionConflictA canonical write lost a compare-and-swap race.
Bases: RuntimeError.
init (method)
Section titled “init (method)”KnowledgeRevisionConflict.__init__(entry_id: str, *, expected_revision: int | None, actual_revision: int | None) -> NoneRelease source · Runtime guarantees · Capability guides
KnowledgeRevisionRef
Section titled “KnowledgeRevisionRef”from cayu.storage import KnowledgeRevisionRefStable reference to one immutable revision of one logical entry.
Bases: BaseModel.
Fields and attributes
Section titled “Fields and attributes”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 |
|---|---|---|
entry_id |
str |
required |
revision |
int |
required |
validate_entry_id (method)
Section titled “validate_entry_id (method)”KnowledgeRevisionRef.validate_entry_id(value: str) -> strvalidate_revision (method)
Section titled “validate_revision (method)”KnowledgeRevisionRef.validate_revision(value: int) -> intRelease source · Runtime guarantees · Capability guides
KnowledgeStatus
Section titled “KnowledgeStatus”from cayu.storage import KnowledgeStatusBases: StrEnum.
Fields and attributes
Section titled “Fields and attributes”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 |
|---|---|---|
ACTIVE |
class attribute |
'active' |
PENDING |
class attribute |
'pending' |
ARCHIVED |
class attribute |
'archived' |
DELETED |
class attribute |
'deleted' |
Release source · Runtime guarantees · Capability guides
KnowledgeVisibility
Section titled “KnowledgeVisibility”from cayu.storage import KnowledgeVisibilityBases: StrEnum.
Fields and attributes
Section titled “Fields and attributes”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 |
|---|---|---|
GLOBAL |
class attribute |
'global' |
ORGANIZATION |
class attribute |
'organization' |
PROJECT |
class attribute |
'project' |
WORKSPACE |
class attribute |
'workspace' |
USER |
class attribute |
'user' |
SESSION |
class attribute |
'session' |
TASK |
class attribute |
'task' |
Release source · Runtime guarantees · Capability guides
MAX_KNOWLEDGE_ACTIVATION_IDENTITY_BYTES
Section titled “MAX_KNOWLEDGE_ACTIVATION_IDENTITY_BYTES”from cayu.storage import MAX_KNOWLEDGE_ACTIVATION_IDENTITY_BYTESMAX_KNOWLEDGE_ACTIVATION_IDENTITY_BYTES = 256Release source · Runtime guarantees · Capability guides
MAX_KNOWLEDGE_CHUNK_ID_BYTES
Section titled “MAX_KNOWLEDGE_CHUNK_ID_BYTES”from cayu.storage import MAX_KNOWLEDGE_CHUNK_ID_BYTESMAX_KNOWLEDGE_CHUNK_ID_BYTES = 512Release source · Runtime guarantees · Capability guides
MAX_KNOWLEDGE_CHUNK_INDEX
Section titled “MAX_KNOWLEDGE_CHUNK_INDEX”from cayu.storage import MAX_KNOWLEDGE_CHUNK_INDEXMAX_KNOWLEDGE_CHUNK_INDEX = 2 ** 31 - 1Release source · Runtime guarantees · Capability guides
MAX_KNOWLEDGE_ENTRY_ID_BYTES
Section titled “MAX_KNOWLEDGE_ENTRY_ID_BYTES”from cayu.storage import MAX_KNOWLEDGE_ENTRY_ID_BYTESMAX_KNOWLEDGE_ENTRY_ID_BYTES = 256Release source · Runtime guarantees · Capability guides
MAX_KNOWLEDGE_EVIDENCE_BYTES
Section titled “MAX_KNOWLEDGE_EVIDENCE_BYTES”from cayu.storage import MAX_KNOWLEDGE_EVIDENCE_BYTESMAX_KNOWLEDGE_EVIDENCE_BYTES = DEFAULT_KNOWLEDGE_MAX_BYTESRelease source · Runtime guarantees · Capability guides
MAX_KNOWLEDGE_EVIDENCE_JSON_BYTES
Section titled “MAX_KNOWLEDGE_EVIDENCE_JSON_BYTES”from cayu.storage import MAX_KNOWLEDGE_EVIDENCE_JSON_BYTESMAX_KNOWLEDGE_EVIDENCE_JSON_BYTES = 16384Release source · Runtime guarantees · Capability guides
MAX_KNOWLEDGE_REVISION
Section titled “MAX_KNOWLEDGE_REVISION”from cayu.storage import MAX_KNOWLEDGE_REVISIONMAX_KNOWLEDGE_REVISION = 2 ** 31 - 1Release source · Runtime guarantees · Capability guides
MAX_KNOWLEDGE_REVISION_SEARCH_REFS
Section titled “MAX_KNOWLEDGE_REVISION_SEARCH_REFS”from cayu.storage import MAX_KNOWLEDGE_REVISION_SEARCH_REFSMAX_KNOWLEDGE_REVISION_SEARCH_REFS = 250