Interface PipelineOrganization

All Superinterfaces:
com.tnsai.agents.groups.AgentGroup
All Known Implementing Classes:
DefaultPipelineOrg

public interface PipelineOrganization extends com.tnsai.agents.groups.AgentGroup
A sequential processing pipeline where tasks flow through ordered stages.

PipelineOrganization extends AgentGroup with sequential stage processing, inter-stage data transformation, and pipeline-specific metrics.

Key Features

  • Ordered stages: Tasks flow through stages in sequence
  • Stage connectors: Optional transformation between stages
  • Pipeline metrics: Per-stage timing and bottleneck detection
  • Fail-fast: Pipeline stops on first stage failure

Usage Example


 PipelineOrganization pipeline = PipelineOrganization.builder()
     .name("Data Processing Pipeline")
     .addStage("extract", extractorAgent)
     .addStage("transform", transformerAgent)
     .addStage("load", loaderAgent)
     .build();

 pipeline.start();
 PipelineResult result = pipeline.execute("Process dataset X");
 
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addStage(String name, String agentId)
    Adds a new stage at the end of the pipeline.
    Creates a new PipelineOrganization builder.
    execute(String input)
    Executes the pipeline with the given input.
    Returns the current bottleneck stage (slowest).
    Returns the pipeline metrics.
    Returns all stages in pipeline order.

    Methods inherited from interface com.tnsai.agents.groups.AgentGroup

    addLifecycleListener, addMember, addMembershipListener, assignTask, broadcast, broadcast, dissolve, electLeader, electLeader, findMembers, getDescription, getEventBus, getId, getLeader, getLifecycle, getMember, getMemberCount, getMembers, getMembershipManager, getMetrics, getName, getPolicy, hasMember, isActive, isDissolved, removeLifecycleListener, removeMember, removeMembershipListener, scatter, scatter, scatterAsync, setPolicy, start, stop, stopNow
  • Method Details

    • getStages

      List<Stage> getStages()
      Returns all stages in pipeline order.
      Returns:
      ordered list of stages
    • addStage

      void addStage(String name, String agentId)
      Adds a new stage at the end of the pipeline.
      Parameters:
      name - stage name
      agentId - agent ID for this stage
      Throws:
      IllegalArgumentException - if agent is not a member
    • execute

      PipelineResult execute(String input)
      Executes the pipeline with the given input. Data flows sequentially through each stage.
      Parameters:
      input - initial input
      Returns:
      pipeline execution result
    • getPipelineMetrics

      PipelineMetrics getPipelineMetrics()
      Returns the pipeline metrics.
      Returns:
      pipeline metrics
    • getBottleneck

      Optional<String> getBottleneck()
      Returns the current bottleneck stage (slowest).
      Returns:
      bottleneck stage name, or empty if no data
    • builder

      static PipelineBuilder builder()
      Creates a new PipelineOrganization builder.
      Returns:
      builder