Skip to main content
The relationship graph maps every agent’s dependencies: which LLM models it calls, which providers it uses, and which tools it invokes. The graph is auto-populated from proxy telemetry — no manual configuration required.

How It Works

  1. Every request through the MeshAI proxy records the agent, provider, and model used.
  2. The API builds a relationship graph from this telemetry data.
  3. Query individual agent dependencies or the full organization-wide graph.
  4. The graph data is structured for direct use with visualization libraries like D3.js.

Get Agent Relationships

Retrieve the models and providers an individual agent depends on:
curl https://api.meshai.dev/agents/agt_abc123/relationships \
  -H "Authorization: Bearer msh_YOUR_API_KEY"
{
  "success": true,
  "data": {
    "agent_id": "agt_abc123",
    "agent_name": "production-summarizer",
    "dependencies": {
      "providers": [
        { "provider": "openai", "request_count": 1240, "last_used": "2026-03-18T14:00:00Z" },
        { "provider": "anthropic", "request_count": 320, "last_used": "2026-03-18T13:45:00Z" }
      ],
      "models": [
        { "model": "gpt-4o", "provider": "openai", "request_count": 980, "last_used": "2026-03-18T14:00:00Z" },
        { "model": "gpt-4o-mini", "provider": "openai", "request_count": 260, "last_used": "2026-03-18T12:30:00Z" },
        { "model": "claude-sonnet-4-20250514", "provider": "anthropic", "request_count": 320, "last_used": "2026-03-18T13:45:00Z" }
      ]
    }
  }
}

Get Full Relationship Graph

Retrieve the complete organization-wide graph with nodes and edges, suitable for visualization:
curl https://api.meshai.dev/relationships/graph \
  -H "Authorization: Bearer msh_YOUR_API_KEY"
{
  "success": true,
  "data": {
    "nodes": [
      { "id": "agt_abc123", "type": "agent", "label": "production-summarizer", "status": "healthy" },
      { "id": "agt_def456", "type": "agent", "label": "support-bot", "status": "healthy" },
      { "id": "prv_openai", "type": "provider", "label": "openai" },
      { "id": "prv_anthropic", "type": "provider", "label": "anthropic" },
      { "id": "mdl_gpt4o", "type": "model", "label": "gpt-4o", "provider": "openai" },
      { "id": "mdl_claude", "type": "model", "label": "claude-sonnet-4-20250514", "provider": "anthropic" }
    ],
    "edges": [
      { "source": "agt_abc123", "target": "mdl_gpt4o", "weight": 980 },
      { "source": "agt_abc123", "target": "mdl_claude", "weight": 320 },
      { "source": "agt_def456", "target": "mdl_gpt4o", "weight": 450 },
      { "source": "mdl_gpt4o", "target": "prv_openai", "weight": 1430 },
      { "source": "mdl_claude", "target": "prv_anthropic", "weight": 320 }
    ]
  }
}

Graph Structure

The graph uses a node-edge model:

Node Types

TypeDescription
agentA registered agent in your organization
providerAn LLM provider (OpenAI, Anthropic, Google, etc.)
modelA specific LLM model (gpt-4o, claude-sonnet-4-20250514, etc.)

Edge Semantics

Edges represent usage relationships. The weight field indicates the number of requests between the two nodes over the queried time period.
  • agent -> model: The agent called this model N times.
  • model -> provider: This model belongs to this provider (N total requests).

D3.js Visualization

The graph response is structured for direct use with D3.js force-directed graphs:
const response = await fetch("https://api.meshai.dev/relationships/graph", {
  headers: { Authorization: "Bearer msh_YOUR_API_KEY" },
});
const { data } = await response.json();

// data.nodes and data.edges are ready for D3
const simulation = d3.forceSimulation(data.nodes)
  .force("link", d3.forceLink(data.edges).id(d => d.id))
  .force("charge", d3.forceManyBody())
  .force("center", d3.forceCenter(width / 2, height / 2));

Use Cases

  • Impact analysis — Before blocking a provider, see which agents depend on it.
  • Cost optimization — Identify agents that use expensive models and could be routed to cheaper alternatives.
  • Compliance reporting — Document all model/provider dependencies for EU AI Act Article 12.
  • Incident response — Quickly trace which agents are affected by a provider outage.