mirror of
https://github.com/Mintplex-Labs/anything-llm.git
synced 2026-06-15 23:20:32 +03:00
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:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user