# Loom files

A named loom: a long-term memory several interactions can share. A participant uses it with `loom = @ref("name")` on its seat. A deploy creates the loom, or brings its description and settings up to date; it never touches what the loom remembers, and removing the file does not delete the loom.

What looms are for, and how to use them: [Memory](https://docs.maitento.com/concepts/memory.md).

## Where the file goes

`looms/`, or any sub-folder of it. The file name without `.mtr` is the loom's name. Other files refer to it as `@ref("<name>")`.

A resource's name is its file name without `.mtr` (an app's is its folder's name). Use letters, digits, `_`, `-` and `.` (but not `..`), at most 128 characters. Two files of the same kind may not have the same name, even in different sub-folders or with different capitals.

## Properties

Every property is optional.

### `description`

Optional. Text.

What the loom is for, shown in the portal.

```hcl
description = "What the input is for"
```

### `nightWeaving`

Optional. `true` or `false`. Default: `true`.

Tidy up the loom once conversations go quiet: summarise them, merge duplicates, note contradictions and write a short portrait of each person.

```hcl
nightWeaving = true
```

### `quietMinutes`

Optional. Whole number. Default: `15`.

Minutes without activity before night weaving starts.

```hcl
quietMinutes = 5
```

### `weaverModel`

Optional. Text.

The catalogue model that night-weaves the loom, such as `"anthropic.haiku-4.5"`. The model of the agent whose conversation it is when not set.

```hcl
weaverModel = "deepseek.deepseek-v4-flash"
```

## A complete example

From the [20-memory](https://github.com/maitento/maitento/tree/main/examples/20-memory) example project:

```hcl title="looms/family.mtr"
// A loom a whole household shares. Declared here, it exists before anyone talks to Wren: deploying
// creates it (or updates its settings); a deploy never touches what it holds.

description = "What Wren knows about the family: shared across everyone who talks to it in wren-family."
nightWeaving = true
quietMinutes = 5
```
