File size: 1,206 Bytes
0919d5b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
"""
Configuration settings for the Memory Chat application.
"""

# Model configuration
DEFAULT_MODEL = "microsoft/DialoGPT-medium"
ALTERNATIVE_MODELS = [
    "microsoft/DialoGPT-small",
    "microsoft/DialoGPT-large",
    "facebook/blenderbot-400M-distill",
]

# Memory configuration
MEMORY_DIR = "memories"
EMBEDDING_MODEL = "all-MiniLM-L6-v2"
MAX_RETRIEVED_MEMORIES = 5
MEMORY_IMPORTANCE_THRESHOLD = 0.7

# Chat configuration
MAX_RESPONSE_LENGTH = 1000
TEMPERATURE = 0.7
TOP_P = 0.9
REPETITION_PENALTY = 1.2

# UI configuration
GRADIO_TITLE = "Memory Chat with Hugging Face"
GRADIO_THEME = "soft"

# Keywords that trigger memory recording
MEMORY_TRIGGER_KEYWORDS = [
    "remember", "note", "save", "important", "fact", "detail",
    "my name is", "i live in", "i work at", "i study",
    "my birthday", "my favorite", "i love", "i hate", "i like",
    "never", "always", "often", "every", "daily", "weekly"
]

# Memory types
MEMORY_TYPES = {
    "general": "General information and facts",
    "conversation": "Important details from chats",
    "preference": "Likes, dislikes, favorites",
    "important": "Critical information marked as important",
    "personal": "Personal information and details"
}