Skip to content

API Reference parrot_tools.multistoresearch.origins.graphindex

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

parrot_tools.multistoresearch.origins.graphindex

View source

GraphIndexOrigin — 4-phase graph retrieval adapter (FEAT-379).

Wraps :class:~parrot.knowledge.graphindex.retriever.GraphExpandedRetriever (seed → expand → community annotation → assembly). Optionally configured with a :class:~parrot.knowledge.graphindex.sqlite_reader.SQLiteGraphReader to enable a full-text-search leg via search_symbols (FTS5/BM25 over title + summary) — supports_fts is True only when a reader is provided; without one this origin is search-only.

Class GraphIndexOrigin

Adapter wrapping the GraphIndex 4-phase retrieval pipeline.

Parameter Type Default Description
retriever 'GraphExpandedRetriever' A :class:GraphExpandedRetriever instance driving the seed → expand → community-annotation → assembly pipeline.
reader Optional['SQLiteGraphReader'] None Optional :class:SQLiteGraphReader instance. When provided, enables the FTS leg via fts_search (delegates to search_symbols); supports_fts reflects its presence.
name str 'graphindex' Adapter name. Defaults to "graphindex".
description Optional[str] None LLM-readable explanation of this origin. Defaults to a description of graph-expanded retrieval + community context.
timeout Optional[float] None Optional per-adapter timeout override in seconds.
seed_top_k int 10 Default number of seed nodes for Phase 1 seed search, forwarded to GraphExpandedRetriever.search unless overridden per call via k.

Method GraphIndexOrigin.search

Run the 4-phase graph retrieval pipeline and flatten its result.

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

Parameter Type Default Description
query str The search query text.
k int Number of seed nodes for Phase 1 (forwarded as seed_top_k); the final node list length depends on expansion + budget assembly, not solely on k.

Returns: List[OriginHit] — Normalized hits, in the same best-first order as GraphRetrievalResult.nodes (sorted by combined_score descending).

Method GraphIndexOrigin.fts_search

Run the configured reader's search_symbols FTS5/BM25 search.

fts_search(query: str, k: int) -> List[OriginHit]

Parameter Type Default Description
query str FTS5 MATCH expression.
k int Maximum number of hits to return.

Returns: List[OriginHit] — Normalized hits preserving the reader's best-first order. OriginHit.score carries the raw FTS5 BM25 score, which is negative (ascending = best match) — NOT normalized to a positive scale; see metadata["score_convention"].

Raises:

  • NotImplementedError — When no reader was configured (supports_fts is False).

Alias SearchOrigin

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

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