Files
logseq/scripts
rcmerci 5179949902 Squashed commit of the following:
commit a2eee34d80
Merge: 3025c94d2 af41e7ea3
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Mon Aug 4 23:08:38 2025 +0800

    Merge pull request #12009 from logseq/feat/hnswlib+transformer-js

    feat: semantic search

commit af41e7ea3d
Merge: a407035d8 3025c94d2
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Mon Aug 4 23:08:23 2025 +0800

    Merge branch 'master' into feat/hnswlib+transformer-js

commit a407035d80
Author: Gabriel Horner <gabriel@logseq.com>
Date:   Mon Aug 4 10:41:55 2025 -0400

    fix: app and other builds no longer require shadow-cljs config hack

    Reverts bug fix for
    347323b7d6
    and for other builds. This bug no longer applies b/c :shared is no
    longer used or b/c of shadow-cljs update

commit 3025c94d28
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Mon Aug 4 20:40:53 2025 +0800

    fix: checkbox property value should be aligned center

commit a918e5b6f1
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Sun Aug 3 16:58:19 2025 +0800

    enhance(ux): show edit button instead of 00:00 for datetime property

commit c2c8727f6c
Merge: be6929234 c9e446fd8
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Sun Aug 3 16:40:22 2025 +0800

    Merge branch 'master' into feat/hnswlib+transformer-js

commit be69292346
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Sun Aug 3 16:37:45 2025 +0800

    set *publishing?

commit 11eb0f38a6
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Sun Aug 3 14:33:47 2025 +0800

    use official @sqlite.org/sqlite-wasm instead of our fork

commit 74fa24cb1e
Author: Gabriel Horner <gabriel@logseq.com>
Date:   Fri Aug 1 19:20:59 2025 -0400

    fix: publishing no longer has bug requiring shadow-cljs config hack

    Reverts bug fix from
    a80a182a8f.
    Confirmed dev and release work for publishing. This bug may no longer
    apply b/c :shared is no longer used or b/c of shadow-cljs update

commit 182a51a85e
Author: Gabriel Horner <gabriel@logseq.com>
Date:   Fri Aug 1 17:56:39 2025 -0400

    fix: publishing app in prod mode

    Also fix watch-publishing-frontend which had stopped working awhile back
    with shadow-cljs update

commit f7e32108f2
Author: Gabriel Horner <gabriel@logseq.com>
Date:   Fri Aug 1 14:37:18 2025 -0400

    enhance(dev): add more workers and db ns to linters

commit cf4153b1cd
Author: Gabriel Horner <gabriel@logseq.com>
Date:   Fri Aug 1 13:49:31 2025 -0400

    fix: yarn watch

commit 1fe46682e4
Merge: 1e8d7de44 8c402676a
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Fri Aug 1 00:14:28 2025 +0800

    Merge branch 'master' into feat/hnswlib+transformer-js

commit 1e8d7de446
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Fri Aug 1 00:03:22 2025 +0800

    fix: load progress in shared worker

commit 1e84a21042
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Thu Jul 31 22:38:44 2025 +0800

    enhance: use sharedworker for inference to reduce memory usage

commit e8d6ae1a2f
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Thu Jul 31 22:02:13 2025 +0800

    disable qwen3 embedding

commit 67a0f7cd8c
Merge: 7e04733ac 0bfb458d9
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Thu Jul 31 20:08:29 2025 +0800

    Merge branch 'master' into feat/hnswlib+transformer-js

commit 7e04733acf
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Tue Jul 29 01:21:49 2025 +0800

    fix: lint

commit 5ee795171c
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Tue Jul 29 01:19:26 2025 +0800

    enhance: display show more by default

commit a9e9149350
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Tue Jul 29 01:17:22 2025 +0800

    fix: add score for non-matched results

commit d1cabafcc2
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Tue Jul 29 00:53:24 2025 +0800

    ensure db/id is not great than 2147483647 for embedding

commit 0816c6a985
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Tue Jul 29 00:15:51 2025 +0800

    remove jina embeddings for now

commit 74fb1194e9
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Tue Jul 29 00:08:46 2025 +0800

    adjust weights for keyword search and semantic search

commit 6e95bb1801
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Mon Jul 28 19:38:53 2025 +0800

    re-enable malli dev

commit 47132b395e
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Mon Jul 28 19:23:04 2025 +0800

    fix: tweet embed

commit 238b071b62
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Mon Jul 28 19:11:41 2025 +0800

    fix: workflows

commit 44fb03b0ae
Merge: 88dfaf8eb cb65cb88a
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Mon Jul 28 18:35:20 2025 +0800

    Merge branch 'master' into feat/hnswlib+transformer-js

commit 88dfaf8ebd
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Mon Jul 28 18:31:29 2025 +0800

    fix: mobile build

commit 7f18e941d0
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Mon Jul 28 16:26:56 2025 +0800

    separate config for app and mobile

commit 0c3697e972
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Mon Jul 28 12:50:06 2025 +0800

    fix: add workers to rtc test workflow

commit 18914d2fa2
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Mon Jul 28 12:43:24 2025 +0800

    fix: add workers to mobile and electron release

commit af33e6964b
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Mon Jul 28 12:30:30 2025 +0800

    fix: ns

commit 110f5b18e5
Merge: dcd6d7414 654e6d1b7
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Mon Jul 28 12:29:32 2025 +0800

    Merge branch 'master' into feat/hnswlib+transformer-js

commit dcd6d74146
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Mon Jul 28 12:26:49 2025 +0800

    fix: typo

commit c71e51bc78
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Mon Jul 28 12:23:56 2025 +0800

    add webpack to release-mobile

commit 44d6c12731
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Mon Jul 28 12:21:35 2025 +0800

    update output-feature-set to es-next-in

commit 65afa1e762
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Mon Jul 28 12:20:11 2025 +0800

    fix: lint

commit d488c53fd6
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Wed Jul 23 22:12:20 2025 +0800

    adjust page/object sorting weight

commit 6a22385f0b
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Wed Jul 23 20:54:29 2025 +0800

    replace uuid ref with block title when embedding

commit 0f48207329
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Wed Jul 23 20:48:55 2025 +0800

    add tags to embedding

commit 48ae054ce8
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Wed Jul 23 20:22:22 2025 +0800

    fix: lint

commit aeeaad3eb0
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Wed Jul 23 20:12:19 2025 +0800

    fix: embedding status

commit 9335281d4a
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Wed Jul 23 15:25:50 2025 +0800

    fix: webpack release failed to require path

commit 4b935df5d3
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Wed Jul 23 14:42:54 2025 +0800

    fix: katex path

commit 5d7f56361a
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Wed Jul 23 14:36:10 2025 +0800

    downgrade shadow-cljs

commit f86be0f3a8
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Wed Jul 23 13:11:15 2025 +0800

    add more externs

commit 31004ee371
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Wed Jul 23 12:40:25 2025 +0800

    wip: webpack release build

commit dbe2708e5e
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Mon Jul 21 22:46:02 2025 +0800

    Add webpack build

commit 0722688fd8
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Mon Jul 21 21:47:36 2025 +0800

    feat: hybrid search

commit 337b28e5d4
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Mon Jul 21 20:53:35 2025 +0800

    set batch size to 500

commit 2c27aee09d
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Mon Jul 21 20:14:14 2025 +0800

    use db/id for hnsw label

    Because db/id is unique, auto-increment so that old ids are not re-used.

commit f1d8e526fc
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Mon Jul 21 17:44:45 2025 +0800

    enhance: set embedding distance to 0.3 to keep search result related

commit bf3af0fedd
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Mon Jul 21 17:21:20 2025 +0800

    perf: skip refresh ui for embedding data transactions

commit 690b92c975
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Mon Jul 21 17:15:06 2025 +0800

    enhance: adjust batch embedding size to cut down resource usage

commit 3f20f44790
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Mon Jul 21 17:06:17 2025 +0800

    enhance: add embedding indicator

commit 2e65b639dc
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Mon Jul 21 16:37:35 2025 +0800

    fix: cancel index when switching to another model

commit ae78fc65c4
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Mon Jul 21 16:22:17 2025 +0800

    enhance: start embedding after selected a model

commit 910c8f448f
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Mon Jul 21 16:13:17 2025 +0800

    Use missionary clock for auto embedding

commit b23f9e28a2
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Mon Jul 21 13:30:45 2025 +0800

    feat: add semantic search result when searching blocks

commit f296c1e67d
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Sat Jul 19 15:32:16 2025 +0800

    fix: auto embedding stops when switching graph

commit a5270a05e1
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Sat Jul 19 15:17:11 2025 +0800

    fix: inference worker js path

commit 91d3ab70fb
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Sat Jul 19 15:15:24 2025 +0800

    enhance: don't update index info if there's no block update

commit de80615c5f
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Sat Jul 19 14:36:11 2025 +0800

    enhance: index embedding for updated blocks every 30s

commit 133b5e497a
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Wed Jul 16 18:59:38 2025 +0800

    enhance(ux): show embedding model download progress

commit 00405d98d3
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Wed Jul 16 15:59:22 2025 +0800

    add local embedding model settings

commit 88f62e86ec
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Wed Jul 16 14:40:18 2025 +0800

    perf improvement

commit 4b0cb79d0d
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Wed Jul 16 04:02:22 2025 +0800

    fix: vector search

commit bfed2e3bc6
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Tue Jul 15 17:49:01 2025 +0800

    Add qwen3 embedding

commit f3e1da67c7
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Tue Jul 15 16:52:30 2025 +0800

    fix: infer worker doesn't work

commit e1147c3264
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Tue Jul 15 15:59:01 2025 +0800

    fix: c.m/run-task args

commit 2d50ca5ce2
Merge: ca558450c 24e3a08b0
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Fri Jul 11 18:15:33 2025 +0800

    Merge branch 'master' into feat/hnswlib+transformer-js

commit ca558450c1
Merge: 1f31f08bf 1565e7541
Author: rcmerci <rcmerci@gmail.com>
Date:   Fri Mar 21 15:42:50 2025 +0800

    Merge remote-tracking branch 'origin/feat/db' into feat/hnswlib+transformer-js

commit 1f31f08bf6
Author: rcmerci <rcmerci@gmail.com>
Date:   Fri Mar 21 15:37:34 2025 +0800

    fix(vec-search): new-hnsw-index when force-reset-index

commit bb226a4147
Author: rcmerci <rcmerci@gmail.com>
Date:   Fri Mar 21 01:38:39 2025 +0800

    feat(vec-search): debug ui show load-model-progress

commit a7273847bc
Author: rcmerci <rcmerci@gmail.com>
Date:   Thu Mar 20 22:27:56 2025 +0800

    feat(vec-search): debug ui support selecting model

commit 47c24177a6
Author: rcmerci <rcmerci@gmail.com>
Date:   Tue Mar 18 23:37:10 2025 +0800

    feat(vec-search): update debug ui

commit cd44e77ac9
Author: rcmerci <rcmerci@gmail.com>
Date:   Tue Mar 18 21:55:51 2025 +0800

    feat(vec-search): add debug-ui at sidebar

commit 328b38db30
Author: rcmerci <rcmerci@gmail.com>
Date:   Tue Mar 18 18:37:25 2025 +0800

    feat(embedding): add vector-search-state-flows

commit 6b8c1dde93
Author: rcmerci <rcmerci@gmail.com>
Date:   Tue Mar 18 15:43:44 2025 +0800

    feat(embedding): check webgpu available

commit 624f839bbf
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Sun Mar 16 12:08:11 2025 +0800

    fix: can't use fuse.js

commit 38e4b0d9b2
Merge: b19f0d91c a55137049
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Sun Mar 16 11:52:32 2025 +0800

    Merge branch 'feat/db' into feat/hnswlib+transformer-js

commit b19f0d91ca
Author: rcmerci <rcmerci@gmail.com>
Date:   Sat Mar 15 23:48:26 2025 +0800

    enhance(embedding): add user-defined class/prop

commit 0c82a420c7
Author: rcmerci <rcmerci@gmail.com>
Date:   Sat Mar 15 22:56:45 2025 +0800

    fix: use d/entity instead of d/pull

    because :block/title in entity will replace :block/uuid by its block/title

commit 2c88070fe0
Author: rcmerci <rcmerci@gmail.com>
Date:   Sat Mar 15 22:43:28 2025 +0800

    fix: remove outdated hnsw-label

commit a5db52bf37
Author: rcmerci <rcmerci@gmail.com>
Date:   Sat Mar 15 20:56:22 2025 +0800

    feat(embedding): text-embedding graph blocks and query hnsw

    new properties:
    :logseq.property.embedding/hnsw-label,
    :logseq.property.embedding/hnsw-label-updated-at

    add ns frontend.worker.embedding

commit 5f02b7c863
Author: rcmerci <rcmerci@gmail.com>
Date:   Sat Mar 15 15:30:44 2025 +0800

    dev: update cljfmt.edn

commit d48a30000d
Author: rcmerci <rcmerci@gmail.com>
Date:   Fri Mar 14 17:30:25 2025 +0800

    enhance(text-embedding): add api delete-labels

commit eda3928937
Author: rcmerci <rcmerci@gmail.com>
Date:   Fri Mar 14 16:45:14 2025 +0800

    enhance(text-embedding): connect db-worker and infer-worker

commit 53cc7485d8
Author: rcmerci <rcmerci@gmail.com>
Date:   Thu Mar 13 22:42:31 2025 +0800

    enhance(text-embedding): smaller init-max-elems, dynamically resizeIndex

commit 95c0f2ef1c
Author: rcmerci <rcmerci@gmail.com>
Date:   Thu Mar 13 22:07:30 2025 +0800

    feat: init add frontend.inference-worker.text-embedding

commit e2271dd03d
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Thu Mar 13 21:00:35 2025 +0800

    use forked sqlite-wasm

commit c269046b44
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Tue Mar 11 16:21:44 2025 +0800

    Revert "disable js-toast temporally to open the app"

    This reverts commit da1c4dd465.

commit ebeeb280ef
Author: charlie <xyhp915@qq.com>
Date:   Tue Mar 11 16:16:37 2025 +0800

    enhance(webpack): add externals for React and ReactDOM

commit da1c4dd465
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Tue Mar 11 15:57:14 2025 +0800

    disable js-toast temporally to open the app

commit 8f1b610361
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Tue Mar 11 15:51:22 2025 +0800

    chore: remove unused package

commit 68426d54eb
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Tue Mar 11 15:30:24 2025 +0800

    get rid of shared module

commit 0ecf65aefb
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Tue Mar 11 13:37:42 2025 +0800

    chore: use official sqlite-wasm

commit e36543256f
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Mon Mar 10 17:23:14 2025 +0800

    fix: worker repl

commit b122d453c2
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Mon Mar 10 17:20:39 2025 +0800

    separate :workers build

commit 849ffd3329
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Mon Mar 10 16:23:52 2025 +0800

    prepend bundle to worker js output

commit 5632c29ba0
Author: Tienson Qin <tiensonqin@gmail.com>
Date:   Mon Mar 10 15:05:19 2025 +0800

    wip: webpack integration

commit 1c46e0205e
Author: rcmerci <rcmerci@gmail.com>
Date:   Mon Mar 10 12:08:44 2025 +0800

    init add inference-worker
2025-08-05 00:48:29 +08:00
..
2025-07-04 20:06:13 +08:00

Description

This is a collection of development related scripts, written as bash scripts, bb/babashka scripts and nbb scripts.

Usage

Babashka scripts

Most bb scripts live under src/ and are defined as bb tasks. See babashka tasks

Nbb scripts

Before running nbb-logseq scripts, be sure to have node >= 18.14 installed as well as a recent babashka for managing the dependencies in nbb.edn. Then yarn install to install dependencies

Create graph scripts

These scripts generate custom database graphs written with nbb-logseq. If this is your first time generating a DB graph, first try the dev:db-create bb task in db graph tasks as it only requires writing EDN.

Creating graphs from the commandline using scripts and a concise EDN map is possible thanks to nbb-logseq and the namespaces logseq.outliner.db-pipeline and logseq.db.sqlite.build. For example, the create_graph_with_properties.cljs script uses this ns to create a graph with a variety of properties:

$ yarn nbb-logseq src/logseq/tasks/db_graph/create_graph_with_properties.cljs woot
Generating 16 pages and 24 blocks ...
Created graph woot!

NOTE: To use this created graph, click on the three dots menu in the upper right corner and select Import. Then click on the SQLite import button and upload the generated graph.

This script creates a DB graph with blocks containing several property types for both single and many cardinality. It also includes queries for most of these properties. Read the docs in logseq.db.sqlite.build for specifics on the EDN map.

To create large graphs with varying size:

$ yarn -s nbb-logseq src/logseq/tasks/db_graph/create_graph_with_large_sizes.cljs large
Building tx ...
Built 21000 tx, 1000 pages and 20000 blocks ...
Transacting chunk 1 of 21 starting with block: #:block{:name "page-0"}
...
Created graph large with 187810 datoms!

# To see options available
$ yarn -s nbb-logseq src/logseq/tasks/db_graph/create_graph_with_large_sizes.cljs -h
Usage: $0 GRAPH-NAME [OPTIONS]
Options:
  -h, --help        Print help
  -p, --pages  1000 Number of pages to create
  -b, --blocks 20   Number of blocks to create

Another example is the create_graph_with_schema_org.cljs script which creates a graph with the https://schema.org/ ontology with as many of the classes and properties as possible:

$ yarn -s nbb-logseq src/logseq/tasks/db_graph/create_graph_with_schema_org.cljs schema
Skipping 67 superseded properties
Skipping 25 properties with unsupported data types
Renaming 1 properties due to page name conflicts
Generating 2268 pages with 900 classes and 1368 properties ...
Created graph schema!

Update graph scripts

For database graphs, it is recommended to use logseq.outliner.db-pipeline/add-listener! when updating graphs. TODO