Hi everyone! After attempt to migrate from 0.9.20 to 0.9.22 I got such error on compiling:
Execution error (UnsatisfiedLinkError) at jdk.internal.loader.NativeLibraries/load (NativeLibraries.java:-2).
/root/.javacpp/cache/dtlvnative-linux-arm64-0.12.8.jar/datalevin/dtlvnative/linux-arm64/libjniDTLV.so: libmvec.so.1: cannot open shared object file: No such file or directory
Had anyone else encountered it? Any ideas how to solve?Maybe related to https://clojurians.slack.com/archives/C01RD3AF336/p1743174251541709?thread_ts=1743174251.541709&cid=C01RD3AF336
Thank you. That is it
Hi, I want to do vector search with Datalevin.
This query works fine
(defn find-similar-code
"Find top-k code snippets most similar to the query embedding."
[db query-embedding top-k]
(let [neighbors (d/q '[:find ?filename ?ns ?name ?text
:in $ ?query-vec ?k
:where
[(vec-neighbors $ :code/embedding ?query-vec {:top ?k}) [[?entity-id ?a ?embedding-vector]]]
[?entity-id :code/filename ?filename]
[?entity-id :code/ns ?ns]
[?entity-id :code/name ?name]
[?entity-id :code/text ?text]]
db query-embedding top-k)]
neighbors))
But i would like to get distances as well, after adding :display :refs+dists I canβt make the query work.
It fails with
Execution error (ClassCastException) at datalevin.datom/datom (datom.clj:58).
class clojure.lang.PersistentVector cannot be cast to class java.lang.Number (clojure.lang.PersistentVector is in unnamed module of loader 'app'; java.lang.Number is in module java.base of loader 'bootstrap')
Any ideas how should I update the query? I canβt find any example.
This is probably an oversight on my part, we need to destruct the result of :refs+dists for Datalog. Thank you for reporting.
Problem with docker-datalevin: docker-compose.yaml:
services:
...more services...
datalevin:
image: huahaiy/datalevin
container_name: datalevin
ports:
- "8898:8898"
volumes:
- ./docker/datalevin-data:/data
networks:
- app-network
restart: unless-stopped
networks:
app-network:
driver: bridge
On backend I use connection string <database-name> . Everything works, even if I stop everything with Ctrl-C and restart with docker compose up then data persists despite in ./docker/datalevin-data folder is only system subfolder.
But if I do docker compose up --build or docker compose up --force-recreate then no data from previous session persists.
Maybe someone know the root of this problem?Deepseek says that this is expected. "Yes, this behavior can be expected depending on how your Docker Compose setup is configured. Here's why:
Key Issue: Volume Behavior on Rebuild/Recreate
When you use --build or --force-recreate, Docker Compose may create new containers from fresh images, but the behavior of your volumes depends on your configuration:"
Why Your Data Disappears β’ If you're using anonymous volumes or haven't defined volumes explicitly, Docker may create new ones on rebuild/recreate, discarding old data. β’ Some database images (like PostgreSQL, MySQL) automatically create anonymous volumes if you don't specify one.
How to Fix It 1. Use Named Volumes (recommended): 2. yaml 3. 4. Copy 5. Download 6. services: 7. db: 8. image: postgres 9. volumes: 10. - db_data:/var/lib/postgresql/data 11. volumes: 12. db_data: # Add this at the root level
so the fix is to add a volumes section in your yaml file and define your volumes there
Thank you! Will try tomorrow