Skip to content

API Reference parrot.knowledge.wiki.glossary.bank

github-actions[bot] edited this page Dec 2, 2026 · 1 revision

parrot.knowledge.wiki.glossary.bank

View source

Compiled alias-bank file helpers (FEAT-917). Standard library only: runs in the prompt hook.

Attribute BANK_NAME

Attribute BANK_SCHEMA_VERSION

Function find_repo_plane_dir

Return the repository glossary plane when it contains a bank.

The upward walk mirrors project.find_shared_root while remaining independent of that heavier module. All filesystem failures are treated as a missing plane.

find_repo_plane_dir(start: Path | None = None) -> Path | None

Parameter Type Default Description
start Path | None None Directory from which to search, defaulting to the current working directory.

Returns: Path | None — The resolved <shared root>/.parrot/glossary path, or None.

Function load_bank

Read bank.json as a plain dict.

load_bank(plane_dir: Path) -> dict[str, Any] | None

Parameter Type Default Description
plane_dir Path Directory containing the compiled bank.

Returns: dict[str, Any] | None — The decoded bank, or None when it is missing, unreadable, or has an unsupported shape or schema version.

Attribute logger

Function merge_banks

Merge banks given highest precedence first.

Names and aliases are compared after :func:normalize_text. Name and alias claims take effect between banks, not between entries in one bank, so multiple senses of the same name in one layer remain intact.

merge_banks(banks: Sequence[Mapping[str, Any]]) -> dict[str, Any]

Parameter Type Default Description
banks Sequence[Mapping[str, Any]] Compiled banks ordered from highest to lowest precedence.

Returns: dict[str, Any] — A new merged bank without mutating any input mapping.

Alias normalize_text

Re-exported from parrot.knowledge.wiki.glossary.matcher.normalize_text.

Function write_bank

Atomically write bank to plane_dir/bank.json.

write_bank(plane_dir: Path, bank: Mapping[str, Any]) -> Path

Parameter Type Default Description
plane_dir Path Existing directory that owns the compiled bank.
bank Mapping[str, Any] JSON-serializable bank mapping.

Returns: Path — The final bank 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