Identify the framework whose composition syntax overloads the `|` (pipe) operator
Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
LangChain LCEL is the only one that overloads the pipe; LlamaIndex uses method chaining, Vercel AI SDK uses functions, Haystack v2 uses explicit socket wiring.
Imagine four different ways to connect garden hoses. LangChain LCEL is the one with snap-on connectors. You literally click hose A onto hose B with one motion. The `|` symbol is the snap. LlamaIndex is more like turning faucets in sequence. You turn one on, water flows through, then turn the next. Method calls in a chain, no clicking. Vercel AI SDK is just buckets and a person carrying water between them. Explicit function calls, no plumbing metaphor. Haystack v2 makes you label every pipe end and write down 'connect hose A's output to hose B's input' on a clipboard. Explicit wiring. Only one of these uses the snap.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
4 min: the Runnable.__or__ mechanism, why other frameworks did not copy the pipe, where pipe composition wins, and where it runs out.
| Framework | Composition idiom | Why this choice |
|---|---|---|
| LangChain LCEL | `a | b | c` pipe over Runnables | Uniform Runnable protocol; batch / stream / async free across the chain |
| LlamaIndex | Method chaining and factories | Data-centric primitives with distinct types per role |
| Vercel AI SDK | Function calls + React hooks | Deliberately thin; mirrors provider SDK shape |
| Haystack v2 | Explicit `pipeline.connect(a.out, b.in)` | Typed sockets; static graph analysis |
Real products, models, and research that use this idea.
What an interviewer would ask next. Try answering before peeking at the approach.
Red flags and common mistakes that signal junior thinking. Click to expand.
Assuming any composition framework supports the pipe because LCEL made it famous. Then writing `query_engine | synthesizer` in LlamaIndex and getting a TypeError.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.