tools.feature_atlas.import_interaction_analysis module
Step 6: Import interaction analyses into FalkorDB.
Reads outputs/interaction_analyses.jsonl and MERGEs each analysis
as an InteractionAnalysis node linked from its InteractionPrompt.
- Usage:
python -m tools.feature_atlas.import_interaction_analysis
# skull – WRITING THE DIAGNOSIS
- async tools.feature_atlas.import_interaction_analysis.import_analyses(analyses=None)[source]
Persist every interaction analysis into the atlas knowledge graph.
This is Step 6 of the Feature Atlas pipeline: it takes the per-pair analyses produced by the Gemini analysis swarm and writes each one into FalkorDB so the atlas captures how feature pairs interact, not just that they do. Persisting the analyses here is what makes the downstream query and demo-export steps able to surface real interaction insight.
Opens a connection to the
stargazer_feature_interaction_atlasgraph viaget_atlas_graph(which talks to FalkorDB over the shared Redis connection pool), then MERGEs each record throughmerge_interaction_analysisso the import is idempotent and safe to re-run. When noanalysesargument is supplied it falls back to_load_analyses(), readingoutputs/interaction_analyses.jsonlfrom the local filesystem. Per-record failures are logged and skipped rather than aborting the batch, and after the loop it runs a read-onlycount(InteractionAnalysis)query to log a verification total before closing the Redis client. Called byasync_main()in this module, which is in turn dispatched as Step 6 byrun_atlas.py‘sstep_import_analyses(imported there asasync_main as run).- Parameters:
analyses (
list[dict[str,Any]] |None) – Optional pre-loaded list of analysis dicts (each typically carryingsource_id/target_idkeys). WhenNone, the analyses are read fromoutputs/interaction_analyses.jsonlvia_load_analyses().- Returns:
The number of analyses successfully MERGEd into the atlas graph (records that raised during the merge are excluded from the count).
- Return type:
- async tools.feature_atlas.import_interaction_analysis.async_main()[source]
Run Step 6 end to end: load the analyses and import them into FalkorDB.
This is the coroutine that actually performs the import for command-line and orchestrated runs. It reads the analysis JSONL once for an accurate denominator, drives the FalkorDB import, and prints a human-readable summary so an operator can see how the step fared at a glance.
Reads
outputs/interaction_analyses.jsonlvia_load_analyses(), delegates the graph writes toimport_analyses()(which connects to thestargazer_feature_interaction_atlasgraph in FalkorDB), times the run, and writes a formatted report to stdout. It is invoked both bymain()here (viaasyncio.run) and byrun_atlas.py‘sstep_import_analyses, which imports it asasync_main as runand awaits it directly.- Returns:
All output is side effects – the FalkorDB writes performed by
import_analyses()and the summary printed to stdout.- Return type:
- tools.feature_atlas.import_interaction_analysis.main()[source]
Synchronous CLI entry point for the Step 6 import.
Provides the
python -m tools.feature_atlas.import_interaction_analysisentry point so the import can be run standalone. It exists to bridge the synchronous shell invocation into the async pipeline and to make sure progress is visible on the console.Configures root logging at INFO level (so the per-record import logs and the verification count emitted under
import_analyses()are shown), then runsasync_main()to completion viaasyncio.run. Called only from this module’sif __name__ == "__main__"guard; the orchestrated path inrun_atlas.pyawaitsasync_main()directly and does not go through this function.- Return type:
- Returns:
None.