Skip to main content
The Haystack integration is available for Python only.

Installation

pip install zespan haystack-ai

Usage

Initialize Zespan and pass LumiqHaystackTracer to your pipeline’s run call.
import zespan
from zespan import LumiqHaystackTracer
from haystack import Pipeline
from haystack.components.generators import OpenAIGenerator
from haystack.components.builders import PromptBuilder

zespan.init(api_key="zsp_your_api_key_here")

template = """
Given the following question, provide a concise answer.
Question: {{ question }}
"""

pipeline = Pipeline()
pipeline.add_component("prompt_builder", PromptBuilder(template=template))
pipeline.add_component("llm", OpenAIGenerator(model="gpt-4o"))
pipeline.connect("prompt_builder", "llm")

tracer = LumiqHaystackTracer()

result = pipeline.run(
    {"prompt_builder": {"question": "What is retrieval-augmented generation?"}},
    include_outputs_from={"llm"},
)
print(result["llm"]["replies"][0])
Pass LumiqHaystackTracer as the tracer for your pipeline runs. Zespan captures component execution, LLM calls, and pipeline latency.