update vector query time, remove delete file process

This commit is contained in:
duanfuxiang
2025-06-14 13:21:29 +08:00
parent 47de767b50
commit 5c24993ab9
4 changed files with 43 additions and 16 deletions

View File

@@ -53,6 +53,7 @@ export class RAGEngine {
throw new Error('Embedding model is not set')
}
await this.initializeDimension()
console.log("updateVaultIndex")
await this.vectorManager.updateVaultIndex(
this.embeddingModel,
@@ -69,6 +70,7 @@ export class RAGEngine {
})
},
)
console.log("updateVaultIndex done")
this.initialized = true
}
@@ -121,9 +123,10 @@ export class RAGEngine {
await this.initializeDimension()
if (!this.initialized) {
await this.updateVaultIndex({ reindexAll: false }, onQueryProgressChange)
}
// if (!this.initialized) {
// console.log("need to updateVaultIndex")
// await this.updateVaultIndex({ reindexAll: false }, onQueryProgressChange)
// }
const queryEmbedding = await this.getEmbedding(query)
onQueryProgressChange?.({
type: 'querying',