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.
DEFAULT_KNOWLEDGE_CHUNK_OVERLAP_BYTES
Section titled “DEFAULT_KNOWLEDGE_CHUNK_OVERLAP_BYTES”from cayu.storage import DEFAULT_KNOWLEDGE_CHUNK_OVERLAP_BYTESDEFAULT_KNOWLEDGE_CHUNK_OVERLAP_BYTES = 400Release source · Runtime guarantees · Capability guides
DEFAULT_KNOWLEDGE_CHUNK_TARGET_BYTES
Section titled “DEFAULT_KNOWLEDGE_CHUNK_TARGET_BYTES”from cayu.storage import DEFAULT_KNOWLEDGE_CHUNK_TARGET_BYTESDEFAULT_KNOWLEDGE_CHUNK_TARGET_BYTES = 4000Release source · Runtime guarantees · Capability guides
DEFAULT_KNOWLEDGE_INDEX_MAX_CHUNKS
Section titled “DEFAULT_KNOWLEDGE_INDEX_MAX_CHUNKS”from cayu.storage import DEFAULT_KNOWLEDGE_INDEX_MAX_CHUNKSDEFAULT_KNOWLEDGE_INDEX_MAX_CHUNKS = 1000Release source · Runtime guarantees · Capability guides
KnowledgeIndexer
Section titled “KnowledgeIndexer”from cayu.storage import KnowledgeIndexerDeterministic text indexer for KnowledgeStore entries and chunks.
init (method)
Section titled “init (method)”KnowledgeIndexer.__init__(store: KnowledgeStore | None=None, *, access_scope: KnowledgeAccessScope | None=None) -> Nonebuild (method)
Section titled “build (method)”KnowledgeIndexer.build(request: KnowledgeIndexRequest) -> KnowledgeIndexResultindex_text (method)
Section titled “index_text (method)”async KnowledgeIndexer.index_text(request: KnowledgeIndexRequest) -> KnowledgeIndexResultRelease source · Runtime guarantees · Capability guides
KnowledgeIndexRequest
Section titled “KnowledgeIndexRequest”from cayu.storage import KnowledgeIndexRequestRequest to deterministically index text into an entry and chunks.
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 |
|---|---|---|
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 |
validate_text (method)
Section titled “validate_text (method)”KnowledgeIndexRequest.validate_text(value: str, info) -> strcopy_labels (method)
Section titled “copy_labels (method)”KnowledgeIndexRequest.copy_labels(value) -> dict[str, str]copy_metadata (method)
Section titled “copy_metadata (method)”KnowledgeIndexRequest.copy_metadata(value: dict[str, Any], info) -> dict[str, Any]validate_clean_nonblank_fields (method)
Section titled “validate_clean_nonblank_fields (method)”KnowledgeIndexRequest.validate_clean_nonblank_fields(value: str, info) -> strvalidate_optional_clean_nonblank_fields (method)
Section titled “validate_optional_clean_nonblank_fields (method)”KnowledgeIndexRequest.validate_optional_clean_nonblank_fields(value: str | None, info) -> str | Nonecopy_string_list (method)
Section titled “copy_string_list (method)”KnowledgeIndexRequest.copy_string_list(value, info) -> list[str]validate_optional_unit_interval (method)
Section titled “validate_optional_unit_interval (method)”KnowledgeIndexRequest.validate_optional_unit_interval(value, info) -> float | Nonevalidate_expires_at (method)
Section titled “validate_expires_at (method)”KnowledgeIndexRequest.validate_expires_at(value: datetime | None, info) -> datetime | Nonevalidate_nonnegative_ints (method)
Section titled “validate_nonnegative_ints (method)”KnowledgeIndexRequest.validate_nonnegative_ints(value: int, info) -> intvalidate_chunk_bounds (method)
Section titled “validate_chunk_bounds (method)”KnowledgeIndexRequest.validate_chunk_bounds() -> KnowledgeIndexRequestRelease source · Runtime guarantees · Capability guides
KnowledgeIndexResult
Section titled “KnowledgeIndexResult”from cayu.storage import KnowledgeIndexResultDeterministic output from a knowledge indexing run.
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 |
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 |
copy_entry (method)
Section titled “copy_entry (method)”KnowledgeIndexResult.copy_entry(value)copy_chunks (method)
Section titled “copy_chunks (method)”KnowledgeIndexResult.copy_chunks(value)validate_source_hash (method)
Section titled “validate_source_hash (method)”KnowledgeIndexResult.validate_source_hash(value: str, info) -> strvalidate_nonnegative_int (method)
Section titled “validate_nonnegative_int (method)”KnowledgeIndexResult.validate_nonnegative_int(value: int, info) -> intvalidate_chunk_count (method)
Section titled “validate_chunk_count (method)”KnowledgeIndexResult.validate_chunk_count() -> KnowledgeIndexResult