FinceptTerminal is a modern finance application offering advanced market analytics, investment research, and economic data tools, designed for interactive exploration and data-driven decision-making in a user-friendly environment.
C++ ai-agentsalgorithmic-tradingbloomberg-terminalcppfinancefinancial-marketsfintechgood-first-issueinvestmentinvestment-researchmachine-learningopensourcepythonqtquantitative-financestock-markettrading
refactor(finagent): clean up AgenticMemoryModule imports and tests
tilakpatel2284b21522632b
diff --git a/fincept-qt/scripts/agents/finagent_core/modules/memory_module.py b/fincept-qt/scripts/agents/finagent_core/modules/memory_module.pyindex 9cfb0be3e..89b778017 100644--- a/fincept-qt/scripts/agents/finagent_core/modules/memory_module.py+++ b/fincept-qt/scripts/agents/finagent_core/modules/memory_module.py@@ -11,10 +11,13 @@ Provides:"""from typing import Dict, Any, Optional, List, Callable+from pathlib import Pathimport loggingimport jsonfrom datetime import datetime+from finagent_core import resources+logger = logging.getLogger(__name__)@@ -323,16 +326,15 @@ class AgenticMemoryModule:Args:user_id: User ID+ agent_id: Agent IDdb_path: Database pathenable_auto_store: Allow agent to auto-storemax_memories: Maximum memories to keep"""- from finagent_core import resourcesself.user_id = user_idself.agent_id = agent_idself.db_path = db_path or resources.agentic_memory_db(user_id, agent_id)- from pathlib import Path as _P- _P(self.db_path).parent.mkdir(parents=True, exist_ok=True)+ Path(self.db_path).parent.mkdir(parents=True, exist_ok=True)self.enable_auto_store = enable_auto_storeself.max_memories = max_memoriesdiff --git a/fincept-qt/scripts/agents/finagent_core/tests/test_agentic_memory_isolation.py b/fincept-qt/scripts/agents/finagent_core/tests/test_agentic_memory_isolation.pyindex e4b711390..e81a4a77a 100644--- a/fincept-qt/scripts/agents/finagent_core/tests/test_agentic_memory_isolation.py+++ b/fincept-qt/scripts/agents/finagent_core/tests/test_agentic_memory_isolation.py@@ -1,5 +1,3 @@-import os-import pytestfrom finagent_core.modules.memory_module import AgenticMemoryModule@@ -46,5 +44,6 @@ def test_explicit_db_path_overrides_default(monkeypatch, tmp_path):mod = AgenticMemoryModule.from_config({"user_id": "alice", "agent_id": "x", "db_path": str(custom)})+ assert mod.db_path == str(custom)mod.store("hello", memory_type="fact")assert custom.exists()