deepset-ai / deepset-ai/haystack

Proposal: Transaction Protocol for idempotent, auditable agent pipelines

Open
#11,266 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

P3
Dominant language
Python
Stars
26.6k
Forks
3.2k
Avg merge
1d 3h
Merged PRs (30d)
194

Description

Problem

Haystack pipelines lack transaction guarantees. When a step fails mid-execution, there's no standard way to:

  1. Know exactly what completed and what didn't
  2. Resume from failure point (idempotency)
  3. Roll back partial work (compensation)

For production deployments in regulated environments, this is a hard requirement.

Proposed Solution

Transaction Protocol (L7) from Works With Agents (CC BY 4.0): idempotency, rollback, and immutable audit trails.

from haystack import Pipeline
from works_with_agents import TransactionProtocol

pipeline = Pipeline()
pipeline.add_component(embedder, ...)
pipeline.add_component(retriever, ...)
pipeline.add_component(generator, ...)

tx = TransactionProtocol.begin("doc-qna-pipeline")
try:
    result = pipeline.run({"query": "What is GDP?"})
    tx.commit(result)  # Signed, hashed, timestamped
except PipelineError:
    tx.rollback()  # Compensation per component

Provides: idempotency tokens, step-level audit trail, compensation actions, cryptographic signatures for tamper-proof evidence.

Why Haystack: pipeline architecture = natural transaction boundaries. Production users need this. Zero breaking changes — wrapper pattern.

Spec: https://workswithagents.dev/specs/transaction.md
SDK: pip install works-with-agents

Would a PR adding Transaction Protocol support to Haystack be welcome?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading Haystack's Pipeline API alongside the linked Transaction Protocol specification and SDK documentation. The proposal names no Haystack files or tests and leaves the integration, compensation behavior, audit guarantees, and acceptance criteria undefined, so the scope and definition of done require maintainer agreement first.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
ai, backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.