dasein-core 0.2.6__py3-none-any.whl → 0.2.7__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
dasein/api.py CHANGED
@@ -2895,7 +2895,23 @@ Follow these rules when planning your actions."""
2895
2895
  return tools_metadata
2896
2896
 
2897
2897
  tools_metadata = _extract_tool_metadata(self._agent)
2898
+
2899
+ # Reuse existing graph analysis (already extracted in __init__)
2900
+ graph_metadata = None
2901
+ if self._is_langgraph and hasattr(self._agent, 'get_graph'):
2902
+ try:
2903
+ graph = self._agent.get_graph()
2904
+ graph_metadata = {
2905
+ 'nodes': list(graph.nodes.keys()),
2906
+ 'edges': [{'source': e.source, 'target': e.target} for e in graph.edges],
2907
+ 'is_multi_agent': len(graph.nodes) > 1
2908
+ }
2909
+ print(f"[DASEIN] Extracted graph metadata: {len(graph_metadata['nodes'])} nodes, {len(graph_metadata['edges'])} edges")
2910
+ except Exception:
2911
+ pass
2912
+
2898
2913
  print(f"[DASEIN] Extracted metadata for {len(tools_metadata)} tools")
2914
+
2899
2915
  if tools_metadata:
2900
2916
  print(f"[DASEIN] Sample tool: {tools_metadata[0].get('name', 'unknown')}")
2901
2917
  else:
@@ -2915,7 +2931,8 @@ Follow these rules when planning your actions."""
2915
2931
  step_id=self._current_step_id, # Pass step_id for parallel execution tracking
2916
2932
  post_run_mode=self._post_run, # Pass post_run mode ("full" or "kpi_only")
2917
2933
  wait_for_synthesis=wait_for_synthesis, # Wait for synthesis on retry runs (except last)
2918
- tools_metadata=tools_metadata # Tool metadata for Stage 3.5 tool grounding
2934
+ tools_metadata=tools_metadata, # Tool metadata for Stage 3.5 tool grounding
2935
+ graph_metadata=graph_metadata # Graph metadata for Stage 3.5 node grounding
2919
2936
  )
2920
2937
 
2921
2938
  # response is a dict from ServiceAdapter; handle accordingly
@@ -32,7 +32,8 @@ class RuleSynthesisRequest:
32
32
  skip_synthesis: bool = False
33
33
  wait_for_synthesis: bool = False
34
34
  step_id: Optional[str] = None
35
- tools_metadata: Optional[List[Dict[str, Any]]] = None # Tool metadata for Stage 3.5 grounding
35
+ tools_metadata: Optional[List[Dict[str, Any]]] = None # Tool metadata for Stage 3.5 tool grounding
36
+ graph_metadata: Optional[Dict[str, Any]] = None # Graph metadata for Stage 3.5 node grounding
36
37
 
37
38
 
38
39
  @dataclass
@@ -96,7 +97,8 @@ class PostRunClient:
96
97
  "performance_tracking_id": request.performance_tracking_id,
97
98
  "skip_synthesis": request.skip_synthesis,
98
99
  "wait_for_synthesis": request.wait_for_synthesis,
99
- "tools_metadata": request.tools_metadata or [], # Tool metadata for Stage 3.5 grounding
100
+ "tools_metadata": request.tools_metadata or [], # Tool metadata for Stage 3.5 tool grounding
101
+ "graph_metadata": request.graph_metadata or {}, # Graph metadata for Stage 3.5 node grounding
100
102
  }
101
103
 
102
104
  logger.info(f"Synthesizing rules for run: {request.run_id}")
@@ -95,7 +95,8 @@ class ServiceAdapter:
95
95
  max_rules: Optional[int] = 5, performance_tracking_id: Optional[str] = None,
96
96
  skip_synthesis: bool = False, agent_fingerprint: Optional[str] = None,
97
97
  step_id: Optional[str] = None, post_run_mode: str = "full",
98
- wait_for_synthesis: bool = False, tools_metadata: Optional[List[Dict[str, Any]]] = None) -> Dict[str, Any]:
98
+ wait_for_synthesis: bool = False, tools_metadata: Optional[List[Dict[str, Any]]] = None,
99
+ graph_metadata: Optional[Dict[str, Any]] = None) -> Dict[str, Any]:
99
100
  """
100
101
  Synthesize rules from run telemetry (replaces local rule synthesis)
101
102
 
@@ -139,7 +140,8 @@ class ServiceAdapter:
139
140
  skip_synthesis=should_skip_synthesis,
140
141
  wait_for_synthesis=wait_for_synthesis,
141
142
  step_id=step_id,
142
- tools_metadata=tools_metadata
143
+ tools_metadata=tools_metadata,
144
+ graph_metadata=graph_metadata
143
145
  )
144
146
 
145
147
  response = self.post_run_client.synthesize_rules(request)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dasein-core
3
- Version: 0.2.6
3
+ Version: 0.2.7
4
4
  Summary: Universal memory for agentic AI. Attach a brain to any LangChain/LangGraph agent in a single line.
5
5
  Author-email: Dasein Team <support@dasein.ai>
6
6
  License: MIT
@@ -1,6 +1,6 @@
1
1
  dasein/__init__.py,sha256=RY0lhaaWB6yJ_5YMRmaHDvQ0eFbc0BGbYNe5OVyxzYE,2316
2
2
  dasein/advice_format.py,sha256=5-h4J24L_B2Y9dlmyDuIYtmPCWOGAYoinBEXqpcNg2s,5386
3
- dasein/api.py,sha256=Ii4_RNFtml3fA2Kt2Et_19RkXoL6OkQ91gkvvFNnP5g,176478
3
+ dasein/api.py,sha256=KIWZ5I_8in2xas50IAfUOCmZgjaaXYxPcM0BgMx7Bs0,177347
4
4
  dasein/capture.py,sha256=XrEPsteG5__csqcqXzOmBSzPYgeI-OFzu3IRVMPYj3w,83814
5
5
  dasein/config.py,sha256=lXO8JG4RXbodn3gT5yEnuB0VRwWdrRVwhX3Rm06IZmU,1957
6
6
  dasein/events.py,sha256=mG-lnOvQoZUhXbrPSjrG4RME6ywUcbSZ04PscoJ15GI,12896
@@ -10,12 +10,12 @@ dasein/injector.py,sha256=EItWhlG6oMAf_D7YJnRNyDwAQIK5MsaATu1ig3OENqM,7256
10
10
  dasein/trace_buffer.py,sha256=bIyTpU8ZrNFR_TCwS43HvzUrDHpZ2F8pLVDeUE9jpwM,4117
11
11
  dasein/types.py,sha256=FjGXZowiRYZzWj5GzSnAnA_-xwYqqE7WmXFCosVyGI8,2974
12
12
  dasein/services/__init__.py,sha256=0o6vKEVSYgGo-u-xDFf7Z4cQr8gIht2YovD6eEXUquE,356
13
- dasein/services/post_run_client.py,sha256=qYT9qp2O1MecYiTLRjFBIJy8mfZ_FTntmK-_I-7-YlI,4552
13
+ dasein/services/post_run_client.py,sha256=UjK3eqf7oWGSuWkKe0vQmeMS0yUUOhYFD4-SZ7uj8WY,4768
14
14
  dasein/services/pre_run_client.py,sha256=tXmz_PQaSfq0xwypiWUAqNkXOmREZ6EwXLC4OM89J-A,4317
15
- dasein/services/service_adapter.py,sha256=0oMDoKDWkZ17jMCVBuDMJ9TMVmfRie4q4PLMIpiV_uw,7230
15
+ dasein/services/service_adapter.py,sha256=YHk41lR3PXh8WTmxOzzwKf6hwPYGqIdApI92vQKlkAY,7350
16
16
  dasein/services/service_config.py,sha256=8_4tpV4mZvfaOc5_yyHbOyL4rYsPHzkLTEY1rtYgLs8,1629
17
- dasein_core-0.2.6.dist-info/licenses/LICENSE,sha256=7FHjIFEKl_3hSc3tGUVEWmufC_3oi8rh_2zVuL7jMKs,1091
18
- dasein_core-0.2.6.dist-info/METADATA,sha256=Z30TeYgJc6ms5g7gaKCpfvOV9TiOehgXI9sO-uuowdQ,10192
19
- dasein_core-0.2.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
20
- dasein_core-0.2.6.dist-info/top_level.txt,sha256=6yYY9kltjvvPsg9K6KyMKRtzEr5qM7sHXN7VzmrDtp0,7
21
- dasein_core-0.2.6.dist-info/RECORD,,
17
+ dasein_core-0.2.7.dist-info/licenses/LICENSE,sha256=7FHjIFEKl_3hSc3tGUVEWmufC_3oi8rh_2zVuL7jMKs,1091
18
+ dasein_core-0.2.7.dist-info/METADATA,sha256=M7zLIt6gXOfna7oFIMtqECJMqSU4WufP8g2IoeMJqKk,10192
19
+ dasein_core-0.2.7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
20
+ dasein_core-0.2.7.dist-info/top_level.txt,sha256=6yYY9kltjvvPsg9K6KyMKRtzEr5qM7sHXN7VzmrDtp0,7
21
+ dasein_core-0.2.7.dist-info/RECORD,,