@squidcloud/client
    Preparing search index...

    Interface ExploreKnowledgeBaseGraphRequest

    Request structure for exploring a bounded subgraph of a knowledge base's graph (visualization). By default it returns the highest-degree entities and the relationships among them; topicId, entityId and search select other entity pools, and contextMetadataFilter narrows any of them.

    interface ExploreKnowledgeBaseGraphRequest {
        contextMetadataFilter?: AiContextMetadataFilter;
        entityId?: string;
        includeTopics?: boolean;
        knowledgeBaseId: string;
        nodeLimit?: number;
        search?: string;
        topicId?: string;
    }
    Index
    contextMetadataFilter?: AiContextMetadataFilter

    Keeps only the entities mentioned by contexts matching the filter. Without entityId or search, they are ranked by how many matching contexts mention them. Filters on context-record metadata only, not on per-chunk keys.

    entityId?: string

    Centers the subgraph on one entity: the entity plus its neighbors, strongest relationships first. Ids come from KnowledgeBaseGraphNode.id and churn on rebuild; an unknown id fails with ENTITY_NOT_FOUND. Cannot be combined with topicId or search.

    includeTopics?: boolean

    Whether to attach the topic table (topics). Default true. A caller that already holds it can pass false: on a large graph the table runs to thousands of topics.

    knowledgeBaseId: string

    The id of the AiKnowledgeBase.

    nodeLimit?: number

    Hard cap on returned nodes. Default 200, at most KNOWLEDGE_BASE_GRAPH_EXPLORE_MAX_NODES.

    search?: string

    Finds entities by name: exact names and aliases first, then prefixes, then substrings, each by degree. When no name matches, returns the entities nearest in meaning instead (searchMatch: 'similar'). At most KNOWLEDGE_BASE_GRAPH_SEARCH_MAX_LENGTH characters. Cannot be combined with topicId or entityId.

    topicId?: string

    Restricts the subgraph to entities under the given topic node id — any hierarchy level; an entity matches when the topic appears anywhere in its topicPath. Unknown ids fail with TOPIC_NOT_FOUND. Ids come from KnowledgeBaseGraphTopic.id and churn on rebuild.