Haystack Built Composable NLP Pipelines. The Pipeline Components Have No Agent Schema.

by Nick Clark | Published March 28, 2026 | PDF

Haystack, the open-source LLM framework maintained by deepset, provides a composable architecture for building NLP and retrieval-augmented generation pipelines. Haystack 2.0 Pipelines wire retrievers, readers, generators, embedders, prompt builders, and custom components into directed graphs that execute against document stores and language models. Haystack Hub extends the framework into managed deployment, and the project's recent agentic primitives let pipelines call tools and loop over reasoning steps. The composition model is genuinely flexible, and the component library is broad. But Haystack pipeline components remain functional units defined by their input and output sockets, not structurally defined agents. There is no canonical schema for what a component or agent is, how governance relates to capability, how memory and identity persist across pipeline executions, or how lineage is recorded as a typed property of the executing object. The gap is between composable NLP tooling and canonical agent definition, and that gap is what the AQ agent-schema primitive disclosed under provisional 64/049,409 addresses.


1. Vendor and Product Reality

deepset GmbH, founded in 2018 in Berlin, is the commercial steward of the Haystack open-source framework and operator of deepset Cloud (the managed offering, which the project has also marketed as Haystack Hub for parts of its history). Haystack began as a question-answering library wrapping transformer models over Elasticsearch and has evolved through Haystack 2.0 into a general-purpose pipeline framework for retrieval-augmented generation, agentic LLM patterns, and bespoke NLP workflows. The framework's reach is substantial: tens of thousands of GitHub stars, a broad ecosystem of community-contributed components, official integrations with the major vector stores (Weaviate, Pinecone, Qdrant, Milvus, pgvector), the major LLM providers (OpenAI, Anthropic, Cohere, Hugging Face, Amazon Bedrock, Azure OpenAI), and document stores ranging from in-memory to OpenSearch.

The architectural shape is well-defined. A Haystack 2.0 Pipeline is a graph of Components, each a Python class that exposes typed input and output sockets through a decorator-driven contract. The framework's runtime resolves the graph, validates that socket types align where components are connected, and executes the graph against incoming inputs. A retriever consumes a query string and emits a list of documents. A generator consumes a prompt and emits text. An embedder consumes text and emits a vector. Custom components extend the same contract. The agentic features added in recent releases — tool-calling components, loop control flow, conditional routing — extend the graph model with iterative patterns but remain within the components-and-sockets abstraction. deepset Cloud adds managed deployment, access control, observability, evaluation harnesses, and a labeling and prompt-engineering studio on top of the open-source pipeline runtime.

Haystack's strengths within this scope are real. The Pipeline abstraction is more honest about data flow than ad-hoc LangChain-style chaining; the type system on sockets catches a class of integration errors at assembly time; the component library is broad enough that most RAG architectures can be expressed without custom code; and the deepset Cloud surface is competitive with the managed RAG offerings from the cloud providers. The customer base — enterprise NLP teams, in-house RAG platform groups, regulated-industry knowledge-retrieval projects — treats Haystack as the reference implementation of composable NLP pipelines built around the LLM era. Within the bounds of the pipeline-of-functional-components abstraction, the framework is rigorous and credible.

2. The Architectural Gap

The structural property Haystack's framework does not exhibit is canonical agent definition. A Haystack component is a Python class decorated to expose typed sockets; the executing entity, when a pipeline runs, is a data-flow graph of these classes. The graph processes inputs and produces outputs. It is not a structurally defined agent in the sense of an object whose identity, capabilities, governance, memory, and execution state are typed fields available for validation, audit, or programmatic inspection. A Haystack component has no field declaring its identity beyond its class name. It carries no governance descriptor declaring which policies bind its execution. It has no memory field that persists across invocations of the parent pipeline. It has no lineage property recording the chain of state changes that produced its current behavior. The agentic loop primitives the project has added do not change this: they let a pipeline reason iteratively, but the loop is a control-flow construct over functional components, not a schema-defined agent with persistent canonical state.

The gap matters because the workloads now arriving at Haystack and similar frameworks — multi-agent customer-support systems, regulated-industry RAG with audit obligations, autonomous research agents that run for hours — are agents in the substantive sense, not merely pipelines. Pipeline state under Haystack is transient: it exists for the duration of a run and is discarded when the run completes, unless application code persists it externally. Even when the application persists conversation history or retrieved documents to a database, that persistence is external to the framework, with no governed memory field on the pipeline or its components, no lineage tracking how memory evolved across runs, and no policy mechanism constraining which mutations to memory are permitted under which conditions. Capability is similarly implicit: a tool component can call an external API, a generator can produce text, a retriever can query a vector index, but there is no schema field declaring which capabilities a component is permitted to exercise under which governance conditions. Authorization, rate limiting, content policy, and audit are bolted on at the application layer or the deployment layer. deepset Cloud adds operational concerns around pipelines, but those sit outside the pipeline graph; the pipeline itself, when serialized and rehydrated, does not carry a governance descriptor. Two deployments of the same pipeline under different governance conditions are indistinguishable when inspected as Haystack objects, because the schema has no slot for the difference.

Haystack cannot patch this from within its current abstraction because the framework was designed as a pipeline composer, not as a registry of canonical agents. Adding more sockets does not produce identity; adding more loop primitives does not produce governed memory; adding deployment-side ACLs does not produce schema-bound capability. The agent schema is an architectural shape — identity, capability, governance, memory, execution state, and lineage as typed fields on the executing object — and Haystack's shape is fundamentally that of a directed graph of stateless functional units, with state and governance explicitly delegated to external systems. The framework's composability and the gap come from the same design choice.

3. What the AQ Agent-Schema Primitive Provides

The Adaptive Query agent-schema primitive specifies that any conforming agent be a structurally defined object with six canonical typed fields, not a pipeline of opaque functional components. Field one — identity — is a cryptographically anchored agent identifier within a published taxonomy, distinct from any human or service account, that travels with the object across deployments and is the subject of every lineage record the agent produces. Field two — capability declaration — is a typed enumeration of the operations the agent may perform, each capability bound to a governance descriptor that specifies under what credentialed conditions the capability may be exercised, so capability is never implicit class behavior.

Field three — governance binding — is a signed policy descriptor declaring which authorities govern the agent's mutations, which trust-slope conditions a state transition must satisfy, and which actions require attestation; the descriptor is part of the agent's memory image, not a row in an external service. Field four — memory — is a structured field with explicit lineage, where every prior state is cryptographically linked to the current state, every write is governed by the policy field, and inspecting the memory field is an inspectable canonical operation rather than an application-specific persistence pattern. Field five — execution state — is a typed cursor into the agent's evaluation cycle, so an external observer can validate where in its loop the agent is, whether it is awaiting input, mid-tool-call, or in a quiescent state, without reading framework-specific runtime internals. Field six — lineage — is the structurally tamper-evident audit log of observations, decisions, and mutations the agent has produced, recorded as a typed property of the agent itself, not as an external log file.

The closure across these six fields is load-bearing. An agent whose identity, capability, governance, memory, execution state, and lineage are all canonical typed fields is structurally distinct from a pipeline of functional components in a way that no incremental enrichment of the pipeline model recovers. The schema is technology-neutral with respect to the underlying NLP framework — it composes naturally over Haystack 2.0 Pipelines, over LangGraph state machines, over LlamaIndex query engines, and over bespoke agent runtimes — and it composes hierarchically, so an agent can host sub-agents under the same six-field contract. The inventive step disclosed under USPTO provisional 64/049,409 is the closed canonical agent schema as a structural condition for governed agentic systems, independent of which framework provides the processing capability.

4. Composition Pathway

Haystack integrates with AQ as the NLP processing tier underneath the canonical agent schema. What stays at Haystack: the Pipeline graph runtime, the typed-socket component contract, the broad component library across vector stores and LLM providers, the evaluation harness, the deepset Cloud deployment surface, and the entire developer-facing commercial relationship. deepset's investment in NLP-specific engineering — RAG architecture patterns, retrieval quality, prompt engineering tooling, evaluation rigor — remains its differentiated layer. The framework does not need to be rewritten; it needs to be wrapped.

What moves to AQ as substrate: the executing entity. Each governed agent is an AQ schema-defined object whose canonical fields wrap a Haystack Pipeline as its processing capability. The agent's identity, capability declaration, governance binding, memory, execution state, and lineage live in the AQ schema layer; the pipeline lives where it always lived, inside the agent as the engine that turns a query plus retrieved context plus prior memory into a generated response or a tool call. The integration points are well-defined. An agent invocation begins with a credentialed observation — the inbound user message or upstream agent message — admitted through the agent's governance binding. The governance evaluation produces an admissibility outcome; if admitted, the pipeline runs over the agent's memory plus the new observation, and the pipeline's output is a proposed mutation to memory plus, optionally, an outbound capability exercise (a tool call, a generated response). The proposed mutation is validated against the schema, the capability exercise is validated against the capability declaration, and both are recorded into the lineage field as typed entries before the pipeline run is considered complete. deepset Cloud's deployment, observability, and access-control surfaces become the operational management layer for fleets of schema-defined agents, with a clean separation between framework operations and per-agent governance.

The new commercial surface is canonical agent hosting for regulated and multi-agent workloads — exactly the workloads enterprise NLP buyers are now bringing to Haystack and similar frameworks but cannot deploy under the pipeline-of-functional-components abstraction without writing every governance and memory concern from scratch in application code. deepset's customers gain a substrate on which an agent's identity, capability, governance, memory, execution state, and lineage are first-class and portable across the deepset footprint and beyond, while deepset's engineering investment in pipeline composability and retrieval quality becomes more, not less, valuable, because the agent's processing capability is exactly what differentiates one agent from another once the schema is held constant.

5. Commercial and Licensing Implication

The fitting arrangement is an embedded substrate license: deepset embeds the AQ agent-schema primitive into Haystack 2.0 and deepset Cloud and sub-licenses schema participation to its enterprise customers as part of the platform subscription. Pricing is per-canonical-agent or per-governed-mutation rather than per-pipeline-run or per-token, which aligns with how regulated agentic workloads actually consume governance and which produces a healthier revenue curve than per-token billing on long-running multi-agent systems.

What deepset gains: a structural answer to the "every customer reinvents memory, governance, and audit on top of pipelines" problem the framework's users now describe at every enterprise engagement, a defensible position against LangChain, LlamaIndex, and the framework-of-the-month churn by elevating the architectural floor from composability to canonical agent definition, and a forward-compatible posture against EU AI Act, NIS2, and emerging agentic-systems regulation that will require typed agent identity, declared capability, signed governance, and inspectable lineage as conditions of deployment. What the customer gains: portable agents whose identity and lineage survive framework migration, a single schema spanning Haystack-based and non-Haystack agents under one taxonomy, audit-grade history that is a property of the agent rather than a property of an external log, and a clean separation between the NLP-pipeline composability that gives agents their behavior and the canonical schema that gives agents their governance properties. Honest framing — the AQ primitive does not replace composable NLP pipelines; it gives composable NLP pipelines the agent definition they have always needed and never had.

Nick Clark Invented by Nick Clark Founding Investors:
Anonymous, Devin Wilkie
72 28 14 36 01