Skip to content

API Reference parrot.userstore.settings

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

parrot.userstore.settings

View source

User store backend selection and Redis client primitives.

Attribute CREW_RESULT_SWITCH

Type: str

Attribute DEFAULT_BACKEND

Type: StoreBackend

Attribute GLOBAL_SWITCH

Type: str

Attribute SWITCHES

Type: dict[str, StoreSwitch]

Attribute StoreBackend

Class StoreSwitch

One per-store switch, its collections, and its allowed backend values.

Parameter Type Default Description
name str
collections tuple[str, ...]
allowed frozenset[str]

Fields:

Field Type Default Description
name str
collections tuple[str, ...]
allowed frozenset[str]

Class UserStoreMisconfigured

A user-store backend setting is invalid or would silently switch DocumentDB to Redis.

Function close_user_store_redis

Close and forget the Redis client associated with the current event loop.

close_user_store_redis() -> None

Function default_result_storage

Return the global result backend, or Redis when no global backend is configured.

default_result_storage() -> Literal['redis', 'documentdb']

Returns: Literal['redis', 'documentdb']

Function documentdb_configured

Return whether either DocumentDB configuration value is set.

documentdb_configured() -> bool

Returns: bool

Function get_user_store_redis

Return the lazy, response-decoding Redis client for the current event loop.

get_user_store_redis() -> aioredis.Redis

Returns: aioredis.Redis

Function implicit_redis_stores

Return stores which resolve to Redis solely because their settings are unset.

implicit_redis_stores() -> list[str]

Returns: list[str]

Function key_prefix

Return the user-store key prefix without a trailing colon.

key_prefix() -> str

Returns: str

Attribute logger

Function redis_url

Return the explicit Redis URL or the user-store database-six URL.

redis_url() -> str

Returns: str

Function resolve_store_backend

Resolve a store's backend from its switch, the global switch, then the Redis default.

resolve_store_backend(switch: str) -> StoreBackend

Parameter Type Default Description
switch str Name of a switch in :data:SWITCHES.

Returns: StoreBackend

Raises:

  • KeyError — If switch is unknown.
  • UserStoreMisconfigured — If a configured value is not allowed.

Function store_backend_source

Return which configuration level decides resolve_store_backend(switch).

store_backend_source(switch: str) -> Literal['switch', 'global', 'default']

Parameter Type Default Description
switch str

Returns: Literal['switch', 'global', 'default']

Function validate_user_store_settings

Resolve all switches and reject implicit Redis defaults on a DocumentDB installation.

validate_user_store_settings() -> dict[str, StoreBackend]

Returns: dict[str, StoreBackend]

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