Skip to content

API Reference parrot.storage.hydration

github-actions[bot] edited this page Dec 2, 2026 · 1 revision

parrot.storage.hydration

View source

HydrationSource over a ConversationBackend (FEAT-886 M14).

A pure translation layer: backend (storage) errors become hydration errors, stored rows become ConversationTurn through the tolerant reader. It never converts a failure, a deleted session or an unready index into None / [].

Class ChatStorageHydrationSource

Hydration source backed by the ChatStorage cold tier.

Parameter Type Default Description
backend ConversationBackend The initialised cold-tier backend (the same one ChatStorage writes to).

Method ChatStorageHydrationSource.load_turns

Newest max_turns turns, ascending; None when the session has none.

load_turns(agent_name: str, user_id: str, session_id: str, max_turns: int) -> Optional[List[ConversationTurn]]

Parameter Type Default Description
agent_name str
user_id str
session_id str
max_turns int

Returns: Optional[List[ConversationTurn]]

Raises:

  • ValueError — max_turns < 1.
  • HydrationNotReadyError — the chronological index is not ready.
  • SessionDeletedError — the session is tombstoned.
  • HydrationUnavailableError — the backend failed or a row could not be read.

Method ChatStorageHydrationSource.is_deleted

Authoritative deletion guard. Raises HydrationUnavailableError if it cannot be determined.

is_deleted(agent_name: str, user_id: str, session_id: str) -> bool

Parameter Type Default Description
agent_name str
user_id str
session_id str

Returns: bool

Method ChatStorageHydrationSource.max_sequence

Durable maximum sequence for allocator recovery (0 when none).

max_sequence(agent_name: str, user_id: str, session_id: str) -> int

Parameter Type Default Description
agent_name str
user_id str
session_id str

Returns: int

Alias ChatStorageTurn

Re-exported from parrot.storage.models.ChatStorageTurn.

Alias ConversationBackend

Re-exported from parrot.storage.backends.base.ConversationBackend.

Alias ConversationDeletedError

Re-exported from parrot.storage.errors.ConversationDeletedError.

Alias ConversationTurn

Re-exported from parrot.memory.abstract.ConversationTurn.

Alias HydrationNotReadyError

Re-exported from parrot.memory.hydration.HydrationNotReadyError.

Alias HydrationSource

Re-exported from parrot.memory.hydration.HydrationSource.

Alias HydrationUnavailableError

Re-exported from parrot.memory.hydration.HydrationUnavailableError.

Alias IndexNotReadyError

Re-exported from parrot.storage.errors.IndexNotReadyError.

Alias SessionDeletedError

Re-exported from parrot.memory.hydration.SessionDeletedError.

Alias StorageError

Re-exported from parrot.storage.errors.StorageError.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally