Commit 8b30a44
authored
refactor&fix: fix a range of bugs in scheduler and revise fine add apis (MemTensor#840)
* fix bugs: try to fix bugs in _submit_web_logs
* fix bugs: try to address bugs
* fix bugs
* refactor: modify examples
* revise add operation and fix an unbelievable bug
* address the bug issues
* the doc file has a format problem which has been fixed in this commit
* add a range of new feats for the add operation
* address the incompatible issue of local scheduler
* feat(scheduler): optimize redis queue consumer group management
- Proactively ensure consumer groups exist in '_refresh_stream_keys' for newly discovered streams.
- Remove redundant consumer group checks in '_read_new_messages_batch' to improve read performance.
- Clean up 'seen_streams' cache when streams are deleted to ensure correct group recreation.
- This change reduces unnecessary Redis calls during high-frequency polling.
* fix(tests): resolve AttributeError in SimpleStructMemReader tests
- Import 'parse_json_result' from 'memos.mem_reader.utils' instead of accessing it as an instance attribute.
- Fixes 'AttributeError: 'SimpleStructMemReader' object has no attribute 'parse_json_result'' in 'test_parse_json_result_success' and 'test_parse_json_result_failure'.
- Remove incorrect mock assignment of 'parse_json_result' in 'test_process_chat_data'.
* fix(mem_reader): pass info dict to add_before_search for correct user_id usage
- Update 'add_before_search' signature in 'SimpleStructMemReader' to accept 'info' dict.
- Pass 'info' (containing 'user_id' and 'session_id') to 'self.searcher.search' instead of using empty strings.
- Add 'test_add_before_search' to 'TestSimpleStructMemReader' to verify the fix and ensure 'searcher.search' receives the correct 'info'.
- This ensures that memory searches are scoped to the correct user and session.
* refactor add_before_search from mem_reader to SingleCubeView
* address bugs
* fix: fix the qsize bug of task queue, and accept change from hotfix/scheduler
* fix: address some issues to run old scheduler example and kv cache example
* fix: address the issue of Top-level import of unavailable module 'torch'
* fix: resolve linting errors and make optional dependencies lazy loaded
- Fix ambiguous characters and commented-out code in examples/mem_scheduler/quick_start_examples.py
- Fix nested if statements in src/memos/mem_os/core.py
- Move torch and transformers imports to method scope in src/memos/llms/hf.py to support optional dependencies
- Update tests/llms/test_hf.py to patch transformers module directly
* refactor: revise the rewrite prompt to make it better
* refactor: update examples
* refactor: update examples for scheduler
* fix bugs: address the unsupported xautoclaim command when redis version larger than 6.2.0 via adding a new feature of manul auto claim with the combination of xpending + xclaim
* refactor: review settings
* refactor: adjust examples to make it run better for code debugging
* refactor: review slow add apis to get a better performance on Halumen
* fix bugs: address the issue when set user_redis_queue to false, the status_tracker is still using
* refactor: allow the code to run without rabbitmq
* refactor: create a _parse_pending_entry for redis queue
* refactor: add a try/catch for status_tracker1 parent 5f811d4 commit 8b30a44
10 files changed
Lines changed: 313 additions & 140 deletions
File tree
- docker
- examples/mem_scheduler
- src/memos
- mem_reader
- mem_scheduler
- task_schedule_modules
- webservice_modules
- templates
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
| 207 | + | |
207 | 208 | | |
208 | 209 | | |
209 | 210 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
| 126 | + | |
126 | 127 | | |
127 | 128 | | |
128 | 129 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
149 | | - | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
150 | 152 | | |
151 | 153 | | |
152 | 154 | | |
| |||
159 | 161 | | |
160 | 162 | | |
161 | 163 | | |
162 | | - | |
| 164 | + | |
163 | 165 | | |
164 | 166 | | |
165 | 167 | | |
166 | 168 | | |
167 | | - | |
| 169 | + | |
168 | 170 | | |
169 | 171 | | |
170 | 172 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
| 60 | + | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
614 | 614 | | |
615 | 615 | | |
616 | 616 | | |
617 | | - | |
| 617 | + | |
618 | 618 | | |
619 | 619 | | |
620 | | - | |
621 | | - | |
622 | 620 | | |
623 | 621 | | |
624 | 622 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
228 | | - | |
| 228 | + | |
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
| |||
305 | 305 | | |
306 | 306 | | |
307 | 307 | | |
308 | | - | |
| 308 | + | |
309 | 309 | | |
310 | 310 | | |
311 | 311 | | |
| |||
314 | 314 | | |
315 | 315 | | |
316 | 316 | | |
317 | | - | |
| 317 | + | |
| 318 | + | |
318 | 319 | | |
319 | 320 | | |
320 | 321 | | |
| |||
869 | 870 | | |
870 | 871 | | |
871 | 872 | | |
| 873 | + | |
| 874 | + | |
872 | 875 | | |
873 | 876 | | |
874 | 877 | | |
| |||
Lines changed: 0 additions & 31 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
112 | | - | |
113 | 111 | | |
114 | 112 | | |
115 | 113 | | |
| |||
118 | 116 | | |
119 | 117 | | |
120 | 118 | | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | 119 | | |
151 | 120 | | |
152 | 121 | | |
| |||
0 commit comments