Squirro Item Retriever Tool#

The Squirro Item Retriever tool is designed to fetch and process individual documents (Squirro items) from the Squirro content repository. That tool specializes in loading complete documents, generating summaries when needed, and managing document content within LLM context constraints. It provides flexible document processing through configurable sampling methods, optimization modes, and summarization capabilities.

Squirro Item Retriever serves as the foundation for document loading in the Chat with Document agent.

Configuration Settings#

Squirro Item Retriever offers configuration parameters that control document processing, sampling, summarization, and optimization behavior.

Summarization Prompt#

The Summarization Prompt parameter defines the instruction template used when generating document summaries. This prompt guides the LLM in how to analyze and condense document content. When summarization is necessary, the system automatically incorporates that prompt during the summarization process.

By customizing that setting, administrators can tailor the summarization approach to specific document types, domains, or industries. For example, financial documents might use prompts that emphasize numerical accuracy and key metrics, while legal documents might focus on clauses and obligations.

Sampling Method#

The Sampling Method parameter determines how pages are selected when a document exceeds the configured page limit. Different sampling methods provide different trade-offs between coverage, determinism, and computational efficiency.

Available methods:

  • random

    That method selects pages using an algorithm that ensures truly random selection without bias. Each page has an equal probability of being chosen, and the process is non-deterministic, producing different results each time. It is useful when unbiased sampling is desired but reproducibility is not required.

  • systematic

    That method selects pages at regular intervals throughout the document, ensuring evenly distributed coverage in a deterministic manner. It produces the same result each time, making it ideal for documents where information is distributed uniformly.

  • quadratic

    That method uses a quadratic probability distribution to select pages. It creates a parabola-shaped distribution, where pages near the beginning and end of the document have a higher probability of selection. The pages in the middle retain a lower probability but still have a chance of being included. The method incorporates a base weight to ensure middle pages are not entirely overlooked. It employs weighted random sampling without replacement, achieving balanced and representative document coverage. It is the recommended method for general use.

  • disabled

    That method does not use sampling. Instead, it selects the first N pages from the beginning of the document, where N equals the page limit. It is particularly useful when preserving sequential reading from the start of the document is important. As the fastest method, it requires no additional computation and is well-suited for documents where the most relevant content appears early.

Generate New Summary#

The Generate New Summary parameter forces the system to create a new summary regardless of whether a cached summary exists. When turned on, that setting ensures a fresh summary is generated each time the tool runs.

Activating that feature impacts cost, as it systematically bypasses the cache and generates new summaries for every request.

Maximum Number of Words#

The Maximum Number of Words parameter sets the threshold that determines whether summarization occurs when optimization mode is set to performance. If a document contains fewer words than that threshold, the system skips summarization and returns the full content directly. If a document exceeds that word count, the system generates a summary instead.

That threshold serves as the decision point between documents that are small enough to process directly and those large enough to benefit from summarization. The value balances between avoiding unnecessary summarization for short documents and ensuring long documents are compressed to fit within the context limits.

Persona Instruction#

The Persona Instruction parameter defines the role of AI and identity during document summarization. That parameter acts as a variable automatically inserted into the summarization prompt template when generating summaries. It influences what information the AI emphasizes, what terminology it uses, and how it structures the summary to align with expectations of the specified domain. By customizing that setting, administrators can adjust the approach to match the expertise level and domain knowledge appropriate for their specific use case.

Examples:

  • “You are a financial analyst specializing in quarterly earnings reports.”

  • “You are a legal expert reviewing contract agreements.”

  • “You are a medical professional summarizing clinical research.”

  • “You are a technical writer creating documentation summaries.”

Assistant Language Instruction#

The Assistant Language Instruction parameter defines language requirements for AI-generated summaries. That value is automatically incorporated into the summarization prompt template to control whether summaries should match the source document language or follow specific translation rules. That setting is particularly valuable in multilingual environments where standardization or language-specific processing is required.

Examples:

  • “Maintain the same language as the source document.”

  • “Translate all summaries to English.”

  • “Provide summaries in both the original language and English.”

  • “Use German for all summaries regardless of source language.”

Optimization Mode#

The Optimization Mode parameter functions as a switch that fundamentally alters how the tool processes and returns documents. That setting determines the trade-off between accuracy and efficiency.

  • accuracy

    The accuracy mode returns the actual page content as a representative sample of pages, up to the configured Page Limit. That mode preserves all original details, including numbers, tables, and citations, and allows the agent to cite exact page numbers.

  • performance

    The performance mode returns a cached summary of the entire document. That mode is faster and uses less context window space, but compresses information through summarization. Cached summaries can be reused across multiple conversations, reducing token costs.

Save Summary#

The Save Summary parameter controls whether generated summaries are stored in the Squirro item metadata for future reuse. When an LLM produces a summary, turning on that setting causes the summary text to be saved in the Squirro database as metadata. That allows subsequent requests to access the cached summary directly, avoiding repeated summarization and reducing token costs.

Page Limit#

The Page Limit parameter specifies the maximum number of pages retrieved and loaded from a document when using accuracy mode. That setting has no effect in performance mode, which returns a summary of the entire document regardless of length.

  • If a document contains a number of pages equal to or fewer than the Page Limit value, the tool returns all pages in full.

  • If a document exceeds the Page Limit value, the tool uses a sampling method to select a representative subset of pages.

When the Page Limit parameter is not explicitly set, its value is automatically calculated based on the available LLM context length. It ensures the document content fits within the model constraints. Higher page limits offer more comprehensive document coverage but consume more tokens and context window space. Lower limits enhance performance and reduce costs but may overlook important content in longer documents.