Implement redis memory backend.

This commit is contained in:
BillSchumacher
2023-04-07 00:08:25 -05:00
parent 6819799ebe
commit 5a1d9e6d0a
7 changed files with 175 additions and 4 deletions

View File

@@ -2,6 +2,7 @@ import json
import random
import commands as cmd
from memory.pinecone import PineconeMemory
from memory.redismem import RedisMemory
import data
import chat
from colorama import Fore, Style
@@ -283,8 +284,11 @@ user_input = "Determine which next command to use, and respond using the format
# Initialize memory and make sure it is empty.
# this is particularly important for indexing and referencing pinecone memory
memory = PineconeMemory(cfg)
memory.clear()
if cfg.memory_backend == "pinecone":
memory = PineconeMemory(cfg)
memory.clear()
else:
memory = RedisMemory(cfg)
print('Using memory of type: ' + memory.__class__.__name__)