soulsands / trilium-chat

Chat plugin highly integrated with Trilium
https://soulsands.github.io/trilium-chat/
GNU Affero General Public License v3.0
73 stars 9 forks source link

Brainstorming: chat with the whole trilium database using some kind of vectors #9

Open thfrei opened 11 months ago

thfrei commented 11 months ago

I like your approach. Having at least an openai interface within trilium and save stuff is useful.

Did you think about maybe do some knowledge retrieval with a vector database in the background? maybe we could create one vector for every note and save it as an attribute. so we could then actually chat with trilium.

There are some tools already like:

soulsands commented 11 months ago

Thank you for your attention and suggestions. I have looked into it before, but found it to be quite complicated, so I haven't delved into it further for now. I may try to implement it in the future, but I'm not sure when. Thanks again!

Alumniminium commented 3 months ago

This is actually quite trivial to do, you don't need a vectordb for that stuff, you can just write all of that(text & embeddings) into a single json file and it will still scale to 100.000's of notes easily.

I'll give it a shot if the contribution part of the readme works.

Edit:

Doesn't work, I'm out.

trilium-chat git:(main) yarn dev     
yarn run v1.22.22
$ cross-env ENV=dev webpack serve --open --config webpack.dev.js
node:events:495
      throw er; // Unhandled 'error' event
      ^

Error: spawn webpack ENOENT
    at ChildProcess._handle.onexit (node:internal/child_process:284:19)
    at onErrorNT (node:internal/child_process:477:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
Emitted 'error' event on ChildProcess instance at:
    at ChildProcess._handle.onexit (node:internal/child_process:290:12)
    at onErrorNT (node:internal/child_process:477:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn webpack',
  path: 'webpack',
  spawnargs: [ 'serve', '--open', '--config', 'webpack.dev.js' ]
}

Node.js v18.18.2
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
perfectra1n commented 3 months ago

That -2 makes it seem like your webpack.dev.js file couldn't be found.