Skip to content

API Reference parrot.stores.parents.factory

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

parrot.stores.parents.factory

View source

Factory for creating AbstractParentSearcher instances from a config dict.

This module resolves a JSONB parent_searcher_config dict (as stored in navigator.ai_bots) into a concrete AbstractParentSearcher instance. An empty dict means "no parent searcher" and returns None. Unknown type values raise ConfigError immediately (fail-loud, FEAT-133 G5).

The factory receives the bot's already-configured store as a kwarg because InTableParentSearcher.__init__ requires the store. This means the factory MUST be called AFTER bot.configure(app) — see FEAT-133 spec §2 R1 and the sequencing note in parrot/manager/manager.py.

Usage::

from parrot.stores.parents.factory import create_parent_searcher

searcher = create_parent_searcher(
    {"type": "in_table", "expand_to_parent": True},
    store=bot.store,
)

Alias AbstractParentSearcher

Re-exported from parrot.stores.parents.abstract.AbstractParentSearcher.

Alias AbstractStore

Re-exported from parrot.stores.abstract.AbstractStore.

Alias ConfigError

Re-exported from parrot.exceptions.ConfigError.

Attribute PARENT_SEARCHER_TYPES

Type: dict[str, Callable[[dict, Optional['AbstractStore']], AbstractParentSearcher]]

Function create_parent_searcher

Instantiate a parent searcher from a config dict.

create_parent_searcher(config: dict, *, store: Optional['AbstractStore']) -> Optional[AbstractParentSearcher]

Parameter Type Default Description
config dict Parent searcher config (from navigator.ai_bots.parent_searcher_config). Empty dict returns None.
store Optional['AbstractStore'] The bot's already-configured store; required for type=in_table because InTableParentSearcher queries the same table where chunks live. Pass None only if you are certain no store-dependent type is used (empty config).

Returns: Optional[AbstractParentSearcher] — The parent searcher instance, or None if config is empty.

Raises:

  • ConfigError — If config['type'] is missing or unknown, or store is None when required by the chosen type.

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