1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-06-14 12:02:31 +03:00

Vectors: Got basic LLM querying working using vector search context

This commit is contained in:
Dan Brown
2025-03-24 19:51:48 +00:00
parent 8452099a5b
commit 0ffcb3d4aa
8 changed files with 114 additions and 2 deletions

View File

@ -16,10 +16,13 @@ return new class extends Migration
$table->string('entity_type', 100);
$table->integer('entity_id');
$table->text('text');
$table->vector('embedding');
$table->index(['entity_type', 'entity_id']);
});
$table = DB::getTablePrefix() . 'search_vectors';
DB::statement("ALTER TABLE {$table} ADD COLUMN (embedding VECTOR(1536) NOT NULL)");
DB::statement("ALTER TABLE {$table} ADD VECTOR INDEX (embedding) DISTANCE=cosine");
}
/**