Load agent state.
(self, load_path: str)
| 494 | print(f"[Zep] Agent state saved to: {save_dir}") |
| 495 | |
| 496 | def load_agent(self, load_path: str) -> bool: |
| 497 | """Load agent state.""" |
| 498 | load_dir = Path(load_path) |
| 499 | if not load_dir.exists(): |
| 500 | print(f"[Zep] Load path not found: {load_dir}") |
| 501 | return False |
| 502 | |
| 503 | metadata_path = load_dir / "metadata.json" |
| 504 | if metadata_path.exists(): |
| 505 | with open(metadata_path, "r") as f: |
| 506 | metadata = json.load(f) |
| 507 | |
| 508 | self._current_user_id = metadata.get("user_id") |
| 509 | self._current_graph_id = metadata.get("graph_id") |
| 510 | self._current_thread_id = metadata.get("thread_id") |
| 511 | self._context_id = metadata.get("context_id") |
| 512 | |
| 513 | print(f"[Zep] Agent state loaded from: {load_dir}") |
| 514 | return True |
| 515 | |
| 516 | @property |
| 517 | def memory_count(self) -> int: |