@@ -384,15 +384,21 @@ class DkgNodeRagasEvaluator {
384384 const scores = results . scores ;
385385 const summary = this . generateSummary ( scores ) ;
386386 const recommendations = this . generateRecommendations ( scores ) ;
387- const failures = this . analyzeFailures ( results . dataset , scores ) ;
387+ const detailedResults = results . detailedResults ;
388+
389+ const timestamp = new Date ( ) . toISOString ( ) ;
390+ const timestampFormatted = timestamp . replace ( / [: .] / g, "-" ) ;
388391
389392 const report = {
393+ timestamp : timestamp ,
390394 scores,
391395 summary,
392396 recommendations,
393- failures,
394- thresholds : this . config . thresholds ,
395- timestamp : new Date ( ) . toISOString ( ) ,
397+ detailedResults : detailedResults ,
398+ config : {
399+ thresholds : this . config . thresholds ,
400+ metrics : this . config . metrics ,
401+ } ,
396402 } ;
397403
398404 // Generate different report formats
@@ -401,24 +407,29 @@ class DkgNodeRagasEvaluator {
401407 const dbJson = this . generateDatabaseJSON ( scores ) ;
402408
403409 // Save reports to files
404- const timestamp = new Date ( ) . toISOString ( ) . replace ( / [: .] / g, "-" ) ;
405410 const reportsDir = path . join ( __dirname , "reports" ) ;
411+ const evaluationDir = path . join ( reportsDir , `evaluation-${ timestampFormatted } ` ) ;
406412
407- // Create reports directory if it doesn't exist
408- if ( ! fs . existsSync ( reportsDir ) ) {
409- fs . mkdirSync ( reportsDir , { recursive : true } ) ;
413+ // Create evaluation directory
414+ if ( ! fs . existsSync ( evaluationDir ) ) {
415+ fs . mkdirSync ( evaluationDir , { recursive : true } ) ;
410416 }
411417
412- // Save reports
413- const csvPath = path . join ( reportsDir , `ragas-report-${ timestamp } .csv` ) ;
418+ // Save main JSON report for dashboard
419+ const jsonReportPath = path . join ( evaluationDir , "evaluation-report.json" ) ;
420+ fs . writeFileSync ( jsonReportPath , JSON . stringify ( report , null , 2 ) ) ;
421+
422+ // Save additional formats
423+ const csvPath = path . join ( evaluationDir , `ragas-report-${ timestampFormatted } .csv` ) ;
414424 fs . writeFileSync ( csvPath , csvReport ) ;
415425
416- const htmlPath = path . join ( reportsDir , `ragas-report-${ timestamp } .html` ) ;
426+ const htmlPath = path . join ( evaluationDir , `ragas-report-${ timestampFormatted } .html` ) ;
417427 fs . writeFileSync ( htmlPath , htmlReport ) ;
418428
419429 const dbJsonPath = path . join ( __dirname , "ragas-results.json" ) ;
420430 fs . writeFileSync ( dbJsonPath , JSON . stringify ( dbJson , null , 2 ) ) ;
421431
432+ console . log ( `\n📁 Reports saved to: ${ evaluationDir } ` ) ;
422433 console . log ( `\n🎯 RAGAS Evaluation Summary:` ) ;
423434 console . log (
424435 `Overall Score: ${ ( summary . overall . averageScore * 100 ) . toFixed ( 1 ) } %` ,
0 commit comments