Skip to content

Add repository-level code graph support for AI-assisted navigation #1575

Description

@axies20

Related to an existing integration?

No

Existing integration

N/A

Overview

CommunityToolkit/Aspire contains a growing number of integrations organized across src/, tests/, examples/, documentation, and repository-specific agent guidance.

AI coding assistants can navigate this today with text and code search, but they still need to repeatedly reconstruct relationships between an integration, its hosting extensions, resource types, tests, examples, documentation, and related projects.

I would like to propose adding repository-level code graph support so AI coding assistants can query a machine-readable representation of the repository before falling back to broad file searches.

Useful relationships could include:

  • integration project → public hosting extension methods / resource types
  • project → references → project / package
  • implementation → related unit and integration tests
  • implementation → related examples and documentation
  • type / member → calls / uses / inherits → type / member

This would be repository tooling only and would not need to become a runtime dependency of any CommunityToolkit Aspire integration.

Graphify is one existing implementation that could be evaluated. The proposal is primarily about the artifact and capability, not a requirement to adopt this specific tool. The generated representation and tooling should remain replaceable.

The graph could be generated or refreshed in CI and then committed, published as an artifact, exposed through MCP, or generated on demand. That delivery choice could be decided separately.

I tested this approach on another .NET repository. The full source corpus was roughly 193k tokens, while graph-backed retrieval averaged roughly 4.3k tokens of relevant context per query. This is not intended as a formal benchmark, but it made repository exploration noticeably cheaper and more focused for an AI agent.

Usage example

Before modifying an Aspire hosting integration, an AI coding assistant could query the graph rather than broadly scanning the repository:

User: Update the hosting integration for a resource.

Agent:
1. Query the repository graph for the integration project.
2. Discover its public hosting extension methods and resource types.
3. Retrieve the related tests, examples, and documentation.
4. Load only those files into context.
5. Make the change and run the relevant test subset.

Another useful scenario is impact analysis:

Agent: What could be affected if this hosting extension changes?

Graph → hosting extension → resource type → referenced packages
      → integration tests → examples → documentation

This could also help human contributors with onboarding and architecture exploration. An interactive visualization could be generated from the same graph, but the main motivation is efficient machine-readable navigation for coding agents.

Breaking change?

No

Alternatives

Current alternatives include:

  • letting each coding agent repeatedly use text search, file discovery, and symbol search;
  • relying on IDE or LSP indexing available only in the local development environment;
  • maintaining hand-written architecture documentation;
  • allowing every contributor or agent to generate its own local index independently.

Those approaches work, but they duplicate repository-discovery effort and provide no shared, versioned structural representation of the codebase.

Another alternative would be to define a small CommunityToolkit Aspire-specific graph or index format rather than use Graphify. I would prefer evaluating an existing tool first while keeping the generated representation and tooling replaceable.

Additional context

The repository already includes guidance for AI-assisted development. A repository-level graph could complement that guidance by providing a current structural view of integrations, hosting APIs, tests, examples, documentation, and project dependencies.

The goal is not to make AI-generated changes autonomous or bypass review. It is simply to give tools a cheaper and more deterministic way to answer questions such as where is this implemented, what is connected to it, and which tests and examples are relevant?

Help us help you

Yes, but only if others can assist

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions