> ## Documentation Index
> Fetch the complete documentation index at: https://devgraph.ameyalambat.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Get started with DevGraph local code memory in 5 minutes

## Installation

Install DevGraph globally or run it directly:

<CodeGroup>
  ```bash pnpm theme={null}
  pnpm add -g devgraph
  ```

  ```bash pnpm-dlx theme={null}
  pnpm dlx devgraph@latest build .
  ```

  ```bash bunx theme={null}
  bunx devgraph@latest build .
  ```
</CodeGroup>

## 1. Build the graph

```bash theme={null}
devgraph build .
```

By default this indexes code, repo config, and root context files, then writes local artifacts to `.devgraph/`.

You can also pass specific directories, files, or globs:

```bash theme={null}
devgraph build apps packages
```

## 2. Check outputs

Artifacts are generated in `.devgraph/`:

```text theme={null}
.devgraph/
  |- manifest.json
  |- graph.json
  |- cache/
    |- <file-id>.json
```

| File            | Description                                            |
| --------------- | ------------------------------------------------------ |
| `manifest.json` | Indexed file metadata, hashes, and sync timestamps     |
| `graph.json`    | Canonical local memory graph                           |
| `cache/*.json`  | Per-file extracted artifacts used for incremental sync |

## 3. Check graph health

```bash theme={null}
devgraph status
```

This shows indexed file count, changed file count, graph paths, and last sync time.

## 4. Query the graph

Use `devgraph query` when you want a focused answer from the built graph:

```bash theme={null}
devgraph query "where is devgraph build implemented"
devgraph query "where is syncProject defined" --budget 250
```

The output is a bounded response with matched files, code snippets, and nearby graph edges.

## 5. Keep it fresh

Run watch mode while you work:

```bash theme={null}
devgraph watch .
```

`watch` reuses the same sync engine as `build` and updates the local graph on file changes.

## Next Steps

<CardGroup cols={2}>
  <Card title="Build Command" icon="terminal" href="/docs/cli/build">
    Learn about the incremental sync loop and local artifacts.
  </Card>

  <Card title="Watch Command" icon="arrows-rotate" href="/docs/cli/watch">
    Keep the graph fresh while you edit code.
  </Card>

  <Card title="Query Command" icon="magnifying-glass" href="/docs/cli/query">
    Retrieve focused evidence from the graph.
  </Card>

  <Card title="Status Command" icon="circle-info" href="/docs/cli/status">
    Inspect graph freshness and indexed file counts.
  </Card>
</CardGroup>
