# Pulumi Context API: query your infrastructure as a graph

DevFeed: [Pulumi Context API: query your infrastructure as a graph](<https://devfeed.tech/articles/pulumi-context-api-query-your-infrastructure-as-a-graph-19022.md>)

Original publisher: [Read original article](<https://www.pulumi.com/blog/pulumi-context-api/>)

Author: Levi Blackstone

Published: 2026-08-26T00:00:00Z

Content type: release

Language: en

Sources: [Pulumi](<https://devfeed.tech/sources/pulumi.md>)

Topics: [API](<https://devfeed.tech/topics/api.md>), [Graphs](<https://devfeed.tech/topics/graphs.md>), [Cloud APIs](<https://devfeed.tech/topics/cloud-apis.md>), [infrastructure as code (IAC)](<https://devfeed.tech/topics/infrastructure-as-code-iac.md>), [Command-line interface](<https://devfeed.tech/topics/cli.md>), [JSON](<https://devfeed.tech/topics/json.md>), [pulumi-neo](<https://devfeed.tech/topics/pulumi-neo.md>)

Tags: [agent](<https://devfeed.tech/tags/agent.md>), [ai-agents](<https://devfeed.tech/tags/ai-agents.md>), [api](<https://devfeed.tech/tags/api.md>), [cli](<https://devfeed.tech/tags/cli.md>), [features](<https://devfeed.tech/tags/features.md>), [graph](<https://devfeed.tech/tags/graph.md>), [iac](<https://devfeed.tech/tags/iac.md>), [infrastructure-as-code-iac](<https://devfeed.tech/tags/infrastructure-as-code-iac.md>), [json](<https://devfeed.tech/tags/json.md>), [product](<https://devfeed.tech/tags/product.md>), [pulumi](<https://devfeed.tech/tags/pulumi.md>), [pulumi-cloud](<https://devfeed.tech/tags/pulumi-cloud.md>), [pulumi-neo](<https://devfeed.tech/tags/pulumi-neo.md>), [rest-api](<https://devfeed.tech/tags/rest-api.md>)

## AI overview

Pulumi is launching the Context API, a read-only API that connects Pulumi-managed and discovered resources, stacks, and their relationships into a graph. Available in public preview for Enterprise and Business Critical organizations, it supports infrastructure-impact, coverage, and cleanup queries through the Pulumi CLI or REST API. Pulumi Neo uses it out of the box, and other authenticated agents can access its schema and query guidance.

## Source excerpt

Every platform team fields the same questions: What is running? What breaks if we change this? What can we safely delete? The answers exist, but they're scattered across state files, cloud consoles, and the memories of whoever set things up. Today we're launching the Pulumi Context API, a read-only API that connects Pulumi-managed and discovered resources, stacks, and their relationships into a graph. It's designed agent-first: Pulumi Neo, our infrastructure agent, uses it out of the box, and other agents can fetch the current graph vocabulary and query guidance on demand. It's available in public preview for organizations on the Enterprise and Business Critical editions. Answers that follow infrastructure relationships Pulumi already records the resources your programs manage, their dependencies, how stacks consume each other's outputs, and the resources Pulumi Discovery finds outside infrastructure as code (IaC). The Context API connects this data so you can ask questions that depend on the relationships: Impact: Which stacks are affected if we upgrade this provider? If this stack changes, what consumes its outputs? Coverage: How much of our infrastructure lives outside IaC, and in which accounts? Cleanup: Which stacks have no dependents and are candidates for retirement? A query is a JSON document with a handful of clauses. anchor names the starting nodes, traverse follows relationships from there, and return chooses what comes back. You can run a query through the Pulumi CLI or REST API. Here's a selector that starts from AWS provider instances older than version 7.0.0 and follows incoming provided_by relationships back to the visible resources they manage: { "anchor": { "nodeType": "resource", "match": { "type": "pulumi:providers:aws", "fields": { "provider_version": { "op": "lt", "value": "7.0.0" } } } }, "traverse": [ { "edgeTypes": ["provided_by"], "direction": "in", "alias": "managed" } ], "return": { "select": ["anchor", "managed"] } } A response for one m