Skip to content

API Reference parrot_tools.navigator.prompt

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

parrot_tools.navigator.prompt

View source

Navigator context provider using PageIndex (vectorless, LLM-driven RAG).

Replaces the previous LocalKB + FAISS approach with PageIndex tree-search:

  • Layer 1: tree_context (node summaries) injected into CONFIGURE phase prompt
  • Layer 2: retriever.retrieve(query) for on-demand detailed context per request
  • Layer 3: get_widget_schema() tool for exact DB lookups (unchanged)

PageIndex advantages over embedding-based RAG:

  • No FAISS/vector DB required
  • LLM reasons over document structure (hierarchy-aware)
  • Works with any LLM (uses gemini-flash-lite by default)
  • Transparent: thinking field explains retrieval decisions
  • Markdown headers map naturally to tree nodes

Attribute KB_DIR

Attribute NAVIGATOR_OPERATIONS_LAYER

Class NavigatorPageIndex

Manages the PageIndex tree for Navigator knowledge base.

Indexes all markdown files in agents/navigator/kb/ into a single hierarchical tree. Provides:

  • tree_context: compact node summaries for system prompt (Layer 1)
  • retrieve(query): detailed context for a specific query (Layer 2)
Parameter Type Default Description
kb_dir Path KB_DIR
cache_file Path TREE_CACHE_FILE

Attributes:

Attribute Type Description
is_built bool

Method NavigatorPageIndex.build

Build or load the PageIndex tree from KB markdown files.

build(adapter: PageIndexLLMAdapter) -> None

Parameter Type Default Description
adapter PageIndexLLMAdapter

Method NavigatorPageIndex.get_tree_context

Get compact tree context for system prompt (Layer 1).

Returns formatted node IDs + titles + summaries. Typically ~2K tokens — fits in system prompt without bloat.

get_tree_context() -> str

Returns: str

Method NavigatorPageIndex.retrieve

Retrieve detailed context for a query (Layer 2).

Returns thinking (LLM reasoning) + matched content.

retrieve(query: str) -> dict[str, Any]

Parameter Type Default Description
query str

Returns: dict[str, Any]

Method NavigatorPageIndex.get_tree_json

get_tree_json() -> Optional[dict]

Returns: Optional[dict]

Attribute TREE_CACHE_FILE

Function get_navigator_layers

Return all custom Navigator prompt layers.

get_navigator_layers(page_index: NavigatorPageIndex = None) -> list[PromptLayer]

Parameter Type Default Description
page_index NavigatorPageIndex None If provided, includes a tree context layer with pre-resolved node summaries from the PageIndex.

Returns: list[PromptLayer]

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