JatinAutonomousLabs commited on
Commit
7042006
Β·
verified Β·
1 Parent(s): aa162f5

Update graph_merged_simple.py

Browse files
Files changed (1) hide show
  1. graph_merged_simple.py +13 -5
graph_merged_simple.py CHANGED
@@ -891,14 +891,15 @@ def build_full_graph() -> StateGraph:
891
 
892
 
893
  # =============================================================================
894
- # SECTION 8: GRAPH COMPILATION
895
  # =============================================================================
896
 
897
- # Build and compile tier-specific graphs
898
  lite_workflow = build_lite_graph()
899
  standard_workflow = build_standard_graph()
900
  full_workflow = build_full_graph()
901
 
 
902
  lite_app = lite_workflow.compile()
903
  standard_app = standard_workflow.compile()
904
  full_app = full_workflow.compile()
@@ -906,11 +907,18 @@ full_app = full_workflow.compile()
906
  # Default app (standard)
907
  main_app = standard_app
908
 
 
 
 
 
 
 
 
909
  log.info("=" * 60)
910
  log.info("βœ… GRAPHS COMPILED SUCCESSFULLY")
911
- log.info(f" - Lite: Memory β†’ Synthesis β†’ Archive")
912
- log.info(f" - Standard: Memory β†’ Intent β†’ PM β†’ Experimenter/Research β†’ Synthesis β†’ QA β†’ Archive")
913
- log.info(f" - Full: + Observer monitoring")
914
  log.info("=" * 60)
915
 
916
 
 
891
 
892
 
893
  # =============================================================================
894
+ # SECTION 8: GRAPH COMPILATION (UPDATED)
895
  # =============================================================================
896
 
897
+ # Build tier-specific graphs
898
  lite_workflow = build_lite_graph()
899
  standard_workflow = build_standard_graph()
900
  full_workflow = build_full_graph()
901
 
902
+ # Compile with explicit recursion limits to prevent infinite loops
903
  lite_app = lite_workflow.compile()
904
  standard_app = standard_workflow.compile()
905
  full_app = full_workflow.compile()
 
907
  # Default app (standard)
908
  main_app = standard_app
909
 
910
+ # CRITICAL: Set maximum recursion limits in config
911
+ CONFIG_RECURSION_LIMITS = {
912
+ "lite": 10, # Memory β†’ Synthesis β†’ Archive (3 nodes + buffer)
913
+ "standard": 25, # Full path + 1 rework: ~12-14 nodes
914
+ "full": 100 # Full path + 3 reworks: ~20-24 nodes
915
+ }
916
+
917
  log.info("=" * 60)
918
  log.info("βœ… GRAPHS COMPILED SUCCESSFULLY")
919
+ log.info(f" - Lite: Memory β†’ Synthesis β†’ Archive (limit: {CONFIG_RECURSION_LIMITS['lite']})")
920
+ log.info(f" - Standard: Full path + 1 rework (limit: {CONFIG_RECURSION_LIMITS['standard']})")
921
+ log.info(f" - Full: Full path + 3 reworks (limit: {CONFIG_RECURSION_LIMITS['full']})")
922
  log.info("=" * 60)
923
 
924