Skip to content

API Reference parrot.memory.compaction.recover

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot.memory.compaction.recover

View source

read_omitted_content recovery tool for per-turn conversation compaction (FEAT-525).

Recovers omitted bytes through one plain async function bound to a :class:~parrot.memory.abstract.ConversationMemory, registered on the bot's ToolManager exactly like the search_tools meta-tool (the bot-side registration happens in AbstractBot._register_recovery_tool, TASK-2830). The function resolves its session key from three ContextVars and fails closed on any None — it never touches the store unless the full scope is known.

Leaf-module rule: this module imports :mod:parrot.observability.context and :mod:parrot.memory.* only — never :mod:parrot.tools (registration is the bot's job).

Alias ConversationMemory

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

Alias EXPIRED_MESSAGE

Re-exported from parrot.memory.compaction.omission.EXPIRED_MESSAGE.

Attribute NO_ARGS_MESSAGE

Type: str

Attribute READ_OMITTED_CONTENT_DESCRIPTION

Type: str

Attribute READ_OMITTED_CONTENT_NAME

Type: str

Attribute READ_OMITTED_CONTENT_SCHEMA

Type: Dict[str, Any]

Attribute UNAVAILABLE_MESSAGE

Type: str

Function bind_read_omitted_content

Bind a read_omitted_content function to a specific memory backend.

bind_read_omitted_content(memory: ConversationMemory) -> Callable[..., Awaitable[str]]

Parameter Type Default Description
memory ConversationMemory The :class:ConversationMemory whose omission store and omission_key scoping this function will use.

Returns: Callable[..., Awaitable[str]] — An async def read_omitted_content(content_id=None, turn_id=None) -> str closure, named and documented for ToolManager.register_tool.

Alias current_memory_key_id

Re-exported from parrot.observability.context.current_memory_key_id.

Alias current_session_id

Re-exported from parrot.observability.context.current_session_id.

Alias current_user_id

Re-exported from parrot.observability.context.current_user_id.

Attribute logger

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