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

# nora knowledge

> Manage knowledge folders and per-folder access rules from the terminal.

Knowledge folders are the same "tag" set the library sidebar shows. Each folder is a slice of documents Agents can retrieve from. **Access rules** gate which tenant roles can see which folder's documents. Both surfaces live under `nora knowledge`.

## Command groups

* **Folders**: `knowledge folders list/add/delete`
* **Access rules**: `knowledge access list/set`

## Folders

### List

```bash theme={null}
nora knowledge folders list
```

Prints every folder registered in the workspace (staged list).

### Add

```bash theme={null}
nora knowledge folders add contracts
```

Creates an empty folder. Idempotent: no-op if the folder already exists. Use this before tagging documents into a new folder so the sidebar picks it up.

### Delete

```bash theme={null}
nora knowledge folders delete contracts
```

Removes the folder from the staged list. Documents tagged with it **stay put**. Untag or delete the documents first if you want the folder truly gone.

## Access rules

Rules are `{folder → {partitionKey?, requires[]}}`. `requires` is a set of tenant permissions the caller must hold to see the folder. `partitionKey` optionally scopes the folder by an operator-defined key (e.g. per-region, per-customer).

### List

```bash theme={null}
nora knowledge access list
```

Prints all rules currently in effect.

### Set

```bash theme={null}
# Restrict to callers with billing.read
nora knowledge access set contracts --requires billing.read

# Compound: multiple permissions required
nora knowledge access set legal --requires legal.read,compliance.read

# Add a partition key (per-region isolation)
nora knowledge access set eu-contracts --partition-key region --requires legal.read

# Clear the rule (folder becomes unrestricted)
nora knowledge access set contracts
```

Empty `--partition-key` + empty `--requires` deletes the rule row.

## Recipes

### Bootstrap a folder + rule pair

```bash theme={null}
nora knowledge folders add billing
nora knowledge access set billing --requires billing.read
```

### Snapshot the folder / access shape to git

```bash theme={null}
nora knowledge folders list --json > snapshots/folders.json
nora knowledge access list --json > snapshots/access.json
```

Round-trip candidate: commit these to track policy changes.

## See also

* [`nora documents`](/cli/documents): tag documents into folders (`documents tag --add <folder>`).
* [Knowledge overview](/build/knowledge/overview): how folders and access rules fit the retrieval story.
