Pipeline architecture
The pipeline is the central runtime abstraction of the assistant. It executes a sequence of configured steps against a request context.
Core classes
Madj2k\Ai Core\ Assistant\ Pipeline\ Pipeline - Executes configured steps.
Madj2k\Ai Core\ Assistant\ Pipeline\ Processor\ Processor Interface - Common interface for all pipeline processors.
Madj2k\Ai Core\ Assistant\ Pipeline\ Registry\ Processor Registry - Resolves processors by identifier.
Madj2k\Ai Core\ Assistant\ Prompt\ Prompt Builder - Builds LLM messages from profile prompts, step prompts, history and context.
Madj2k\Ai Core\ Assistant\ Context\ Context - Shared state object for one assistant request.
Processor responsibilities
Processors must stay generic. Project-specific instructions belong into database records. A processor should read step configuration and context, execute its technical task and write results back into context.
LLM processors
LLM-based processors should call the AI provider through the configured
Ai and Ai. They should not instantiate provider
clients directly.
Streaming execution
Madj2k\ can run in synchronous mode
through run or in streaming mode through run. In streaming
mode the pipeline forwards streamed chunks to the callback passed by the caller.
A processor can participate in streaming by implementing
Madj2k\
in addition to Processor. If a streaming callback is available and
the processor implements that interface, the pipeline calls process.
Otherwise it falls back to the regular process method.
Prompt context builders
Prompt context is assembled through
Madj2k\.
The registry collects all tagged context builders that support the current
processor type and returns sorted Prompt objects. This keeps prompt
context construction extensible without hard-coding every section in one
processor.
Pipeline tracing
Processors can emit trace events for started steps, finished steps, LLM requests, LLM responses, retrieval results and errors. Traces are essential for debugging pipeline behaviour.