Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
114 commits
Select commit Hold shift + click to select a range
11b63e6
debug an error function name
tangg555 Oct 20, 2025
72e8f39
feat: Add DynamicCache compatibility for different transformers versions
tangg555 Oct 20, 2025
5702870
feat: implement APIAnalyzerForScheduler for memory operations
tangg555 Oct 21, 2025
4655b41
feat: Add search_ws API endpoint and enhance API analyzer functionality
tangg555 Oct 21, 2025
c20736c
fix: resolve test failures and warnings in test suite
tangg555 Oct 21, 2025
da72e7e
feat: add a test_robustness execution to test thread pool execution
tangg555 Oct 21, 2025
5b9b1e4
feat: optimize scheduler configuration and API search functionality
tangg555 Oct 22, 2025
6dac11e
feat: Add Redis auto-initialization with fallback strategies
tangg555 Oct 22, 2025
a207bf4
feat: add database connection management to ORM module
tangg555 Oct 24, 2025
8c1cc04
remove part of test
tangg555 Oct 24, 2025
f2b0da4
feat: add Redis-based ORM with multiprocess synchronization
tangg555 Oct 24, 2025
f0e8aab
fix: resolve scheduler module import and Redis integration issues
tangg555 Oct 24, 2025
731f00d
revise naive memcube creation in server router
tangg555 Oct 25, 2025
6d442fb
remove long-time tests in test_scheduler
tangg555 Oct 25, 2025
157f858
remove redis test which needs .env
tangg555 Oct 25, 2025
c483011
refactor all codes about mixture search with scheduler
tangg555 Oct 25, 2025
b81b82e
fix: resolve Redis API synchronization issues and implement search AP…
tangg555 Oct 26, 2025
90d1a0b
remove a test for api module
tangg555 Oct 26, 2025
1de72cf
revise to pass the test suite
tangg555 Oct 26, 2025
c72858e
addressed all conflicts
tangg555 Oct 27, 2025
3245376
address some bugs to make mix_search normally running
tangg555 Oct 27, 2025
57482cf
modify codes according to evaluation logs
tangg555 Oct 27, 2025
e4b8313
Merge remote-tracking branch 'upstream/dev' into dev
tangg555 Oct 27, 2025
011d248
Merge remote-tracking branch 'upstream/dev' into dev
tangg555 Oct 28, 2025
8c8d672
feat: Optimize mixture search and enhance API client
tangg555 Oct 28, 2025
aabad8d
feat: Add conversation_turn tracking for session-based memory search
tangg555 Oct 28, 2025
3faa5c3
Merge remote-tracking branch 'upstream/dev' into dev
tangg555 Oct 28, 2025
c6376cd
adress time bug in monitor
tangg555 Oct 29, 2025
bd0b234
revise simple tree
tangg555 Oct 29, 2025
5332d12
add mode to evaluation client; rewrite print to logger.info in db files
tangg555 Oct 29, 2025
aee13ba
feat: 1. add redis queue for scheduler 2. finish the code related to …
tangg555 Nov 5, 2025
f957967
debug the working memory code
tangg555 Nov 5, 2025
f520cca
addressed conflicts to merge
tangg555 Nov 5, 2025
a3f6636
addressed a range of bugs to make scheduler running correctly
tangg555 Nov 5, 2025
47e9851
Merge remote-tracking branch 'upstream/dev' into dev
tangg555 Nov 5, 2025
161af12
remove test_dispatch_parallel test
tangg555 Nov 5, 2025
1d8d14b
print change to logger.info
tangg555 Nov 5, 2025
00e3a75
addressed conflicts
tangg555 Nov 6, 2025
2852e56
adjucted the core code related to fine and mixture apis
tangg555 Nov 17, 2025
5d3cf45
addressed conflicts
tangg555 Nov 17, 2025
ab71f17
feat: create task queue to wrap local queue and redis queue. queue no…
tangg555 Nov 18, 2025
7665cda
fix bugs: debug bugs about internet trigger
tangg555 Nov 18, 2025
3559323
debug get searcher mode
tangg555 Nov 18, 2025
7c8e0d0
feat: add manual internet
fridayL Nov 18, 2025
27b0971
Merge branch 'feat/redis_scheduler' of https://github.com/MemTensor/M…
fridayL Nov 18, 2025
94d456b
Fix: fix code format
fridayL Nov 18, 2025
87b5358
feat: add strategy for fine search
tangg555 Nov 18, 2025
127fdc7
debug redis queue
tangg555 Nov 18, 2025
0911ced
debug redis queue
tangg555 Nov 18, 2025
d1a7261
fix bugs: completely addressed bugs about redis queue
tangg555 Nov 18, 2025
232be6f
refactor: add searcher to handler_init; remove info log from task_queue
tangg555 Nov 19, 2025
d16a7c8
Merge remote-tracking branch 'upstream/dev' into dev
tangg555 Nov 19, 2025
bc7236f
refactor: modify analyzer
tangg555 Nov 19, 2025
afaf8df
refactor: revise locomo_eval to make it support llm other than gpt-4o…
tangg555 Nov 19, 2025
0b02d3c
feat: develop advanced searcher with deep search
tangg555 Nov 20, 2025
2097eae
feat: finish a complete version of deep search
tangg555 Nov 21, 2025
aff2932
refactor: refactor deep search feature, now only allowing one-round d…
tangg555 Nov 24, 2025
4226a77
feat: implement the feature of get_tasks_status, but completed tasks …
tangg555 Nov 24, 2025
e27483c
Merge remote-tracking branch 'upstream/dev' into dev
tangg555 Nov 24, 2025
51964ec
debuging merged code; searching memories have bugs
tangg555 Nov 24, 2025
1e28ee5
change logging level
tangg555 Nov 24, 2025
e0001ea
debug api evaluation
tangg555 Nov 24, 2025
bae7022
fix bugs: change top to top_k
tangg555 Nov 24, 2025
d6cf824
Merge remote-tracking branch 'upstream/dev' into dev
tangg555 Nov 24, 2025
742df4e
change log
tangg555 Nov 24, 2025
9b310c4
refactor: rewrite deep search to make it work better
tangg555 Nov 25, 2025
7e4cfc5
change num_users
tangg555 Nov 26, 2025
c0cadac
feat: developed and test task broker and orchestrator
tangg555 Nov 26, 2025
e0eb490
Fix: Include task_id in ScheduleMessageItem serialization
Nov 29, 2025
2606fc7
Fix(Scheduler): Correct event log creation and task_id serialization
Nov 29, 2025
b3a6f1b
Feat(Scheduler): Add conditional detailed logging for KB updates
Nov 29, 2025
4b2cc2f
Fix(Scheduler): Correct create_event_log call sites
Nov 29, 2025
d8726ec
Fix(Scheduler): Deserialize task_id in ScheduleMessageItem.from_dict
Nov 29, 2025
b8cc42a
Refactor(Config): Centralize RabbitMQ config override logic
Nov 29, 2025
b6ebee6
Revert "Refactor(Config): Centralize RabbitMQ config override logic"
Nov 29, 2025
702d3e1
Fix(Redis): Convert None task_id to empty string during serialization
Nov 29, 2025
975e585
Feat(Log): Add diagnostic log to /product/add endpoint
Nov 29, 2025
bceaf68
Merge branch 'dev' into hotfix/task-id-loss
glin93 Nov 29, 2025
82a95c4
Feat(Log): Add comprehensive diagnostic logs for /product/add flow
Nov 29, 2025
c5631cc
Feat(Log): Add comprehensive diagnostic logs for /product/add flow an…
Nov 29, 2025
600fe24
Fix(rabbitmq): Use env vars for KB updates and improve logging
Nov 29, 2025
1da7c71
Fix(rabbitmq): Explicitly use MEMSCHEDULER_RABBITMQ_EXCHANGE_NAME and…
Nov 29, 2025
f32399b
Fix(add_handler): Update diagnostic log timestamp
Nov 29, 2025
42fea63
Fix(add_handler): Update diagnostic log timestamp again (auto-updated)
Nov 29, 2025
003a169
Update default scheduler redis stream prefix
Nov 29, 2025
6b5d5c6
Update diagnostic timestamp in add handler
Nov 29, 2025
5339b08
Allow optional log_content in scheduler event log
Nov 29, 2025
e1304c1
feat: new examples to test scheduelr
tangg555 Dec 1, 2025
045d154
feat: fair scheduler and refactor of search function
tangg555 Dec 1, 2025
85611c8
Merge remote-tracking branch 'upstream/hotfix/task-id-loss' into dev
tangg555 Dec 1, 2025
4aaeb54
fix bugs: address bugs caused by outdated test code
tangg555 Dec 1, 2025
480c8e3
feat: add task_schedule_monitor
tangg555 Dec 1, 2025
c49a498
fix: handle nil mem_cube in scheduler message consumers
Dec 2, 2025
b772d88
fix bugs: response messaged changed in memos code
tangg555 Dec 1, 2025
630c21c
refactor: revise task queue to allow it dealing with pending tasks wh…
tangg555 Dec 1, 2025
198aade
refactor: revise mixture search and scheduler logger
tangg555 Dec 2, 2025
5ba44d6
Merge remote-tracking branch 'upstream/dev' into dev
tangg555 Dec 2, 2025
28e1368
Fix scheduler task tracking
Dec 2, 2025
173bebc
fix bugs: address ai review issues
tangg555 Dec 2, 2025
9708f4d
Merge remote-tracking branch 'upstream/dev' into dev
tangg555 Dec 2, 2025
6746563
fix bugs: address rabbitmq initialization failed when doing pytest
tangg555 Dec 2, 2025
9613258
fix(scheduler): Correct dispatcher task and future tracking
Dec 2, 2025
8d7053b
Remove dump.rdb
tangg555 Dec 2, 2025
73b4711
fix bugs: revised message ack logics; refactor add log function
tangg555 Dec 2, 2025
11654e5
Merge remote-tracking branch 'upstream/dev' into dev
tangg555 Dec 2, 2025
bcd5d8f
fix bugs: change Chinese notation to English
tangg555 Dec 2, 2025
5b6cd2e
fix indent error in logger
Dec 2, 2025
48a3e9d
fix bugs: addressed the issues caused by multiprocessing codes obtain…
tangg555 Dec 2, 2025
13abb20
addMemory/updateMemory log
Dec 2, 2025
eeb31ed
Merge origin/dev into scheduler
Dec 2, 2025
9198b85
fix bugs: modify redis queue logics to make it run as expected
tangg555 Dec 2, 2025
4c10503
feat: add a default mem cube initialization for scheduler
tangg555 Dec 2, 2025
3ac309d
Merge remote-tracking branch 'upstream/dev' into dev
tangg555 Dec 2, 2025
fb6ddc5
Merge remote-tracking branch 'upstream/scheduler' into dev
tangg555 Dec 2, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 41 additions & 1 deletion src/memos/mem_scheduler/base_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from memos.log import get_logger
from memos.mem_cube.base import BaseMemCube
from memos.mem_cube.general import GeneralMemCube
from memos.mem_scheduler.general_modules.init_components_for_scheduler import init_components
from memos.mem_scheduler.general_modules.misc import AutoDroppingQueue as Queue
from memos.mem_scheduler.general_modules.scheduler_logger import SchedulerLoggerModule
from memos.mem_scheduler.memory_manage_modules.retriever import SchedulerRetriever
Expand Down Expand Up @@ -154,7 +155,9 @@ def __init__(self, config: BaseSchedulerConfig):
self._context_lock = threading.Lock()
self.current_user_id: UserID | str | None = None
self.current_mem_cube_id: MemCubeID | str | None = None
self.current_mem_cube: BaseMemCube | None = None
self.components = init_components()
self.current_mem_cube: BaseMemCube | None = self.components["naive_mem_cube"]
self._mem_cubes: dict[str, BaseMemCube] = {}
self.auth_config_path: str | Path | None = self.config.get("auth_config_path", None)
self.auth_config = None
self.rabbitmq_config = None
Expand Down Expand Up @@ -256,6 +259,43 @@ def mem_cube(self, value: BaseMemCube) -> None:
self.current_mem_cube = value
self.retriever.mem_cube = value

@property
def mem_cubes(self) -> dict[str, BaseMemCube]:
"""All available memory cubes registered to the scheduler.

Setting this property will also initialize `current_mem_cube` if it is not
already set, following the initialization pattern used in component_init.py
(i.e., calling `init_mem_cube(...)`), without introducing circular imports.
"""
return self._mem_cubes

@mem_cubes.setter
def mem_cubes(self, value: dict[str, BaseMemCube]) -> None:
self._mem_cubes = value or {}

# Initialize current_mem_cube if not set yet and mem_cubes are available
try:
if self.current_mem_cube is None and self._mem_cubes:
selected_cube: BaseMemCube | None = None

# Prefer the cube matching current_mem_cube_id if provided
if self.current_mem_cube_id and self.current_mem_cube_id in self._mem_cubes:
selected_cube = self._mem_cubes[self.current_mem_cube_id]
else:
# Fall back to the first available cube deterministically
first_id, first_cube = next(iter(self._mem_cubes.items()))
self.current_mem_cube_id = first_id
selected_cube = first_cube

if selected_cube is not None:
# Use init_mem_cube to mirror component_init.py behavior
# This sets self.mem_cube (and retriever.mem_cube), text_mem, and searcher.
self.init_mem_cube(mem_cube=selected_cube)
except Exception as e:
logger.warning(
f"Failed to initialize current_mem_cube from mem_cubes: {e}", exc_info=True
)

def transform_working_memories_to_monitors(
self, query_keywords, memories: list[TextualMemoryItem]
) -> list[MemoryMonitorItem]:
Expand Down
Loading
Loading