Orchestration, Pipeline, And Output Agents#

These agents organize complete workflows and convert processing results into interpretable, exportable, or reproducible products.

WorkflowOrchestratorAgent#

WorkflowOrchestratorAgent classifies a natural-language request, selects a workflow type, builds the corresponding AgentCoordinator chain, and runs or previews the workflow.

Supported routed workflows include QC, phase analysis, pre-inversion, AI inversion, Inv2D, Inv3D, ensemble inversion, joint inversion, ModEM preparation, and full workflows.

 1from pycsamt.agents import WorkflowOrchestratorAgent
 2
 3result = WorkflowOrchestratorAgent().execute({
 4    "request": "Run phase tensor analysis and prepare a report",
 5    "data_path": "/data/WILLY_EDIs",
 6    "output_dir": "/out/willy_phase",
 7    "dry_run": True,
 8})
 9
10print(result["workflow_type"])
11print(result["steps"])

PipelineAgent#

PipelineAgent bridges pycsamt.pipeline with the agent framework. It can recommend a pipeline preset from a natural-language request or run a specific preset or list of step codes directly.

1from pycsamt.agents import PipelineAgent
2
3result = PipelineAgent(preset="full_processing").execute({
4    "path": "/data/WILLY_EDIs",
5    "output_dir": "/out/willy_pipeline",
6})
7
8print(result.get("preset_used"))
9print(result.get("steps_run"))

BatchSurveyAgent#

BatchSurveyAgent runs agent workflows over multiple surveys, profiles, or directories. Use it when the same processing recipe should be applied to many survey lines with consistent outputs.

1result = BatchSurveyAgent().execute({
2    "paths": ["/data/line01", "/data/line02", "/data/line03"],
3    "workflow": "qc",
4    "output_dir": "/out/batch_qc",
5})

InterpretationAgent#

InterpretationAgent converts resistivity and inversion products into geological interpretation. It can map resistivity ranges to lithology and summarize likely hydrogeological or structural meaning.

1result = InterpretationAgent().execute({
2    "model": inversion_model,
3    "context": "basement aquifer survey",
4})
5
6print(result.llm_interpretation)

ResistivityMapAgent#

ResistivityMapAgent creates horizontal depth-slice maps from inversion or resistivity products. Use it when a model needs map-view products for interpretation or reporting.

1maps = ResistivityMapAgent().execute({
2    "models": inversion_models,
3    "depths_m": [50, 100, 250],
4    "output_dir": "/out/resistivity_maps",
5})

SensitivityAgent#

SensitivityAgent estimates depth of investigation, vertical resolution, and sensitivity products. Use it to qualify which depths or model regions are well constrained.

1sensitivity = SensitivityAgent().execute({
2    "sites": processed_sites,
3    "model": inversion_model,
4    "output_dir": "/out/sensitivity",
5})

EDIExportAgent#

EDIExportAgent writes processed survey data back to EDI files. Use it after correction, rotation, filtering, or denoising when downstream tools need standard EDI products.

1exported = EDIExportAgent().execute({
2    "sites": processed_sites,
3    "output_dir": "/out/processed_edis",
4})

ReportAgent#

ReportAgent assembles workflow outputs into human-readable reports. It is typically the final step in QC, phase-analysis, inversion, or AI workflows.

1report = ReportAgent().execute({
2    "workflow_results": results,
3    "output_dir": "/out/report",
4    "formats": ["markdown", "html"],
5})

CodeGenerationAgent#

CodeGenerationAgent generates a standalone Python script from workflow configuration and results. Use it when an interactive or LLM-assisted workflow should be made reproducible.

1script = CodeGenerationAgent().execute({
2    "workflow_config": config,
3    "results": results,
4    "output_dir": "/out/reproducible_script",
5})

Output Workflow Pattern#

WorkflowOrchestratorAgent or AgentCoordinator
-> PipelineAgent or processing agents
-> InterpretationAgent
-> ReportAgent
-> CodeGenerationAgent

Use EDIExportAgent when corrected survey data must leave pyCSAMT as EDI files. Use BatchSurveyAgent when the same workflow should be applied to several profiles.