Constructor.
Creates a new index or loads an existing one from disk. If the index file exists, it will be loaded (dimension comes from the file). If the file doesn't exist, a new HNSW index will be created with the specified dimension.
| filename |
Path to the FAISS index file |
| dim |
The dimension of vectors (must match if loading existing index) |
| Error |
if index file exists but dimension doesn't match, or if index creation/loading fails |