---
title: "Architecture inspection · Docs · SourceAnt"
description: "Documentation: Explore indexed components, classes, call relationships and dependencies, and compare local architecture snapshots with the CLI."
url: "https://sourceant.ai/docs/architecture/"
---

# Architecture inspection

The code index records files, symbols and their relationships. Architecture views arrange that evidence so you can inspect a repository's structure. [Systems](https://sourceant.ai/docs/systems) also records the larger structure of repositories and resources.

## Read a repository's architecture

Open a repository-backed system in **Systems**. Under **Architecture**, choose **Code components**, **Classes** or **Call flow**. The **System** tab shows the system structure. **Data** and **External dependencies** offer other readings of the repository.

Choose a presentation for readings that contain a graph:

-   **Diagram**: explore the recorded nodes and relationships.
-   **UML**: class notation, available for class and entity relationship readings.
-   **Focused flow**: select one node and follow its incoming and outgoing relationships. Select a neighbour to continue exploring.
-   **Dependency matrix**: rows point to columns. A number counts recorded relationships; select it to read their types. Filter by node name to narrow the matrix.

Arrows show indexed direction, not runtime traffic or execution order. The flow drawing shows up to ten neighbours on each side; the matrix shows up to 24 matching nodes. An empty cell means no relationship in this reading. If the index cannot support a reading, the page explains why.

## Inspect local components

After [setting up the local agent](https://sourceant.ai/docs/local-setup) and indexing a repository, use its identifier from `sourceant repos`:

```
sourceant architecture acme/billing
sourceant architecture acme/billing --depth 2
sourceant architecture acme/billing --depth 2 --tests
```

Components follow directory boundaries. Depth ranges from 1 to 4 and defaults to 1. Tests are excluded unless you pass `--tests`. The command reads the current index without making model calls or starting a new indexing run.

## Compare against a baseline

Export the current architecture before changing the code:

```
sourceant architecture acme/billing --depth 2 --json > architecture.json
```

After the repository has been indexed again, compare it with the saved snapshot:

```
sourceant architecture acme/billing --baseline architecture.json
```

The result reports added, removed and modified components and relationships. Comparisons use the baseline's repository, depth and test selection, so do not pass `--depth` or `--tests` with `--baseline`.

This compares indexed snapshots, not Git commits. Incomplete snapshots are refused because missing evidence cannot establish that a component or relationship was removed. Update the index through the agent's schedule or Repositories page before comparing.
