cookbook / siyuan
SiYuan
A block-based knowledge workspace with a kernel API, for an agent vault a human can browse.
- memory
- document
- app
Run it
briq_run({
recipe: "siyuan",
params: {
"size": "small"
},
wait: true
})briq run siyuan
briq ls
briq logs -f <id>
briq rm <id>import { Briq } from '@briq/sdk';
const briq = new Briq(process.env.BRIQ_API_KEY);
const siyuan = await briq.run({
recipe: 'siyuan',
params: {
"size": "small"
},
});
console.log(siyuan.outputs.SIYUAN_URL);
// ... when done
await briq.destroy(siyuan.id);Parameters
| Name | Type | Options | Default |
|---|---|---|---|
| size | enum | nano, small, medium | "small" |
Outputs
Returned by briq_run once the stack is healthy. Hosts resolve inside your team network; secrets are generated per run.
- 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 | 10 GB at /siyuan/workspace |
When to use it
- You like the Obsidian shape — wikilinks, backlinks, a graph of notes, everything in blocks — but you need it somewhere an agent can reach. Obsidian itself is a desktop app; SiYuan is the same idea as a server with a kernel API.
- The agent should build a vault over time and be able to walk it: this note links to that one, what points back at this decision, which blocks mention this service.
- You want to open the same vault in a browser and read what the agent has been keeping.
Every note is a block with an id, and the kernel API reads and writes blocks directly, so the
agent can insert into the middle of a document instead of appending to the end of a file. The
volume is 10 GB at /siyuan/workspace and holds notes, assets and the search index.
Tips
- The auth code is the API key. briq generates
SIYUAN_AUTH_CODEper run; send it as theAuthorization: Token <code>header on every kernel API call. - Expose it with
mode: "token"on port 6806 to browse the vault yourself. The auth code gates the UI too, so treat the pair as credentials. - Write with
/api/block/appendBlockand read with/api/query/sql— the kernel exposes the block tree as SQL, which is the fastest way for an agent to ask "what do I know about X". - Compared to the alternatives: memos is quick capture, this is a linked vault, wiki is pages for other people to read.