Index


Object Hierarchy:

Object hierarchy for Index

Description:

public class Index : Object

FAISS index wrapper for vector storage and similarity search.

Provides thread-safe access to FAISS operations (FAISS itself is not thread-safe, so all operations are protected by a mutex). Supports both creating new indexes and loading existing ones from disk.

The index uses HNSW (Hierarchical Navigable Small World) algorithm for efficient approximate nearest neighbor search. New indexes are created with M=16 for a good balance of speed, recall, and memory usage.

Usage Example

// Create or load index
var index = new OLLMvector.Index("/path/to/index.faiss", 1024);

// Add vectors
var vectors = new OLLMvector.FloatArray(1024);
vectors.add(vector1);
vectors.add(vector2);
index.add_vectors(vectors);

// Search for similar vectors
var results = index.search(query_vector, k: 10);

// Save index to disk
index.save_to_file("/path/to/index.faiss");


Namespace: OLLMvector
Package: ollmchat

Content:

Properties:

Creation methods:

Methods:

Inherited Members:

All known members inherited from class GLib.Object