MCPcopy Create free account
hub / github.com/Claw-AI-Lab/Claw-AI-Lab / load_all

Method load_all

backend/agent/researchclaw/evolution.py:376–390  ·  view source on GitHub ↗

Load all lessons from disk.

(self)

Source from the content-addressed store, hash-verified

374 logger.info("Appended %d lessons to evolution store", len(lessons))
375
376 def load_all(self) -> list[LessonEntry]:
377 """Load all lessons from disk."""
378 if not self._lessons_path.exists():
379 return []
380 lessons: list[LessonEntry] = []
381 for line in self._lessons_path.read_text(encoding="utf-8").splitlines():
382 line = line.strip()
383 if not line:
384 continue
385 try:
386 data = json.loads(line)
387 lessons.append(LessonEntry.from_dict(data))
388 except (json.JSONDecodeError, TypeError):
389 continue
390 return lessons
391
392 def query_for_stage(
393 self, stage_name: str, *, max_lessons: int = 5

Callers 4

test_append_and_loadMethod · 0.95
query_for_stageMethod · 0.95
countMethod · 0.95

Calls 2

appendMethod · 0.45
from_dictMethod · 0.45

Tested by 2

test_append_and_loadMethod · 0.76