| """Advanced Memory Systems — persistent knowledge and caching. |
| |
| Ultra-lightweight knowledge graph and predictive cache. |
| No external DB needed — uses JSON files for persistence |
| and in-memory structures for speed. |
| """ |
| import sys |
| import os |
|
|
| |
| |
| |
| |
| _this_dir = os.path.dirname(os.path.abspath(__file__)) |
| _parent_dir = os.path.dirname(_this_dir) |
| _old_memory_path = os.path.join(_parent_dir, "memory.py") |
| if os.path.exists(_old_memory_path): |
| import importlib.util |
| _spec = importlib.util.spec_from_file_location("_old_memory", _old_memory_path) |
| _mod = importlib.util.module_from_spec(_spec) |
| _spec.loader.exec_module(_mod) |
| AgentMemory = _mod.AgentMemory |
| else: |
| class AgentMemory: |
| """Fallback empty memory if old memory.py not found.""" |
| async def store(self, *args, **kwargs): pass |
| async def recall(self, *args, **kwargs): return [] |
| async def get_session_summary(self, *args, **kwargs): return "" |
| async def clear_session(self, *args, **kwargs): pass |
|
|
| from .knowledge_web import KnowledgeWeb |
| from .predictive_cache import PredictiveCache |
|
|
| __all__ = ["KnowledgeWeb", "PredictiveCache", "AgentMemory"] |
|
|