Database


Object Hierarchy:

Object hierarchy for Database

Description:

public class Database : VectorBase

Vector database with embedding generation and FAISS storage.

Manages the complete vector database lifecycle: embedding generation, vector storage in FAISS, and similarity search. Integrates with OLLMchat for embedding generation and automatically manages the FAISS index.

The database requires configuration of model usage types before use: - "ocvector.embed": Embedding model for converting text to vectors

Usage Example

// Register tool config type
OLLMvector.Tool.CodebaseSearchTool.register_config();
OLLMvector.Tool.CodebaseSearchTool.setup_tool_config(config);

// Get dimension first, then create database
var temp_db = new OLLMvector.Database(config, "/path/to/index.faiss", OLLMvector.Database.DISABLE_INDEX);
var dimension = yield temp_db.embed_dimension();
var db = new OLLMvector.Database(config, "/path/to/index.faiss", dimension);

// Add documents (automatically generates embeddings)
yield db.add_documents({"document 1", "document 2"});

// Search
var results = yield db.search("query text", k: 10);

// Save index
db.save_index();


Namespace: OLLMvector
Package: ollmchat

Content:

Constants:

Properties:

Static methods:

Creation methods:

Methods:

Inherited Members:

All known members inherited from class OLLMvector.VectorBase
All known members inherited from class GLib.Object