siyuan

Query and edit SiYuan knowledge base blocks and documents via its kernel API.

Updated Aug 22, 2026
One-click install
npx skills add https://github.com/vivekgoquest/hermes-agent-stable --skill siyuan-vivekgoquest
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: siyuan
Source: https://github.com/vivekgoquest/hermes-agent-stable/tree/main/optional-skills/productivity/siyuan
Command: npx skills add https://github.com/vivekgoquest/hermes-agent-stable --skill siyuan-vivekgoquest

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Managing a self-hosted SiYuan knowledge base programmatically requires learning its POST-only kernel API, ID formats, and endpoint conventions, which slows down automation of note search, creation, and editing. ## Core Features & Use Cases - Search and Query: Run full-text search or direct SQL SELECT queries against the blocks database to find notes by keyword, type, or notebook. - Read and Write Blocks: Read block content in Kramdown, create documents from Markdown, append, prepend, insert, update, and delete blocks, and set custom attributes. - Notebook and Document Management: List notebooks and documents, create notebooks, rename or remove documents, and export documents as Markdown. - Use Case: Ask the agent to find all meeting notes mentioning a project, then append a summary paragraph to the relevant document and tag it with a custom status attribute. ## Quick Start Search my SiYuan knowledge base for notes about meeting notes and show the top five results.

Frequently Asked Questions about siyuan

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I search notes in SiYuan via its API?▼

Use the /api/search/fullTextSearchBlock endpoint with a POST request containing your query and page number, authenticated with your API token. For structured filtering, use /api/query/sql with SELECT statements against the blocks table.

How to create a SiYuan document from Markdown programmatically?▼

POST to /api/filetree/createDocWithMd with the notebook ID, target path, and Markdown content in the JSON body. The response returns the new document ID, which you can use for further block operations.

Where do I find the SiYuan API token?▼

The API token is located in the SiYuan desktop app under Settings > About > API token. Store it as SIYUAN_TOKEN in your environment file, and optionally set SIYUAN_URL, which defaults to http://127.0.0.1:6806.

Does the SiYuan API support GET requests for reading notes?▼

No, all SiYuan kernel API endpoints are POST with JSON bodies, even read-only operations like search and block retrieval. Sending GET requests will fail, so always use POST with the Authorization: Token header.

Is it safe to run SQL queries against the SiYuan blocks database?▼

Only SELECT statements are safe through /api/query/sql. INSERT, UPDATE, DELETE, and DROP statements are dangerous and should never be sent, as they can corrupt the knowledge base.

Can I use SiYuan with an MCP server instead of curl?▼

Yes, the @porkll/siyuan-mcp package provides a native MCP integration. Configure it in your Hermes config.yaml under mcp_servers with your SIYUAN_TOKEN and SIYUAN_URL environment variables.