Fixups to long memory, and avoid re-initing RAGDB recursively

Signed-off-by: mudler <mudler@localai.io>
This commit is contained in:
mudler
2024-12-18 12:41:18 +01:00
parent c2035c95c5
commit 735bab5e32
3 changed files with 16 additions and 14 deletions

View File

@@ -63,13 +63,13 @@ func NewInMemoryDB(knowledgebase string, store RAGDB) (*InMemoryDatabase, error)
}, nil
}
func (db *InMemoryDatabase) SaveAllToStore() error {
func (db *InMemoryDatabase) PopulateRAGDB() error {
for _, d := range db.Database {
if d == "" {
// skip empty chunks
continue
}
err := db.Store(d)
err := db.RAGDB.Store(d)
if err != nil {
return fmt.Errorf("error storing in the KB: %w", err)
}