Skip to content

Commit af5c940

Browse files
committed
feat: add tree.mode to config; modify scheduler config
1 parent 6653bea commit af5c940

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

src/memos/configs/mem_scheduler.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,11 @@ class BaseSchedulerConfig(BaseConfig):
2828
thread_pool_max_workers: int = Field(
2929
default=DEFAULT_THREAD_POOL_MAX_WORKERS,
3030
gt=1,
31-
lt=20,
3231
description=f"Maximum worker threads in pool (default: {DEFAULT_THREAD_POOL_MAX_WORKERS})",
3332
)
3433
consume_interval_seconds: float = Field(
3534
default=DEFAULT_CONSUME_INTERVAL_SECONDS,
3635
gt=0,
37-
le=60,
3836
description=f"Interval for consuming messages from queue in seconds (default: {DEFAULT_CONSUME_INTERVAL_SECONDS})",
3937
)
4038
auth_config_path: str | None = Field(

src/memos/configs/memory.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,11 @@ class TreeTextMemoryConfig(BaseTextMemoryConfig):
179179
),
180180
)
181181

182+
mode: str | None = Field(
183+
default="sync",
184+
description=("whether use asynchronous mode in memory add"),
185+
)
186+
182187

183188
class SimpleTreeTextMemoryConfig(TreeTextMemoryConfig):
184189
"""Simple tree text memory configuration class."""

src/memos/mem_scheduler/base_scheduler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def __init__(self, config: BaseSchedulerConfig):
8888

8989
# internal message queue
9090
self.max_internal_message_queue_size = self.config.get(
91-
"max_internal_message_queue_size", 100
91+
"max_internal_message_queue_size", 10000
9292
)
9393
self.memos_message_queue: Queue[ScheduleMessageItem] = Queue(
9494
maxsize=self.max_internal_message_queue_size

src/memos/memories/textual/tree.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,10 @@
3030
class TreeTextMemory(BaseTextMemory):
3131
"""General textual memory implementation for storing and retrieving memories."""
3232

33-
# Override the default mode to async for TreeTextMemory
34-
mode: str = "async"
35-
3633
def __init__(self, config: TreeTextMemoryConfig):
3734
"""Initialize memory with the given configuration."""
3835
# Set mode from class default or override if needed
39-
self.mode = getattr(self.__class__, "mode", "async")
36+
self.mode = config.mode
4037
self.config: TreeTextMemoryConfig = config
4138
self.extractor_llm: OpenAILLM | OllamaLLM | AzureLLM = LLMFactory.from_config(
4239
config.extractor_llm

0 commit comments

Comments
 (0)