The SMF Works Project — Where AI Meets Humanity

API Reference

Complete reference for smf-forge agent types, configuration schema, and engine internals.

AgentConfig

FieldTypeDefaultDescription
namestrrequiredUnique agent identifier
typestr"echo"Agent type name (echo, http, shell, transform, or custom)
modelstr | NoneNoneLLM model name (for http type)
providerstr | NoneNoneProvider identifier
base_urlstr | NoneNoneAPI base URL (for http type)
api_keystr | NoneNoneAPI key (supports env var resolution)
system_promptstr""System prompt for the LLM
temperaturefloat0.7Sampling temperature
max_tokensint4096Maximum response tokens
optionsdict{}Type-specific configuration options

Pipeline Step Configuration

FieldTypeRequiredDescription
namestrYesUnique step name (used as context key for downstream steps)
agentstrYesAgent name reference from the agents section
promptstrNoJinja2 template for the prompt. Context variables available.
depends_onlist[str]NoList of step names this step depends on

PipelineEngine

class PipelineEngine:
    def __init__(self, fail_fast: bool = True, verbose: bool = False)

    async def run(
        self,
        pipeline: dict,           # Pipeline config with 'name' and 'steps'
        agent_registry: dict,     # Map of agent_name -> BaseAgent instance
        initial_context: dict | None = None,  # Optional initial context (e.g. {"prompt": "..."})
    ) -> PipelineResult

@dataclass
class PipelineResult:
    pipeline_name: str
    steps: list[StepResult]
    total_duration_ms: float
    success: bool

    @property
    def failed_steps -> list[StepResult]

@dataclass
class StepResult:
    step_name: str
    agent_name: str
    status: StepStatus          # PENDING | RUNNING | SUCCESS | FAILED | SKIPPED
    output: Any
    error: str | None
    duration_ms: float
    metadata: dict

Related