-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.example.py
More file actions
114 lines (92 loc) · 2.78 KB
/
config.example.py
File metadata and controls
114 lines (92 loc) · 2.78 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
"""
EvoGraph Configuration
"""
import os
# ==================== LLM Configuration ====================
LLM_PROVIDERS = {
"openai": {
"endpoint": "https://api.openai.com/v1/chat/completions",
"api_key": os.getenv("OPENAI_API_KEY", "your-api-key-here"),
"model": "gpt-4o-mini",
"headers": {}
},
}
LLM_CONFIG = {
"active_provider": "openai",
"temperature": 0,
"max_retries": 3,
"retry_base_sec": 2.0,
"timeout": 600,
"load_balance_ratio": 5,
}
# ==================== Neo4j Configuration ====================
CONV_DB_MAPPING = {
"conv-26": {
"uri": os.getenv("NEO4J_URI", "bolt://localhost:7687"),
"user": os.getenv("NEO4J_USER", "neo4j"),
"password": os.getenv("NEO4J_PASSWORD", "your-password"),
"database": "neo4j"
},
}
NEO4J_CONFIG = CONV_DB_MAPPING["conv-26"]
def get_neo4j_config(conv_id: str = None):
"""Get Neo4j config by conversation ID"""
if conv_id and conv_id in CONV_DB_MAPPING:
return CONV_DB_MAPPING[conv_id]
return NEO4J_CONFIG
# ==================== Architecture Configuration ====================
# LPM (Long-term Personalized Memory) — entity index layer
LPM_CONFIG = {
"max_entities_in_prompt": 50,
"summary_update_interval": 10,
}
# MTM (Mid-term Memory) — evolution lines layer
MTM_CONFIG = {
"max_line_nodes_in_prompt": 20,
"heat_decay_factor": 0.95,
}
# STM (Short-term Memory) — current context
STM_CONFIG = {
"history_window": 10, # m=10 recent notes for extraction context
"top_k": 15, # top-k notes returned by retrieval
}
# ==================== Entity & Relation Types ====================
ENTITY_TYPES = {
"Person": "People (names, roles)",
"Business": "Businesses / ventures",
"Location": "Places (cities, venues)",
"Event": "Events (competitions, festivals)",
"Activity": "Activities / hobbies",
"Artifact": "Objects / creations",
}
RELATION_TYPES = {
"OWNS": "owns / operates",
"STARTED": "founded",
"WORKS_AT": "works at",
"LEFT": "left",
"VISITED": "visited",
"LIVES_IN": "lives in",
"PARTICIPATED_IN": "participated in",
"HOSTED": "hosted",
"ENJOYS": "enjoys",
"PRACTICES": "practices",
"CREATED": "created",
"HAS": "has",
"READING": "is reading",
"RELATED_TO": "related to",
}
CRUD_OPS = ["CREATE", "UPDATE", "DELETE", "NOOP"]
# ==================== Embedding Configuration ====================
EMBEDDING_CONFIG = {
"model_path": "sentence-transformers/all-MiniLM-L6-v2",
"similarity_threshold": 0.65,
"use_embedding": True,
}
# ==================== System Configuration ====================
SYSTEM_CONFIG = {
"debug": False,
"max_hops": 2,
}
DATA_PATHS = {
"benchmark_file": "data/locomo_benchmark.json",
}