Node

A node in the knowledge graph.

Usage

Source

Node()

Parameters

id: str

Unique identifier for the node.

node_type: NodeType

The type of node (document, entity, or topic).

name: str

Human-readable name or title.

content: str = ""

Full text content (for documents) or description.

metadata: dict[str, Any] = dict()

Arbitrary key-value metadata.

embedding: list[float] | None = None

Optional vector embedding as a list of floats.

created_at: float = 0.0

Unix timestamp of creation.

updated_at: float = 0.0
Unix timestamp of last update.

Examples

import talk_box as tb

node = tb.Node(
    id="doc-001",
    node_type=tb.NodeType.DOCUMENT,
    name="README.md",
    content="# My Project...",
)
node.name  # "README.md"