Giter VIP home page Giter VIP logo

Comments (3)

jlarmstrongiv avatar jlarmstrongiv commented on July 29, 2024 1

While it’s still being developed, it appears this library https://github.com/asg017/sqlite-vec will support vector search with sqlite in wasm. I hope usearch sqlite extensions support wasm in the future too!

from usearch.

ashvardanian avatar ashvardanian commented on July 29, 2024

I think we should update the release.yml to use WASI SDK 21 over the currently used 20. Moreover, we should avoid using the SDK directly, and instead pass it as a CMake toolchain, as documented.

from usearch.

jonathanpv avatar jonathanpv commented on July 29, 2024

If we get this, my app for local rag would be solved. Although am concerned about data persistence, my use case is users upload textbooks and can perform vector similarity on individual textbooks instead of lets say a user uploads 10,000 textbooks, my project atm will do textbook by textbook to avoid overloading the memory.

How would 1: data persistance and 2: memory be handled with wasm + sqlite + usearch based approach?

Conceptually I would like something like

Query: who are the authors
Textbook: Calculus textbook selected, the sqlite id is textbook_id_here
Sqlite: target the table textbook_id_here and query it using unum search

I've read OPFS + wasm may be a great solution to this but in general will the entire db will all be populated in memory. There seems to not be a single non-memory solution to vector search in browser. Disk-ANN works in C and other languages, im assuming solely due to file system and non browser restrictions. However, I assume a browser-js native implementation can work complete with hnsw and vector search but without multithreading as i believe multithread is not possible in browser-js. Given OPFS is files and supports reading the bytes its basically gives freedom to talk to unum indexes, avoiding the posisblitiy of using wasm all together.

Similar projects I've found are here:
https://github.com/askorama/orama

They allow client based vector search by being js native
https://github.com/askorama/orama/blob/main/packages/docs/open-source/usage/search/vector-search.md#L5L102

And heres how they persist data
https://github.com/askorama/orama/blob/44836b3f2132061b907015f18bea334f9dd4478b/packages/docs/open-source/plugins/plugin-data-persistence.md#L5L104

However for sqlite approach theres also this repo that saves sqlite
storage in indexedDB (which apprently OPFS supersedes in performance but heres the repo nonetheless)
https://github.com/jlongster/absurd-sql

Theres also work by the official sqlite team to address this persisting storage
https://sqlite.org/wasm/doc/trunk/persistence.md

Given this information perhaps we can just have native js browser based OPFS solution to query unum files index.unumsearch calculus.unumsearch
and my app can just be query("my calculus question", opfs.file(namehere)) on unum file per textbook

Interested in more discussion here

from usearch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.