Skip to content

cayu.storage.knowledge_indexer

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.storage import DEFAULT_KNOWLEDGE_CHUNK_OVERLAP_BYTES
DEFAULT_KNOWLEDGE_CHUNK_OVERLAP_BYTES = 400

Release source · Runtime guarantees · Capability guides

from cayu.storage import DEFAULT_KNOWLEDGE_CHUNK_TARGET_BYTES
DEFAULT_KNOWLEDGE_CHUNK_TARGET_BYTES = 4000

Release source · Runtime guarantees · Capability guides

from cayu.storage import DEFAULT_KNOWLEDGE_INDEX_MAX_CHUNKS
DEFAULT_KNOWLEDGE_INDEX_MAX_CHUNKS = 1000

Release source · Runtime guarantees · Capability guides

from cayu.storage import KnowledgeIndexer

Deterministic text indexer for KnowledgeStore entries and chunks.

KnowledgeIndexer.__init__(store: KnowledgeStore | None=None, *, access_scope: KnowledgeAccessScope | None=None) -> None
KnowledgeIndexer.build(request: KnowledgeIndexRequest) -> KnowledgeIndexResult
async KnowledgeIndexer.index_text(request: KnowledgeIndexRequest) -> KnowledgeIndexResult

Release source · Runtime guarantees · Capability guides

from cayu.storage import KnowledgeIndexRequest

Request to deterministically index text into an entry and chunks.

Bases: BaseModel.

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
text str required
entry_id str | None None
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'
source_type str | None None
source_uri str | None None
source_id 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
expires_at datetime | None None
title str | None None
metadata dict[str, Any] Field(default_factory=dict)
chunk_metadata dict[str, Any] Field(default_factory=dict)
entry_text_max_bytes int DEFAULT_KNOWLEDGE_INDEX_ENTRY_TEXT_MAX_BYTES
chunk_target_bytes int DEFAULT_KNOWLEDGE_CHUNK_TARGET_BYTES
chunk_overlap_bytes int DEFAULT_KNOWLEDGE_CHUNK_OVERLAP_BYTES
max_chunks int DEFAULT_KNOWLEDGE_INDEX_MAX_CHUNKS
skip_unchanged bool True
KnowledgeIndexRequest.validate_text(value: str, info) -> str
KnowledgeIndexRequest.copy_labels(value) -> dict[str, str]
KnowledgeIndexRequest.copy_metadata(value: dict[str, Any], info) -> dict[str, Any]
KnowledgeIndexRequest.validate_clean_nonblank_fields(value: str, info) -> str

validate_optional_clean_nonblank_fields (method)

Section titled “validate_optional_clean_nonblank_fields (method)”
KnowledgeIndexRequest.validate_optional_clean_nonblank_fields(value: str | None, info) -> str | None
KnowledgeIndexRequest.copy_string_list(value, info) -> list[str]
KnowledgeIndexRequest.validate_optional_unit_interval(value, info) -> float | None
KnowledgeIndexRequest.validate_expires_at(value: datetime | None, info) -> datetime | None
KnowledgeIndexRequest.validate_nonnegative_ints(value: int, info) -> int
KnowledgeIndexRequest.validate_chunk_bounds() -> KnowledgeIndexRequest

Release source · Runtime guarantees · Capability guides

from cayu.storage import KnowledgeIndexResult

Deterministic output from a knowledge indexing run.

Bases: BaseModel.

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 KnowledgeEntry required
chunks list[KnowledgeChunk] required
source_hash str required
text_bytes int required
chunk_count int required
truncated bool False
entry_text_truncated bool False
written bool False
unchanged bool False
KnowledgeIndexResult.copy_entry(value)
KnowledgeIndexResult.copy_chunks(value)
KnowledgeIndexResult.validate_source_hash(value: str, info) -> str
KnowledgeIndexResult.validate_nonnegative_int(value: int, info) -> int
KnowledgeIndexResult.validate_chunk_count() -> KnowledgeIndexResult

Release source · Runtime guarantees · Capability guides