feat: wire TKG builder into worker pipeline + face-face edges

- Auto-run tkg_builder.py after face trace store + Qdrant sync + trace chunks
- Add face-face CO_OCCURS_WITH edges (two traces in same frame)
- docs: TKG integration report for M4
This commit is contained in:
Accusys
2026-05-09 06:22:27 +08:00
parent b902763d45
commit a0774cb9ab
3 changed files with 172 additions and 1 deletions

View File

@@ -757,6 +757,29 @@ impl JobWorker {
Ok(n) => info!("✅ {} trace chunks created for {}", n, uuid_clone),
Err(e) => error!("❌ Trace chunk ingestion failed: {}", e),
}
// Build Temporal Knowledge Graph (TKG)
info!("📝 Building TKG graph...");
let executor = match crate::core::processor::PythonExecutor::new() {
Ok(ex) => ex,
Err(e) => {
error!("Failed to create PythonExecutor for TKG: {}", e);
return;
}
};
match executor
.run(
"tkg_builder.py",
&["--file-uuid", &uuid_clone],
Some(&uuid_clone),
"TKG_BUILDER",
Some(std::time::Duration::from_secs(300)),
)
.await
{
Ok(()) => info!("✅ TKG built for {}", uuid_clone),
Err(e) => error!("❌ TKG build failed for {}: {}", uuid_clone, e),
}
}
Err(e) => {
error!("❌ Face trace + DB store failed for {}: {}", uuid_clone, e)