Spaces:
Running
Running
ADAM v2.0: Advanced Agentic Mesh — DAG orchestrator, cognition, knowledge web, forge tools, runtime optimization
ba2ada2 | """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 | |
| # Backward compat: re-export AgentMemory from the old memory.py file | |
| # The old file is at shared/agent/memory.py (sibling of this package). | |
| # We use importlib to load it by file path to avoid the naming conflict | |
| # with this memory/ package directory. | |
| _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"] | |