Skip to content

API Reference parrot.knowledge.pageindex.ingest

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

parrot.knowledge.pageindex.ingest

View source

Two-Step Chain-of-Thought ingestion: raw content -> clean markdown.

Step 1 (lightweight model): an open-ended Chain-of-Thought analysis of the content, returned as prose. Step 2 (heavy model): structured markdown generation grounded on the Step-1 analysis and the original content.

The resulting :class:IngestedMarkdown can then be fed to :func:parrot.knowledge.pageindex.md_builder.md_to_tree to produce a subtree ready for :func:parrot.knowledge.pageindex.tree_ops.splice_subtree.

Alias INGEST_STEP1_SYSTEM

Re-exported from parrot.knowledge.pageindex.prompts.INGEST_STEP1_SYSTEM.

Alias INGEST_STEP1_USER

Re-exported from parrot.knowledge.pageindex.prompts.INGEST_STEP1_USER.

Alias INGEST_STEP2_SYSTEM

Re-exported from parrot.knowledge.pageindex.prompts.INGEST_STEP2_SYSTEM.

Alias INGEST_STEP2_USER

Re-exported from parrot.knowledge.pageindex.prompts.INGEST_STEP2_USER.

Class IngestedMarkdown

Structured output of the Step-2 markdown generator.

Fields:

Field Type Default Description
title str H1 title of the generated document
summary str One or two sentence summary
markdown str Well-formed markdown body

Alias PageIndexLLMAdapter

Re-exported from parrot.knowledge.pageindex.llm_adapter.PageIndexLLMAdapter.

Class TwoStepIngester

Drive the two-step ingest pipeline against an LLM adapter.

Parameter Type Default Description
adapter PageIndexLLMAdapter The "heavy" adapter used for Step 2 (markdown generation).
lightweight_adapter Optional[PageIndexLLMAdapter] None Optional dedicated adapter for Step 1. When provided, Step 1 runs against this adapter (typically wrapping the same client but pinned to a smaller model). When omitted, adapter is used for both steps.

Method TwoStepIngester.ingest

Run both steps and return the structured markdown.

ingest(content: str, hint: Optional[str] = None) -> IngestedMarkdown

Parameter Type Default Description
content str
hint Optional[str] None

Returns: IngestedMarkdown

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