Agentic Pipelines

Agentic pipelines go beyond simple command-response patterns. They use AI to act independently—make decisions and take actions to achieve specific goals.

In deepset AI Platform, you can build agentic pipelines in three main ways:

  • Using conditional routing
  • Using an LLM with tool calling
  • Integrating an AI Agent component

Conditional Routing

In this setup, a Generator (an LLM) is paired with a ConditionalRouter component. The LLM analyzes incoming data and classifies it, routing the input to the most appropriate pipeline branch.

Example

For example, the LLM might decide whether a query can be answered directly or needs additional data from a local database. It then sends the query to the ConditionalRouter, which forwards it along the appropriate route the LLM indicated.

When To Use It

These types of systems are best if:

  • You need to handle different input types with specialized processing for each type.
  • You want predictable, transparent behavior with minimal complexity.

Pros

Systems with conditional routing are:

  • Clear
  • Controllable
  • Transparent

Cons

  • Limited flexibility compared to agent-based systems (no decision loop)

LLM with Tool Calling

This approach uses an LLM paired with tools it can call using a ToolInvoker component. The LLM chooses the tool but doesn’t run it directly. It sends the tool call to ToolInvoker. One limitation of this setup is that it can’t send the tool’s output back to the LLM, preventing it from making follow-up decisions based on the result.

While functional, this setup is considered a predecessor to the more advanced Agent-based design. It’s less flexible and more complex to configure.

When To Use It

  • Rare cases where a simple tool call is needed without the full complexity of an Agent

Limitations

Compared to pipelines using the Agent component, LLM with tool calling pipelines are:

  • Harder to set up
  • Cannot return tool's output to the LLM

Agent-Based Pipelines

Agent-based pipelines are the most flexible and advanced option. They include the Agent component with an LLM as its decision-making core and multiple tools at its disposal. The Agent can make decisions independently, run tools multiple times, and loop through actions until it reaches a defined exit condition.

Example

Tasks like code generation, where the path to the answer involves multiple, interdependent steps. An Agent can dynamically adjust based on what it learns during execution.

When To Use It

  • For complex, multi-step tasks
  • When workflows are not fully predictable

Pros

Agent-based systems have:

  • High flexibility
  • Autonomy to handle tasks

Cons

Compared to pipelines with conditional routing, Agent-based pipelines are:

  • Lower predictability: As the Agent takes more steps, the chances of getting the same result across different runs decrease.
  • Requires thorough testing and validation

Comparison

Each pipeline type serves a different purpose. This table summarizes them:

Pipeline TypeFlexibilityPredictabilityBest For
Conditional routingLowHighClearly defined tasks with static paths
LLM with tool callingMediumHighSimple tool interactions
Agent-based pipelinesHighLowComplex, evolving workflows