Skip to content

API Reference parrot_tools.multistoresearch.origins.bookstore

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

parrot_tools.multistoresearch.origins.bookstore

View source

Stage-1 Bookstore origin returning revision-pinned single-segment evidence (FEAT-858).

BookstoreOrigin runs only the Bookstore stage-1 search (catalog shortlist plus per-book LLM tree-walk or BM25) and bounded per-node segment reads. Every emitted hit is ONE segment's exact text, clipped to the per-node excerpt_chars allowance and verified against the immutable document revision the read returned. It never runs the agentic reading loop.

Per-request diagnostics (skipped legacy books, stale or missing revisions, invalid excerpts, failed reads) are kept in local variables of one collector call and surfaced through :meth:BookstoreOrigin.search_section — never in mutable instance state, so concurrent requests cannot leak notes into each other.

Class BookstoreOrigin

Bounded stage-1 Bookstore search with immutable citation metadata.

Parameter Type Default Description
bookstore Bookstore The :class:~parrot.knowledge.bookstore.library.Bookstore facade.
scope Optional[str] None Optional scope filter ("project" or "global").
book_ids Optional[list[str]] None Optional explicit book filter; unknown ids raise at search time.
max_books int 3 Books searched per request (1..10).
top_k int 5 Candidate nodes per book (1..50).
excerpt_chars int 600 Per-node excerpt allowance in characters (positive).
name str 'bookstore' Adapter name. Defaults to "bookstore".
description Optional[str] None LLM-readable explanation of this origin.
timeout Optional[float] None Optional positive finite timeout in seconds for direct search calls and the per-origin toolkit timeout.

Method BookstoreOrigin.search

Return at most k evidence hits in stable native order.

search(query: str, k: int) -> list[OriginHit]

Parameter Type Default Description
query str The search query text.
k int Maximum number of hits to return; k <= 0 returns [] without searching.

Returns: list[OriginHit] — Verified single-segment hits ranked 1..N.

Raises:

  • TimeoutError — When the configured timeout elapses (child reads are cancelled).

Method BookstoreOrigin.search_section

Return hits and request-local skip counts; backend failures still raise.

The enclosing toolkit applies its per-origin timeout around this call.

search_section(query: str, k: int) -> OriginSection

Parameter Type Default Description
query str The search query text.
k int Maximum number of hits to return.

Returns: OriginSection — A successful section whose note counts skipped evidence, if any.

Alias SearchOrigin

Re-exported from parrot_tools.multistoresearch.origins.base.SearchOrigin.

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