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

# Getting started with Brain

> Learn what you can do with Brain and find the right command for each task.

You can use Brain to find earlier decisions, save lessons, and give your agent context before it starts work. Below are some ways to use Brain in your project.

[Install Brain and set up your repository](https://docs.entire.com/guides/brain/overview.md#before-you-start) first. Run these commands from the repository, and replace the example questions and rules with your own.

## Get to Know a Project

If you are joining a project or returning after a break, you can ask Brain for an overview of its structure, tools, and conventions.

```bash theme={null}
entire brain overview
```

## Get Context Before Starting a Task

Describe what you want to build or change. Brain gathers relevant memories, earlier work, code locations, and possible tests into a brief.

```bash theme={null}
entire brain brief "add rate limiting to the upload endpoint"
```

You can now use the brief to plan your work or give your coding agent a starting point. Code locations in the brief come from entire-graph.

## Find Out Why a Decision Was Made

Search earlier work before reopening a decision or trying an approach your team has already explored.

```bash theme={null}
entire brain recall "why did we remove the queue abstraction"
```

Use `recall` for recorded decisions. Check their supporting sources before applying
them to current work. Use `query` for a broader search across history and docs.

## Search for a Topic

Search for a topic by the words you expect to appear in saved memories, history, or docs:

```bash theme={null}
entire brain query "rate limiter"
```

`query` ranks results by keyword relevance using BM25, so results match the words in your query rather than their meaning. If a search returns nothing useful, try the terms your team would have used when the decision was recorded.

The `--semantic` flag is deprecated and has no effect. It is still accepted as an alias so existing scripts keep working, but it returns the same keyword-ranked results.

To narrow the search to one kind of source, use `--source` with `fact`, `history`, or `doc`:

```bash theme={null}
entire brain query "rate limiter" --source fact
```

To rank recent results higher, add `--recency`. You can change how quickly older results lose weight with `--recency-half-life`, which defaults to `2160h` (90 days):

```bash theme={null}
entire brain query "rate limiter" --recency --recency-half-life 720h
```

## Save a Rule for Future Work

You can also record a decision or lesson as a memory so another session can find it. Only save rules that are true for your project.

```bash theme={null}
entire brain remember "Retry failed requests at most three times." --path constraints.retry.policy
```

The `--path` flag sets the memory's category without an agent call. If you omit
it, Brain can ask an agent to choose a category and incur token charges.

## Save a Rule for Every Repository

Some memories, such as a personal preference or a team convention, apply to every repository you work in. Record them globally:

```bash theme={null}
entire brain remember "The staging cluster is in eu-west-1." --global --path project.infrastructure.region
```

Brain recalls global memories from every repository and labels them `(global)` in
results. To list them:

```bash theme={null}
entire brain memories global
```

To leave global memories out of a search, add `--no-global` to `query` or `recall`.
See [Storage and Sync](https://docs.entire.com/guides/brain/storage-and-sync.md) for repository and global scope.

## Look Up Saved Rules

Before changing behavior, you can check what your project has already recorded about it.

```bash theme={null}
entire brain recall "retry policy"
```

Use `recall` for saved memories and `query` for a broader search across memories, history, and docs.

## Review Memories as Markdown Files

Write your memories out as one Markdown file per memory, so you can read, search, and diff them with your usual tools:

```bash theme={null}
entire brain memories files --dir brain-memories
```

The files are a copy. Brain rewrites the directory on each run and does not read the files back, so use `remember` and `memories retract` to change memories.

## Import Memories from Another Tool

If you have memories in mem0, import its export file. Preview the import first:

```bash theme={null}
entire brain memories import --file mem0-export.json --dry-run
entire brain memories import --file mem0-export.json
```

Imported memories are filed under `project.imported` by default. Change this with `--path-prefix`.

## Search Documents That Are Not Code

Brain reads PDF, Word, Excel, and PowerPoint files under `docs/` along with Markdown, so they come back from `query` and `brief`. Extraction runs locally, with no model or network calls.

To check what Brain reads from a file:

```bash theme={null}
entire brain docs extract docs/spec.pdf
```

Scanned PDFs have no text layer, so Brain reports them instead of indexing an empty document.

## Check What a Code Change Could Affect

With entire-graph installed, inspect the impact of changing a function or type. Replace `ValidateToken` with a symbol from your code.

```bash theme={null}
entire brain inspect impact ValidateToken
```

You can also inspect changes since the last index:

```bash theme={null}
entire brain inspect changes
```

## Notify Another Service When Memory Changes

Brain can send a JSON event to an HTTP endpoint when a memory is recorded or retracted, or when memory is refreshed. This lets a CI job, chat channel, or index react without polling.

```bash theme={null}
export ENTIRE_BRAIN_WEBHOOK_URL=https://hooks.example.com/entire
export ENTIRE_BRAIN_WEBHOOK_SECRET=a-long-random-string

entire brain webhook test
```

| Variable | What it does |
| - | - |
| `ENTIRE_BRAIN_WEBHOOK_URL` | Endpoint to send events to. Webhooks are off when it is unset. |
| `ENTIRE_BRAIN_WEBHOOK_SECRET` | Signs each request with HMAC-SHA256 in the `X-Entire-Signature-256` header. |
| `ENTIRE_BRAIN_WEBHOOK_INCLUDE_TEXT` | Set to `1` to include memory text in events. Text is left out by default. |
| `ENTIRE_BRAIN_NO_EGRESS` | Blocks webhooks and other Brain-controlled network operations. |

Run `entire brain webhook events` to list the events Brain sends. See
[Network Controls](https://docs.entire.com/guides/brain/storage-and-sync.md#network-controls) before enabling egress.

## Check Whether Memory Is Current

You can see which sources are available, missing, or out of date, using:

```bash theme={null}
entire brain status --verbose
```

If something needs attention, `doctor` prints the command that fixes it:

```bash theme={null}
entire brain doctor
```

Check whether saved memories still point to matching sources:

```bash theme={null}
entire brain verify
```

A memory entered by hand can show `unverifiable-here` because it has no source reference. Verification checks references, not whether a memory is correct.
