Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/jxnl/kura/llms.txt

Use this file to discover all available pages before exploring further.

Cluster

Represents a cluster of related conversations with metadata and hierarchy information.
id
str
required
Unique identifier for the cluster. Auto-generated using uuid.uuid4().hex if not provided
name
str
required
Short, imperative sentence describing the cluster (at most ten words)
description
str
required
Detailed description of what conversations in this cluster are about
slug
str
required
Three-word snake_case summary of the cluster topic (e.g., “code_debugging_help”)
chat_ids
list[str]
required
List of conversation IDs belonging to this cluster
parent_id
Union[str, None]
required
ID of the parent cluster in the hierarchy, or None for top-level clusters

Computed Fields

count
int
Number of conversations in this cluster. Computed from len(chat_ids)

Methods

__str__()

Returns a formatted string representation of the cluster.
def __str__(self) -> str:
    return f"Name: {self.name}\nDescription: {self.description}"

Example

from kura.types import Cluster

cluster = Cluster(
    id="abc123",
    name="Debug Python exceptions",
    description="Users asking for help understanding and fixing Python exceptions like TypeError and ValueError.",
    slug="python_exception_debugging",
    chat_ids=["chat-1", "chat-2", "chat-3"],
    parent_id="parent-cluster-xyz"
)

print(cluster.count)  # 3
print(cluster)
# Name: Debug Python exceptions
# Description: Users asking for help understanding and fixing Python exceptions...

GeneratedCluster

LLM-generated cluster metadata without IDs or relationships. Used during cluster generation.
name
str
required
A short, imperative sentence (at most ten words) that captures the user’s request and distinguishes this cluster from others. Should be specific but reflective of most statements in the group. Examples: ‘Brainstorm ideas for a birthday party’ or ‘Generate blog spam for gambling websites’
summary
str
required
A clear, precise, two-sentence description in past tense that captures the essence of the clustered statements and distinguishes them from contrastive examples. Should be specific to this group without including PII or proper nouns
slug
str
required
A three-word snake_case summary of what this cluster is about. Examples: ‘birthday_party_planning’, ‘gambling_content_generation’, ‘code_debugging_help’

Example

from kura.types import GeneratedCluster

generated = GeneratedCluster(
    name="Explain React hooks usage",
    summary="Users requested explanations of React hooks like useState and useEffect. They wanted practical examples and best practices for state management.",
    slug="react_hooks_explanation"
)

ClusterTreeNode

Represents a node in the cluster hierarchy tree for visualization.
id
str
required
Unique identifier for the cluster
name
str
required
Cluster name
description
str
required
Cluster description
slug
str
required
Three-word snake_case summary
count
int
required
Number of conversations in the cluster
children
list[str]
required
List of child cluster IDs in the hierarchy

Example

from kura.types import ClusterTreeNode

node = ClusterTreeNode(
    id="cluster-abc",
    name="Programming help",
    description="Users seeking programming assistance",
    slug="programming_assistance",
    count=150,
    children=["cluster-xyz", "cluster-def"]
)

Build docs developers (and LLMs) love