Skip to content

API Reference parrot.knowledge.wiki.runtime

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

parrot.knowledge.wiki.runtime

View source

Public, click-free builders for the supervised wiki-ingest service stack.

The builders are kept separate from command-line concerns so async servers can construct the charter triage and ingest services without importing CLI code or starting a nested event loop.

Class WikiRuntimeError

An LLM client or the supervised-ingest runtime could not be constructed.

Function build_ingest_runtime

Build the supervised-ingestion service bindings for one wiki.

build_ingest_runtime(root: Path, config: WikiProjectConfig, store: BaseWikiStore, sources: SourceCollectionManager, charter: 'Charter', charter_path: Path, *, lightweight_model: str, model: str, novelty_scorer: Any, adapters: tuple[Any, Any, str, bool] | None = None, fetch_timeout: float = 30.0) -> 'InboxRuntime'

Parameter Type Default Description
root Path Wiki project root.
config WikiProjectConfig Resolved project configuration.
store BaseWikiStore Open retrieval-plane store.
sources SourceCollectionManager Source manifest manager matching store.
charter 'Charter' Parsed editorial charter.
charter_path Path Source path for charter.
lightweight_model str Stage-1 model spec recorded in the runtime.
model str Stage-2 model spec.
novelty_scorer Any Prebuilt scorer from build_novelty_scorer.
adapters tuple[Any, Any, str, bool] | None None Prebuilt adapter tuple; built here when None.
fetch_timeout float 30.0 URL acquisition timeout in seconds.

Returns: 'InboxRuntime' — The InboxRuntime consumed by the inbox processor.

Raises:

  • WikiRuntimeError — If adapters cannot be constructed.

Function build_novelty_scorer

Construct a grounding-backed or search-proxy novelty scorer.

build_novelty_scorer(root: Path, config: WikiProjectConfig, store: BaseWikiStore) -> Any

Parameter Type Default Description
root Path Wiki project root.
config WikiProjectConfig The project's WikiProjectConfig.
store BaseWikiStore The open retrieval-plane store (search-proxy fallback).

Returns: Any — A configured NoveltyScorer.

Function build_triage_adapters

Construct the lightweight/heavy PageIndexLLMAdapter pair.

build_triage_adapters(lightweight_model: str, model: str) -> tuple[Any, Any, str, bool]

Parameter Type Default Description
lightweight_model str Stage-1 triage model spec (provider:model).
model str Stage-2 model spec, also used for page generation.

Returns: tuple[Any, Any, str, bool] — (lightweight_adapter, heavy_adapter, lightweight_model_id, same_provider).

Function persistence_for_project

Build the graph persistence for a wiki project through the backend registry.

A registered backend that declares project_options ("module:callable" taking (config, root, tenant_id) and returning factory options) is used when it matches config.backend; every other project (sqlite, memory, or a backend without a project mapping) uses the SQLite graph plane at config.graph_path(root).

persistence_for_project(config: WikiProjectConfig, root: Path, *, tenant_id: str | None = None) -> 'GraphPersistence'

Parameter Type Default Description
config WikiProjectConfig Project configuration.
root Path Project root directory.
tenant_id str | None None Tenant identifier forwarded to project_options; defaults to the wiki name.

Returns: 'GraphPersistence' — The constructed graph persistence.

Raises:

  • ValueError — When project_options is not a valid "module:callable" path.

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