Lesson 03← back to roadmap
An ELIPS database is a directory. Same way a SQLite database is a file.
first_db.py
import elips
client = elips.PersistentClient("/tmp/my_first_elips", dimension=4, metric="cosine")
notes = client.get_or_create_collection("notes")
key = notes.add(embedding=[0.1, 0.2, 0.3, 0.4], metadata={"tag": "hello"})
print(key)
hit = notes.query(query_embeddings=[0.1, 0.2, 0.3, 0.4], n_results=1)[0]
print(hit.key, hit.distance, hit.meta)Kill the process and run it again. The record is still there — ELIPS replayed the WAL on open.