Skip to content

cayu.memory.recall

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.memory import KNOWLEDGE_LEXICAL_CHANNEL
KNOWLEDGE_LEXICAL_CHANNEL = 'knowledge.lexical'

Release source · Runtime guarantees · Capability guides

from cayu.memory import KNOWLEDGE_SEMANTIC_CHANNEL
KNOWLEDGE_SEMANTIC_CHANNEL = 'knowledge.semantic'

Release source · Runtime guarantees · Capability guides

from cayu.memory import KnowledgeFrontierRecallSource

Knowledge recall lane restricted to one captured processing frontier.

Bases: KnowledgeRecallSource.

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
name class attribute 'knowledge'
channel_names class attribute (KNOWLEDGE_LEXICAL_CHANNEL, KNOWLEDGE_SEMANTIC_CHANNEL)
continuation_channels tuple[str, ...] ()
KnowledgeFrontierRecallSource.__init__(store: KnowledgeStore, *, knowledge_sequence: int, index_readiness_sequence: int, required: bool=True, candidate_limit: int=20, max_bytes: int=64000, max_record_bytes: int=8000, semantic_timeout_seconds: float=1.0, lineage_limit: int=0, lineage_candidate_limit: int=10, lineage_max_bytes: int=MAX_KNOWLEDGE_RELATION_BYTES) -> None
async KnowledgeFrontierRecallSource.retrieve(situation: RecallSituation) -> RecallSourceResult

Release source · Runtime guarantees · Capability guides

from cayu.memory import KnowledgeRecallSource

Revision-exact lexical and optional semantic lanes from one KnowledgeStore.

Bases: RecallSource.

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
name class attribute 'knowledge'
channel_names class attribute (KNOWLEDGE_LEXICAL_CHANNEL, KNOWLEDGE_SEMANTIC_CHANNEL)
continuation_channels tuple[str, ...] ()
KnowledgeRecallSource.__init__(store: KnowledgeStore, *, required: bool=True, candidate_limit: int=20, max_bytes: int=64000, max_record_bytes: int=8000, semantic_timeout_seconds: float=1.0, lineage_limit: int=0, lineage_candidate_limit: int=10, lineage_max_bytes: int=MAX_KNOWLEDGE_RELATION_BYTES) -> None
async KnowledgeRecallSource.retrieve(situation: RecallSituation) -> RecallSourceResult

Release source · Runtime guarantees · Capability guides

from cayu.memory import KnowledgeRevisionRecallSource

Knowledge recall lane restricted to an exact bounded revision set.

Bases: KnowledgeRecallSource.

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
name class attribute 'knowledge'
channel_names class attribute (KNOWLEDGE_LEXICAL_CHANNEL, KNOWLEDGE_SEMANTIC_CHANNEL)
continuation_channels tuple[str, ...] ()
KnowledgeRevisionRecallSource.__init__(store: KnowledgeStore, revision_refs: Sequence[KnowledgeRevisionRef], *, knowledge_sequence: int | None=None, index_readiness_sequence: int | None=None, required: bool=True, candidate_limit: int=20, max_bytes: int=64000, max_record_bytes: int=8000, semantic_timeout_seconds: float=1.0, lineage_limit: int=0, lineage_candidate_limit: int=10, lineage_max_bytes: int=MAX_KNOWLEDGE_RELATION_BYTES) -> None
async KnowledgeRevisionRecallSource.retrieve(situation: RecallSituation) -> RecallSourceResult

Release source · Runtime guarantees · Capability guides

from cayu.memory import RECALL_ENGINE_VERSION
RECALL_ENGINE_VERSION = 'cayu.recall.v1'

Release source · Runtime guarantees · Capability guides

from cayu import RecallCandidate

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
fused FusedRetrievalCandidate required
record RecallRecord required
RecallCandidate.copy_fused(value) -> FusedRetrievalCandidate
RecallCandidate.copy_record(value) -> RecallRecord
RecallCandidate.validate_identity() -> RecallCandidate

Release source · Runtime guarantees · Capability guides

from cayu import RecallEngine

Run bounded sources concurrently and fuse their recorded ranks deterministically.

RecallEngine.__init__(sources: Sequence[RecallSource], *, fusion_config: WeightedReciprocalRankFusionConfig, config: RecallEngineConfig | None=None) -> None
async RecallEngine.recall(situation: RecallSituation) -> RecallResult

Release source · Runtime guarantees · Capability guides

from cayu.memory import RecallEngineConfig

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
source_timeout_seconds float 2.0
overall_timeout_seconds float 5.0
max_parallel_sources int 4
max_source_result_bytes int 256000
max_result_bytes int 128000
engine_version str RECALL_ENGINE_VERSION
RecallEngineConfig.validate_timeout(value, info) -> float
RecallEngineConfig.validate_parallelism(value) -> int
RecallEngineConfig.validate_byte_limits(value, info) -> int
RecallEngineConfig.validate_engine_version(value: str) -> str

Release source · Runtime guarantees · Capability guides

from cayu.memory import RecallRecord

Bounded representation and exact locator for one canonical candidate.

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
identity RetrievalCandidateIdentity required
representation str required
text str required
text_complete bool required
content_hash str required
title str | None Field(default=None, exclude_if=lambda value: value is None)
locator Mapping[str, Any] required
lineage KnowledgeLineageResult | None Field(default=None, exclude_if=lambda value: value is None)
RecallRecord.copy_identity(value)
RecallRecord.validate_representation(value: str) -> str
RecallRecord.validate_text(value: str) -> str
RecallRecord.validate_title(value: str | None) -> str | None
RecallRecord.validate_text_complete(value) -> bool
RecallRecord.validate_content_hash(value: str) -> str
RecallRecord.copy_locator(value) -> dict[str, Any]
RecallRecord.freeze_locator(value: Mapping[str, Any]) -> Mapping[str, Any]
RecallRecord.serialize_locator(value: Mapping[str, Any]) -> dict[str, Any]
RecallRecord.copy_lineage(value)
RecallRecord.validate_lineage_locator() -> RecallRecord

Release source · Runtime guarantees · Capability guides

from cayu import RecallResult

Cross-source retrieval output; not admission, context, or exposure evidence.

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
engine_version str required
situation_sha256 str required
candidates tuple[RecallCandidate, ...] required
fusion RetrievalFusionDiagnostics required
sources tuple[RecallSourceDiagnostic, ...] required
continuations Mapping[str, str] Field(default_factory=dict)
truncated bool required
relevance_query str | None Field(default=None, max_length=RECALL_MAX_QUERY_BYTES)
omitted_by_result_bytes int 0
RecallResult.validate_relevance_query(value: str | None) -> str | None
RecallResult.validate_engine_version(value: str) -> str
RecallResult.validate_situation_hash(value: str) -> str
RecallResult.copy_candidates(value) -> tuple[RecallCandidate, ...]
RecallResult.copy_fusion(value) -> RetrievalFusionDiagnostics
RecallResult.copy_sources(value) -> tuple[RecallSourceDiagnostic, ...]
RecallResult.copy_continuations(value) -> dict[str, str]
RecallResult.freeze_continuations(value: Mapping[str, str]) -> Mapping[str, str]
RecallResult.serialize_continuations(value: Mapping[str, str]) -> dict[str, str]
RecallResult.validate_truncated(value) -> bool
RecallResult.validate_omitted(value) -> int
RecallResult.validate_result() -> RecallResult

Release source · Runtime guarantees · Capability guides

from cayu import RecallSituation

Immutable per-boundary retrieval input; never provider-visible by itself.

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
query_resolution_version Literal['cayu.query_resolution.v2'] QUERY_RESOLUTION_VERSION
query str required
recent_conversation tuple[str, ...] ()
recent_user_context_clipped bool False
current_query_clipped bool False
work_context str | None None
knowledge_access_scope KnowledgeAccessScope | None None
knowledge_namespace str DEFAULT_KNOWLEDGE_NAMESPACE
transcript_session_ids tuple[str, ...] ()
transcript_before_indexes Mapping[str, int] Field(default_factory=dict)
continuations Mapping[str, str] Field(default_factory=dict)
knowledge_aspect_groups tuple[tuple[str, ...], ...] ()
knowledge_filter_only bool False
current_time datetime Field(default_factory=lambda: datetime.now(UTC))
RecallSituation.validate_resolution_clipping(value, info) -> bool
RecallSituation.validate_query(value: str) -> str
RecallSituation.validate_recent_conversation(value) -> tuple[str, ...]
RecallSituation.validate_work_context(value: str | None) -> str | None
RecallSituation.validate_knowledge_aspect_groups(value: object) -> tuple[tuple[str, ...], ...]
RecallSituation.validate_knowledge_filter_only(value: object) -> bool
RecallSituation.validate_knowledge_filter() -> RecallSituation
RecallSituation.copy_access_scope(value) -> KnowledgeAccessScope | None
RecallSituation.freeze_access_scope(value: KnowledgeAccessScope | None) -> KnowledgeAccessScope | None
RecallSituation.copy_transcript_before_indexes(value) -> dict[str, int]
RecallSituation.freeze_transcript_before_indexes(value: Mapping[str, int]) -> Mapping[str, int]

serialize_transcript_before_indexes (method)

Section titled “serialize_transcript_before_indexes (method)”
RecallSituation.serialize_transcript_before_indexes(value: Mapping[str, int]) -> dict[str, int]
RecallSituation.serialize_access_scope(value: KnowledgeAccessScope | None) -> dict[str, Any] | None
RecallSituation.validate_namespace(value: str) -> str
RecallSituation.validate_transcript_session_ids(value) -> tuple[str, ...]
RecallSituation.copy_continuations(value) -> dict[str, str]
RecallSituation.freeze_continuations(value: Mapping[str, str]) -> Mapping[str, str]
RecallSituation.serialize_continuations(value: Mapping[str, str]) -> dict[str, str]
RecallSituation.validate_current_time(value: datetime) -> datetime

validate_transcript_before_index_scope (method)

Section titled “validate_transcript_before_index_scope (method)”
RecallSituation.validate_transcript_before_index_scope() -> RecallSituation
RecallSituation.query_resolution() -> dict[str, Any]

Bounded evidence of whether a current question needs an antecedent.

Only the most recent caller-supplied user turn (or explicit work context) may resolve a follow-up. Assistant prose never supplies search terms. Unknown discourse forms conservatively remain current-query-only.

RecallSituation.retrieval_text() -> str
RecallSituation.fingerprint() -> str
RecallSituation.model_copy(*, update: Mapping[str, Any] | None=None, deep: bool=False) -> Self

Release source · Runtime guarantees · Capability guides

from cayu.memory import RecallSource

Trusted read-only extension that returns bounded independently ranked lanes.

Bases: ABC.

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
name str required
channel_names tuple[str, ...] required
continuation_channels tuple[str, ...] ()
RecallSource.__init__(*, required: bool, candidate_limit: int) -> None
async RecallSource.retrieve(situation: RecallSituation) -> RecallSourceResult

Return source-owned channels after hard source filtering.

Release source · Runtime guarantees · Capability guides

from cayu import RecallSourceDiagnostic

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
source str required
required bool required
status RecallSourceStatus required
channels tuple[str, ...] required
failure_code str | None None
RecallSourceDiagnostic.validate_source(value: str) -> str
RecallSourceDiagnostic.validate_required(value) -> bool
RecallSourceDiagnostic.validate_channels(value) -> tuple[str, ...]
RecallSourceDiagnostic.validate_failure_code(value: str | None) -> str | None
RecallSourceDiagnostic.validate_status() -> RecallSourceDiagnostic

Release source · Runtime guarantees · Capability guides

from cayu.memory import RecallSourceResult

Validated source output before cross-source fusion.

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
source str required
channels tuple[RankedRetrievalChannel, ...] required
records tuple[RecallRecord, ...] required
coverage_complete bool required
partial_reason str | None None
RecallSourceResult.validate_source(value: str) -> str
RecallSourceResult.copy_channels(value) -> tuple[RankedRetrievalChannel, ...]
RecallSourceResult.copy_records(value) -> tuple[RecallRecord, ...]
RecallSourceResult.validate_coverage_complete(value) -> bool
RecallSourceResult.validate_partial_reason(value: str | None) -> str | None
RecallSourceResult.validate_source_result() -> RecallSourceResult

Release source · Runtime guarantees · Capability guides

from cayu.memory import RecallSourceStatus

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
COMPLETE class attribute 'complete'
PARTIAL class attribute 'partial'
UNAVAILABLE class attribute 'unavailable'

Release source · Runtime guarantees · Capability guides

from cayu.memory import RecallSourceUnavailable

A required source could not produce an access-safe bounded result.

Bases: RuntimeError.

RecallSourceUnavailable.__init__(source: str, code: str) -> None

Release source · Runtime guarantees · Capability guides

from cayu.memory import TRANSCRIPT_LEXICAL_CHANNEL
TRANSCRIPT_LEXICAL_CHANNEL = 'transcript.lexical'

Release source · Runtime guarantees · Capability guides

from cayu.memory import TranscriptRecallSource

Authoritative transcript narrative lane over explicit session scope.

Bases: RecallSource.

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
name class attribute 'transcript'
channel_names class attribute (TRANSCRIPT_LEXICAL_CHANNEL,)
continuation_channels class attribute (TRANSCRIPT_LEXICAL_CHANNEL,)
TranscriptRecallSource.__init__(store: SessionStore, *, required: bool=False, candidate_limit: int=20, max_bytes: int=64000, max_records_scanned: int=10000) -> None
async TranscriptRecallSource.retrieve(situation: RecallSituation) -> RecallSourceResult
TranscriptRecallSource.supports_store(store: object) -> bool

Return whether a store exposes the bounded transcript-search contract.

Release source · Runtime guarantees · Capability guides