# SiYuan recipe

URL: https://briq.cloud/cookbook/siyuan

> A block-based knowledge workspace with a kernel API, for an agent vault a human can browse.

Tags: memory, document, app

## Run it

MCP:

```ts
briq_run({
  recipe: "siyuan",
  params: {
    "size": "small",
    "diskGb": 2
  },
  wait: true
})
```

REST:

```bash
curl -X POST https://api.briq.cloud/v1/briqs \
  -H "Authorization: Bearer $BRIQ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "recipe": "siyuan",
    "params": {
      "size": "small",
      "diskGb": 2
    },
    "wait": true
  }'
# → { "briqs": [{ "id": "bq_…", … }], "outputs": { "SIYUAN_URL": "…" }, … }

# ... when done, for each briq id
curl -X DELETE https://api.briq.cloud/v1/briqs/<id> \
  -H "Authorization: Bearer $BRIQ_API_KEY"
```

## Parameters

| Name | Type | Options | Default | What it does |
| --- | --- | --- | --- | --- |
| `size` | enum | nano, small, medium | "small" | — |
| `diskGb` | number | — | 2 | Volume size, in GB |

## Outputs

Returned by `briq_run` once the stack is healthy. Hosts resolve inside your team network; secrets are generated per run.

| Output | Value |
| --- | --- |
| `SIYUAN_URL` | `http://siyuan.<stack>.internal:6806` |
| `SIYUAN_AUTH_CODE` | `<SIYUAN_AUTH_CODE>` |

## What it runs

| Briq | Image | Ports | Size | Volume |
| --- | --- | --- | --- | --- |
| siyuan | `b3log/siyuan:latest` | 6806 | small | 2 GB at /siyuan/workspace |

## When to use it

* You like the Obsidian shape (wikilinks, backlinks, a graph of notes) but need it where an agent
  can reach it. SiYuan is that, as a server with an API.
* The agent should build a vault over time and walk its links.
* You want to read the same vault in a browser.

Every note is made of blocks with ids, so the agent can insert in the middle of a document.

## Tips

* **The auth code is the API key**: send `Authorization: Token <SIYUAN_AUTH_CODE>`. It gates the UI
  too.
* **Write** with `/api/block/appendBlock`, **read** with `/api/query/sql`: the block tree as SQL.
* **Browse it**: `briq_run({ recipe: "siyuan", expose: "private" })`.
* **Alternatives**: [memos](https://briq.cloud/cookbook/memos) for quick capture, [wiki](https://briq.cloud/cookbook/wiki) for pages
  other people read.
* **Assets**: the workspace volume starts small; pass `diskGb` for more. Set it when the briq is
  created, and it counts toward your [plan's disk](https://briq.cloud/docs/cost#plans).
