PGvector vector database support (#3788)

* PGVector support for vector db storage

* forgot files

* comments

* dev build

* Add ENV connection and table schema validations for vector table
add .reset call to drop embedding table when changing the AnythingLLM embedder
update instrutions
Add preCheck error reporting in UpdateENV
add timeout to pg connection

* update setup

* update README

* update doc
This commit is contained in:
Timothy Carambat
2025-05-09 12:27:11 -07:00
committed by GitHub
parent 2812fef01e
commit e1b7f5820c
18 changed files with 1164 additions and 24 deletions

View File

@@ -30,11 +30,22 @@ async function resetAllVectorStores({ vectorDbKey }) {
vectorDbKey
);
const VectorDb = getVectorDbClass(vectorDbKey);
for (const workspace of workspaces) {
try {
await VectorDb["delete-namespace"]({ namespace: workspace.slug });
} catch (e) {
console.error(e.message);
if (vectorDbKey === "pgvector") {
/*
pgvector has a reset method that drops the entire embedding table
which is required since if this function is called we will need to
reset the embedding column VECTOR dimension value and you cannot change
the dimension value of an existing vector column.
*/
await VectorDb.reset();
} else {
for (const workspace of workspaces) {
try {
await VectorDb["delete-namespace"]({ namespace: workspace.slug });
} catch (e) {
console.error(e.message);
}
}
}