Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ Designed for **AI companions, role-playing NPCs, and multi-agent systems**, MemO
</div>


Get Free API: [Try API](https://memos-dashboard.openmem.net/quickstart/?source=github)
Get Free API: [Try API](https://memos-dashboard.openmem.net/quickstart/?source=github)


---

Expand All @@ -64,7 +64,7 @@ Get Free API: [Try API](https://memos-dashboard.openmem.net/quickstart/?source=g

- **Website**: https://memos.openmem.net/
- **Documentation**: https://memos-docs.openmem.net/home/overview/
- **API Reference**: https://memos-docs.openmem.net/docs/api/info/
- **API Reference**: https://memos-docs.openmem.net/api-reference/configure-memos/
- **Source Code**: https://github.com/MemTensor/MemOS

## 📰 News
Expand Down
8 changes: 5 additions & 3 deletions src/memos/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def _setup_logfile() -> Path:
logfile = Path(settings.MEMOS_DIR / "logs" / "memos.log")
logfile.parent.mkdir(parents=True, exist_ok=True)
logfile.touch(exist_ok=True)

return logfile


Expand Down Expand Up @@ -195,10 +196,11 @@ def close(self):
},
"file": {
"level": "DEBUG",
"class": "logging.handlers.RotatingFileHandler",
"class": "logging.handlers.TimedRotatingFileHandler",
"when": "midnight",
"interval": 1,
"backupCount": 3,
"filename": _setup_logfile(),
"maxBytes": 1024**2 * 10,
"backupCount": 10,
"formatter": "standard",
"filters": ["context_filter"],
},
Expand Down
17 changes: 3 additions & 14 deletions src/memos/mem_scheduler/monitors/dispatcher_monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,9 @@ def _check_pools_health(self) -> None:
pool_info=pool_info,
stuck_max_interval=4,
)
logger.info(f"Pool '{name}'. is_healthy: {is_healthy}. pool_info: {pool_info}")
if not is_healthy:
logger.info(f"Pool '{name}'. is_healthy: {is_healthy}. pool_info: {pool_info}")

with self._pool_lock:
if is_healthy:
pool_info["failure_count"] = 0
Expand Down Expand Up @@ -237,20 +239,7 @@ def _check_pool_health(

# Log health status with comprehensive information
if self.dispatcher:
# Check thread activity
active_threads = sum(
1
for t in threading.enumerate()
if t.name.startswith(executor._thread_name_prefix) # pylint: disable=protected-access
)

task_count = self.dispatcher.get_running_task_count()
max_workers = pool_info.get("max_workers", 0)
stuck_count = len(stuck_tasks)
logger.info(
f"Pool health check passed - {active_threads} active threads, "
f"{task_count} running tasks, pool size: {max_workers}, stuck tasks: {stuck_count}"
)

return True, ""

Expand Down
10 changes: 0 additions & 10 deletions src/memos/mem_scheduler/utils/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,12 +188,7 @@ def on_enqueue(
inst_rate = (1.0 / max(1e-3, dt)) if dt is not None else 0.0 # first sample: no spike
ls.last_enqueue_ts = now
ls.backlog += 1
old_lam = ls.lambda_ewma.value_at(now)
ls.lambda_ewma.update(inst_rate, now)
new_lam = ls.lambda_ewma.value_at(now)
logger.info(
f"[DEBUG enqueue] {label} backlog={ls.backlog} dt={dt if dt is not None else '—'}s inst={inst_rate:.3f} λ {old_lam:.3f}→{new_lam:.3f}"
)
self._label_topk[label].add(mem_cube_id)
ds = self._get_detail(label, mem_cube_id)
if ds:
Expand Down Expand Up @@ -226,12 +221,7 @@ def on_done(
ls.last_done_ts = now
if ls.backlog > 0:
ls.backlog -= 1
old_mu = ls.mu_ewma.value_at(now)
ls.mu_ewma.update(inst_rate, now)
new_mu = ls.mu_ewma.value_at(now)
logger.info(
f"[DEBUG done] {label} backlog={ls.backlog} dt={dt if dt is not None else '—'}s inst={inst_rate:.3f} μ {old_mu:.3f}→{new_mu:.3f}"
)
ds = self._detail_stats.get((label, mem_cube_id))
if ds:
prev_ts_d = ds.last_done_ts
Expand Down
18 changes: 0 additions & 18 deletions src/memos/memories/textual/tree_text_memory/retrieve/recall.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,6 @@ def retrieve(
# Merge and deduplicate by ID
combined = {item.id: item for item in graph_results + vector_results + bm25_results}

graph_ids = {item.id for item in graph_results}
combined_ids = set(combined.keys())
lost_ids = graph_ids - combined_ids

if lost_ids:
print(
f"[DEBUG] The following nodes were in graph_results but missing in combined: {lost_ids}"
)

return list(combined.values())

def retrieve_from_cube(
Expand Down Expand Up @@ -150,15 +141,6 @@ def retrieve_from_cube(
# Merge and deduplicate by ID
combined = {item.id: item for item in graph_results}

graph_ids = {item.id for item in graph_results}
combined_ids = set(combined.keys())
lost_ids = graph_ids - combined_ids

if lost_ids:
print(
f"[DEBUG] The following nodes were in graph_results but missing in combined: {lost_ids}"
)

return list(combined.values())

def _graph_recall(
Expand Down
Loading