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

# Mental model

> Learn the Bazel mental model: how BUILD files, dependency graphs, rules, action graphs, and spawned tools combine to populate the bazel-out tree from sources.

At the highest level, Bazel’s core model is:

```mermaid theme={null}
graph TD
    A(("BUILD files next to sources")) --> B["dependency graph"]
    B --> C["rules"]
    C --> D["action graph"]
    D --> E["spawn tools"]
    E --> F(("populate output tree"))
```

## Bazel input requirements

To build your application with Bazel, you must provide two core requirements:

**Code Descriptions**

Provide a description of your code and its dependencies in `BUILD` files. You’ll see that these can be largely automated, but they are checked into version control, and developers sometimes need to read or edit them.

**Rule-sets**

Bazel requires plugins called a **rule set** to teach it what to do with those descriptions you provided in the `BUILD` files. These rules, in turn, know how to fetch existing build tools like compilers or code generators.
<Note>Rarely, a team exclusively generates `BUILD` files on-the-fly; we call this setup "BUILDless" since they don't check them in.</Note>

## Bazel build output

Provided with `BUILD` files, Bazel constructs a dependency graph. It uses that to create a lazy transformation from your source tree to a `bazel-out/` folder containing the requested build outputs. Test results are modeled as outputs too. The output folder is then continually updated as the sources are changed, by doing as little work as possible.

<Callout icon="book">
  Check out a detailed article on [Bazel outputs](/blog/bazel-what-you-give-what-you-get)
</Callout>
