Skip to content

Graph-Native Infrastructure for Context and Accountable AI Systems

fix: Add GraphStore validation for decision tracking components

KaifAhmad1ac51b74928c5
diff --git a/semantica/context/agent_context.py b/semantica/context/agent_context.py
index 1dd9eb06..6a2ecaaa 100644
--- a/semantica/context/agent_context.py
+++ b/semantica/context/agent_context.py
@@ -226,6 +226,20 @@ class AgentContext:
self._policy_engine = None
if enable_decision_tracking and knowledge_graph:
+ # Validate that knowledge_graph supports required GraphStore interface
+ if not hasattr(knowledge_graph, 'execute_query'):
+ self.logger.error(
+ "Decision tracking requires a GraphStore-compatible knowledge graph with execute_query() method. "
+ "Provided knowledge_graph type does not support Cypher queries. "
+ "Use GraphStore (Neo4j, FalkorDB) or disable decision tracking."
+ )
+ raise ValueError(
+ "Decision tracking requires a GraphStore-compatible knowledge graph. "
+ "The provided knowledge_graph does not have an execute_query() method. "
+ "For decision tracking, use a GraphStore backend (Neo4j, FalkorDB) "
+ "or set enable_decision_tracking=False."
+ )
+
# Initialize enhanced decision tracking components
try:
self._decision_recorder = DecisionRecorder(knowledge_graph)