Skip to content

API Reference parrot.knowledge.okf.uri

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

parrot.knowledge.okf.uri

View source

Knowledge URI scheme — unified cross-index addressing (FEAT-239).

Provides a shared knowledge:// URI scheme for referencing nodes across PageIndex and GraphIndex without using ArangoDB-specific keys or PageIndex tree paths directly.

Legacy pageindex:// URIs are also parsed for backward compatibility. No migration of existing documents is performed in this FEAT.

Design notes:

  • Pure functions, no I/O, no external dependencies.
  • parse_uri() is the inverse of build_uri() for knowledge:// URIs.
  • Legacy pageindex:// URIs keep the full tree/node as identifier — callers are responsible for further parsing.

Function build_uri

Build a knowledge:// URI for cross-index addressing.

build_uri(index_type: str, identifier: str) -> str

Parameter Type Default Description
index_type str Index namespace, e.g. "graphindex" or "pageindex".
identifier str Node identifier within the index. May contain slashes.

Returns: str — URI string of the form knowledge://<index_type>/<identifier>.

Raises:

  • ValueError — If index_type or identifier is empty.

Function parse_uri

Parse a knowledge:// or legacy pageindex:// URI.

Returns a (index_type, identifier) tuple:

  • For knowledge:// URIs: index_type is the first path segment; identifier is everything after the first /.
  • For pageindex:// URIs: index_type = "pageindex"; identifier is the entire path (tree/node).

parse_uri(uri: str) -> tuple[str, str]

Parameter Type Default Description
uri str URI string to parse.

Returns: tuple[str, str] — Tuple of (index_type, identifier).

Raises:

  • ValueError — If the URI has no scheme, a malformed path, or an unrecognised scheme.

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