SiYuan Integration
SiYuan Integration
Connect Chat2Note to your SiYuan workspace to save AI conversations as Markdown documents inside your local knowledge base.
Prerequisites
- SiYuan desktop or server edition running on your machine
- The SiYuan HTTP API enabled with a valid access token
- Chat2Note browser extension installed in Chromium- or Firefox-based browsers
Step 1: Enable the SiYuan API
- Open SiYuan → Settings → Network.
- Enable the API service and note the API endpoint (default:
http://127.0.0.1:6806). - Generate or copy the API token listed in the same panel.
- Make sure SiYuan stays running while you export notes—Chat2Note communicates with it in real time.
Step 2: Locate Your Notebook ID
- In SiYuan, open the notebook that should store your AI notes.
- Right-click the notebook name and choose Copy Notebook ID (or check the notebook properties panel).
- Optionally decide on a folder path inside the notebook (e.g.,
AI/Chat2Note). The folder will be created automatically if it does not exist.
Step 3: Configure Chat2Note
- Open the Chat2Note Options page.
- Navigate to Integrations → SiYuan.
- Enable the SiYuan integration toggle.
- Fill in the required fields:
- API URL – usually
http://127.0.0.1:6806 - API Token – the token you copied from SiYuan (stored encrypted by Chat2Note)
- Notebook ID – the target notebook UUID
- Folder Path (optional) – subfolder for exports
- API URL – usually
- (Optional) Enable Set block attributes if you want Chat2Note to attach metadata such as
custom-source-urlandcustom-platformto each block. - Click Test connection to verify the credentials. Chat2Note will call
/api/notebook/openNotebookand confirm the API response.
Step 4: Export a Conversation
- Open a supported AI chat (ChatGPT, Claude, DeepSeek, Gemini, etc.).
- Click the Chat2Note floating export button.
- Choose Markdown as the format (SiYuan only accepts Markdown).
- Select SiYuan as the export target.
- (Pro) Toggle Include metadata if you want timestamps, platform labels, and source URLs embedded in the note.
- (Pro) Apply custom Markdown templates for full control over the exported structure.
- Click Export. Chat2Note will create a Markdown document via
createDocWithMdinside the configured notebook/folder.
Resulting Note Structure
- Files are created with sanitized titles derived from the conversation name.
- Content is written as Markdown with LaTeX, code blocks, and lists preserved.
- Metadata is appended inside the document body; YAML frontmatter is intentionally disabled to keep SiYuan-compatible formatting.
- When block attributes are enabled, Chat2Note stores metadata on the root block, improving search and backlinks.
Troubleshooting
| Symptom | How to fix |
|---|---|
| ”Connection failed” when testing | Confirm SiYuan is running, the API URL matches your environment, and the token is valid. |
| Notes appear outside the expected folder | Check the folder path spelling; Chat2Note trims leading/trailing slashes but the notebook must exist. |
| Export succeeds but content is empty | Make sure the API token has write permission and that createDocWithMd is enabled in your SiYuan version. |
| Metadata missing | Ensure you enabled metadata in the export dialog (Pro) and block attributes (optional) in settings. |
Best Practices
- Keep SiYuan updated—Chat2Note targets the official API schema and benefits from the latest bug fixes.
- Use dedicated folders (e.g.,
Chat2Note/{Platform}) to organize exports by AI provider. - Combine SiYuan’s backlinks with Chat2Note’s metadata to cross-reference research sessions.
- Schedule periodic configuration exports (Options → Advanced) so you can restore the SiYuan settings quickly on new machines.
You’re now ready to archive AI conversations directly into SiYuan with full control over metadata and structure.