elips/docs
Chapter II · first contact

Your first database

An ELIPS database is a directory. Same way a SQLite database is a file.

/my_dbLOCKadvisory flock — single writerIDENTITYdimension · metric · indexTEXT_EMBEDDER.manifestprovider · model · fingerprintwal.logCRC32C framed mutationselips.manifestsegmented mode roottext_embedder/rehydratable artifactsegments/atomically renamed segment fileselips.snapshotcompat single-file layoutone directory = one database
What ELIPS writes on disk. Each file is independently meaningful and atomically replaced.
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.