jaar23 / nb-assistant

SiYuan Notebook AI assistant
MIT License
1 stars 0 forks source link

nb-assistant

中文版

Notebook Assistant (nb-assistant / 思源 笔记本助手) is an plugin that build for SiYuan to enhance its AI capability.

0.1.3 is in release stage now!

preview

It has the following features:

✅ Chat interface using openai standard API

✅ Summarise current opened page

✅ Generated content starting with an AI emoji to identify content is AI generated.

✅ Auto generate tag for current opened page. (classification and entity extraction)

✅ Save AI chat in history

✅ Custom prompt in setting

✅ Clear chat

✅ Change of role

0.1.3 Update

demo6

✅ Create embedding based on your notebook by using transformer.js and onnx runtime.

demo7

✅ Search document based on similarity.

✅ Hybrid search strategy by combining similarity result and full text search.

demo8

✅ Open document from search result.

✅ Chat with your document, start by typing / on your chat box.

✅ Chat with your notebook, start by typing @ on your chat box. Result may vary due to notebook structure, content store within one notebook, etc.

✅ Select tags to be adding into your document when using auto tag shortcut.

✅ Save summary into your document after summary is generated.

✅ Prompt chaining for larger document in order to fine tune the context and response.

To use the plugin, you will first complete default SiYuan AI setting, for example:

demo4

btw, the settings above can be apply for using local llama or llamafile (https://github.com/Mozilla-Ocho/llamafile) as well. Since SiYuan default AI settings support for OpenAI API spec, you can try to connect with other service provider too.

Features plan in the future roadmap:


Current limitation


demo3

demo2


Limitation for 0.1.3

Everytime you restart SiYuan and using services that required to create embedding, for example, chat with your notebook, create embedding, serch notebook. You are required to download the model online again, approximately (30mb).

If you do not want this behaviour, you will have to start SiYuan with a specific port.

Reason behind is due to electron caching. (https://github.com/siyuan-note/siyuan/issues/11969)

To do it in Linux:

Option 1

siyuan --port=16806

Option 2

  1. vi /usr/share/applications/siyuan.desktop

  2. modify Exec line to below

│Exec=/opt/SiYuan/siyuan --port=16806 %U
  1. Start SiYuan as usual