> ## Documentation Index
> Fetch the complete documentation index at: https://docs.prisme.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Get the agent relationship graph

> Returns the organization's published agents (up to 500) as a graph:
an `organization` node, one node per agent, tool, and category, and
the edges between them.

Two agents get a `similar` edge when their similarity reaches
`similarity_threshold`:

`similarity = 0.5 × tools_jaccard + 0.2 × tags_overlap + 0.3 × guardrails_jaccard`

where `tags_overlap` is the number of shared tags divided by the size
of the larger tag set.

The default graph (no option set) is cached for 5 minutes; a cached
response has `stats.cached: true` and `stats.cache_age_seconds`.
Setting any option, or `use_cache=false`, recomputes the graph.

Requires `ai-insights-v2:analytics` (`read`). Rate limit: 100
requests per minute.




## OpenAPI

````yaml /api-reference/ai-insights-v2/swagger.yml get /v1/graph/agents
openapi: 3.0.3
info:
  version: 1.0.0
  title: AI Insights API
  description: |
    Public REST API for the Prisme.ai AI Insights workspace - analyzed
    conversations, analysis triggering and status, evaluation criteria,
    message feedback, organization analytics, LLM consumption, memory
    analytics, and the agent relationship graph.

    **Organization scope.** Every endpoint reads and writes the data of the
    caller's organization, taken from the session (or from the org API key).
    No parameter lets a caller target another organization.

    **Permissions.** Each endpoint checks an organization IAM permission
    `ai-insights-v2:<resource>` with the action `read` or `write`
    (`manage` grants both). The resources are `conversations`, `feedback`,
    `analytics`, and `queue`; each operation states the one it requires.
    Platform admins and workspace admins are always allowed.

    **Rate limits.** Limits are counted per caller (user, or org API key)
    and per endpoint, over a sliding window. Depending on the endpoint, an
    exceeded limit returns one of two 429 bodies; both are documented on
    each operation.
  contact:
    name: Prisme.ai
    url: https://prisme.ai
servers:
  - url: https://{host}/v2/workspaces/slug:ai-insights-v2/webhooks
    description: Prisme.ai workspace webhooks
    variables:
      host:
        default: api.studio.prisme.ai
        description: API host (override for self-hosted or sandbox)
security:
  - BearerAuth: []
  - OrgApiKeyAuth: []
tags:
  - name: Insights
    description: Per-conversation analysis results and analysis status.
  - name: Agents
    description: >-
      Analysis triggering, evaluation criteria, conversations, and users of one
      agent.
  - name: Feedback
    description: Like / dislike feedback on agent messages.
  - name: Analytics
    description: Organization-wide usage, quality, latency, and adoption metrics.
  - name: Consumption
    description: LLM requests, tokens, cost, and carbon footprint, per user and over time.
  - name: Queue
    description: State of the conversation analysis queue.
  - name: Memories
    description: Analytics built from the memories users accumulate with agents.
  - name: Graph
    description: >-
      Agent relationship graph - tools, categories, delegations, similarity, and
      clusters.
paths:
  /v1/graph/agents:
    get:
      tags:
        - Graph
      summary: Get the agent relationship graph
      description: >
        Returns the organization's published agents (up to 500) as a graph:

        an `organization` node, one node per agent, tool, and category, and

        the edges between them.


        Two agents get a `similar` edge when their similarity reaches

        `similarity_threshold`:


        `similarity = 0.5 × tools_jaccard + 0.2 × tags_overlap + 0.3 ×
        guardrails_jaccard`


        where `tags_overlap` is the number of shared tags divided by the size

        of the larger tag set.


        The default graph (no option set) is cached for 5 minutes; a cached

        response has `stats.cached: true` and `stats.cache_age_seconds`.

        Setting any option, or `use_cache=false`, recomputes the graph.


        Requires `ai-insights-v2:analytics` (`read`). Rate limit: 100

        requests per minute.
      operationId: getAgentGraph
      parameters:
        - in: query
          name: include_tools
          schema:
            type: boolean
            default: true
          description: Include tool nodes and `uses` edges.
        - in: query
          name: include_categories
          schema:
            type: boolean
            default: true
          description: Include category nodes and agent-to-category edges.
        - in: query
          name: include_delegations
          schema:
            type: boolean
            default: true
          description: Include `delegates_to` edges between agents and their sub-agents.
        - in: query
          name: similarity_threshold
          schema:
            type: number
            minimum: 0
            maximum: 1
            default: 0.3
          description: Minimum similarity score for a `similar` edge.
        - in: query
          name: use_cache
          schema:
            type: boolean
            default: true
          description: Set to `false` to recompute the graph.
      responses:
        '200':
          description: Agent graph.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentGraph'
        '400':
          $ref: '#/components/responses/InvalidArguments'
        '401':
          $ref: '#/components/responses/Unauthenticated'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/TooManyRequests'
components:
  schemas:
    AgentGraph:
      type: object
      properties:
        graph:
          type: object
          properties:
            nodes:
              type: array
              items:
                $ref: '#/components/schemas/GraphNode'
            edges:
              type: array
              items:
                $ref: '#/components/schemas/GraphEdge'
        stats:
          allOf:
            - $ref: '#/components/schemas/GraphStats'
            - type: object
              properties:
                cached:
                  type: boolean
                cache_age_seconds:
                  type: integer
                  description: Only on cached responses.
        metadata:
          type: object
          properties:
            orgSlug:
              type: string
            generated_at:
              type: string
              format: date-time
              description: When the graph was computed.
            options:
              type: object
              properties:
                include_tools:
                  type: boolean
                include_categories:
                  type: boolean
                include_delegations:
                  type: boolean
                similarity_threshold:
                  type: number
    GraphNode:
      type: object
      properties:
        id:
          type: string
          description: >-
            `org_{orgSlug}`, `agent_{agent_id}`, `tool_{orgSlug}_{name}`, or
            `category_{orgSlug}_{name}`.
        type:
          type: string
          enum:
            - organization
            - agent
            - tool
            - category
        orgSlug:
          type: string
        name:
          type: string
        computed_at:
          type: string
          format: date-time
        agent_count:
          type: integer
          description: Organization and category nodes.
        stats:
          allOf:
            - $ref: '#/components/schemas/GraphStats'
          description: Organization node.
        agent_id:
          type: string
          description: Agent nodes.
        description:
          type: string
          description: Agent nodes.
        category:
          type: string
          description: Agent nodes.
        tools:
          type: array
          items:
            type: string
          description: Agent nodes.
        tools_count:
          type: integer
          description: Agent nodes.
        tags:
          type: array
          items:
            type: string
          description: Agent nodes.
        guardrails:
          type: array
          items:
            type: string
          description: Agent nodes - guardrail IDs.
        guardrail_types:
          type: array
          items:
            type: string
          description: Agent nodes.
        has_input_guardrail:
          type: boolean
          description: Agent nodes.
        has_output_guardrail:
          type: boolean
          description: Agent nodes.
        has_action_guardrail:
          type: boolean
          description: Agent nodes.
        analyzed_conversations:
          type: integer
          description: Agent nodes - analyzed conversations.
        avg_score:
          type: number
          description: Agent nodes - average evaluation score (0-100).
        resolved_count:
          type: integer
          description: Agent nodes - resolved conversations.
        tool_type:
          type: string
          description: Tool nodes.
        usage_count:
          type: integer
          description: Tool nodes - number of agents using the tool.
    GraphEdge:
      type: object
      properties:
        id:
          type: string
        orgSlug:
          type: string
        source:
          type: string
        target:
          type: string
        type:
          type: string
          enum:
            - belongs_to
            - uses
            - delegates_to
            - similar
          description: |
            `belongs_to` links the organization to an agent, or an agent to its
            category; `uses` an agent to a tool; `delegates_to` an agent to a
            sub-agent; `similar` two similar agents.
        sub_agent_name:
          type: string
          description: '`delegates_to` edges.'
        score:
          type: number
          description: Similarity score (0-1), `similar` edges.
        shared_tools:
          type: array
          items:
            type: string
          description: '`similar` edges.'
        shared_tags:
          type: array
          items:
            type: string
          description: '`similar` edges.'
        shared_guardrails:
          type: array
          items:
            type: string
          description: '`similar` edges.'
        similarity_breakdown:
          allOf:
            - $ref: '#/components/schemas/SimilarityBreakdown'
          description: '`similar` edges.'
        computed_at:
          type: string
          format: date-time
    GraphStats:
      type: object
      properties:
        total_nodes:
          type: integer
        total_edges:
          type: integer
        agent_count:
          type: integer
        tool_count:
          type: integer
        category_count:
          type: integer
        similarity_connections:
          type: integer
        delegation_connections:
          type: integer
    RuntimeError:
      type: object
      description: Error raised by the Prisme.ai runtime before the endpoint logic runs.
      required:
        - error
        - message
      properties:
        error:
          type: string
        message:
          type: string
        details:
          type: object
          additionalProperties: true
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: >-
            Error code (e.g. `FORBIDDEN`), or error message on some validation
            errors.
        message:
          type: string
          description: Human-readable message.
    SimilarityBreakdown:
      type: object
      properties:
        tools_jaccard:
          type: number
        tags_overlap:
          type: number
        guardrails_jaccard:
          type: number
  responses:
    InvalidArguments:
      description: >-
        A parameter does not match its schema (length, pattern, type, or
        required field).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/RuntimeError'
          example:
            error: InvalidArgumentsError
            message: Invalid arguments
            details:
              errors: []
    Unauthenticated:
      description: Missing or invalid credentials, or no organization context.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: UNAUTHORIZED
            message: Authentication required
    Forbidden:
      description: The caller lacks the permission required by the endpoint.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: FORBIDDEN
            message: 'Access denied: missing permission ''ai-insights-v2:analytics:read'''
    TooManyRequests:
      description: >-
        Rate limit exceeded. Retry after the number of seconds given in the
        `Retry-After` header.
      headers:
        Retry-After:
          schema:
            type: integer
          description: Seconds to wait before retrying.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/RuntimeError'
          example:
            error: TooManyRequests
            message: Too many requests for 'Insights'
            details:
              name: Insights
              ok: false
              retryAfter: 42.5
              limit: 100
              window: 60
              remaining: 0
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: |
        User-bound credential carrying an identity: either a session JWT
        or a user access token (`at:*`) generated from the user settings UI.
        Send as `Authorization: Bearer <token>`. The organization and the
        permissions applied are those of this user.
    OrgApiKeyAuth:
      type: apiKey
      in: header
      name: x-prismeai-api-key
      description: |
        Organization API key (`iak_{orgSlug}_{uuid}`), managed from the
        AI Governance UI. It is not tied to a user: its access is defined by
        the permissions attached to it, and all keys of an organization share
        the same rate-limit counters. Endpoints that describe "your own"
        data, such as `GET /v1/users/{user_id}`, need a user credential.
        Send as `x-prismeai-api-key: iak_...`.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.