{"id":27,"library":"haystack-ai","title":"Haystack","description":"Open-source AI orchestration framework by deepset for building production-ready LLM applications in Python. Core abstraction is the Pipeline — a computation graph of Components (embedders, retrievers, generators, rankers, etc.) connected via explicit typed edges. Supports RAG, agents, semantic search, and multimodal workflows. Integrates with OpenAI, Anthropic, Mistral, Hugging Face, Azure, Bedrock, and 70+ vector databases and document stores.","status":"active","version":"2.24.x","language":"python","source_language":"en","source_url":"https://docs.haystack.deepset.ai/docs/installation","tags":["agents","rag","orchestration","pipelines","deepset","openai","huggingface","vector-store","python","production-stable"],"install":[{"cmd":"pip install haystack-ai","lang":"bash","label":"Install Haystack 2.x (correct package)"},{"cmd":"pip install haystack-ai[all]","lang":"bash","label":"Install with all optional extras"}],"dependencies":[{"reason":"Python 3.9 reached EOL in October 2025. Haystack 2.x now requires >=3.10.","package":"Python >=3.10","optional":false},{"reason":"Optional extras — not installed by default. Haystack will raise an ImportError with a specific install instruction when a feature needs them.","package":"pypdf, sentence-transformers, transformers, etc.","optional":true}],"imports":[{"note":"Haystack 2.x top-level import. The haystack.pipelines module path is from 1.x (farm-haystack).","wrong":"from haystack.pipelines import Pipeline","symbol":"Pipeline","correct":"from haystack import Pipeline"},{"note":"Nodes are gone in 2.x. Custom components use @component decorator with a run() method.","wrong":"from haystack.nodes import BaseComponent","symbol":"component decorator","correct":"from haystack import component"},{"note":"PromptNode is 1.x (farm-haystack). In 2.x, use OpenAIChatGenerator or provider-specific generators.","wrong":"from haystack.nodes import PromptNode","symbol":"OpenAIChatGenerator","correct":"from haystack.components.generators.chat import OpenAIChatGenerator"},{"note":"Module path changed between 1.x and 2.x. Document stores are no longer nodes/components — they are passed to Retriever components.","wrong":"from haystack.document_stores import InMemoryDocumentStore","symbol":"InMemoryDocumentStore","correct":"from haystack.document_stores.in_memory import InMemoryDocumentStore"}],"quickstart":{"code":"import os\nfrom haystack import Pipeline\nfrom haystack.document_stores.in_memory import InMemoryDocumentStore\nfrom haystack.components.retrievers.in_memory import InMemoryBM25Retriever\nfrom haystack.components.builders import PromptBuilder\nfrom haystack.components.generators.chat import OpenAIChatGenerator\nfrom haystack.dataclasses import ChatMessage\n\nos.environ[\"OPENAI_API_KEY\"] = \"sk-...\"\n\ndocument_store = InMemoryDocumentStore()\n# Index docs separately: document_store.write_documents([...])\n\ntemplate = \"\"\"\nGiven the following context, answer the question.\nContext: {% for doc in documents %}{{ doc.content }}{% endfor %}\nQuestion: {{ question }}\n\"\"\"\n\npipeline = Pipeline()\npipeline.add_component(\"retriever\", InMemoryBM25Retriever(document_store=document_store))\npipeline.add_component(\"prompt\", PromptBuilder(template=template))\npipeline.add_component(\"llm\", OpenAIChatGenerator(model=\"gpt-4o\"))\n\npipeline.connect(\"retriever.documents\", \"prompt.documents\")\npipeline.connect(\"prompt.prompt\", \"llm.messages\")\n\nresult = pipeline.run({\"retriever\": {\"query\": \"What is Haystack?\"}, \"prompt\": {\"question\": \"What is Haystack?\"}})\nprint(result[\"llm\"][\"replies\"][0].text)","lang":"python","description":"Simple RAG pipeline with in-memory document store"},"warnings":[{"fix":"pip uninstall -y farm-haystack && pip install haystack-ai","message":"Haystack 1.x (farm-haystack) reached End of Life on March 11, 2025. Final version is 1.26.4. No further updates or security patches. The correct package for Haystack 2.x is haystack-ai, NOT farm-haystack.","severity":"breaking","affected_versions":"farm-haystack (all versions)"},{"fix":"pip uninstall -y farm-haystack haystack-ai && pip install haystack-ai","message":"farm-haystack and haystack-ai CANNOT coexist in the same Python environment. Installing both causes import conflicts and unpredictable failures — haystack namespace is shared but incompatible between the two packages.","severity":"breaking","affected_versions":"any environment with both installed"},{"fix":"Rewrite pipelines using 2.x components. See migration guide: https://docs.haystack.deepset.ai/docs/migration","message":"All 1.x Nodes are gone in 2.x. Pipeline.add_node() does not exist. The entire node API (BaseComponent subclasses, PromptNode, FARMReader, EmbeddingRetriever, etc.) has been replaced with Components using the @component decorator and Pipeline.add_component() + Pipeline.connect().","severity":"breaking","affected_versions":"farm-haystack 1.x code"},{"fix":"Replace document store nodes with DocumentWriter component. Pass document store instances directly to Retriever components.","message":"DocumentStore is no longer a pipeline component/node in 2.x. In 1.x, a DocumentStore could be the terminal node of an indexing pipeline. In 2.x, DocumentStores are plain Python objects passed to Retriever components. Use DocumentWriter component to write to a store at the end of a pipeline.","severity":"breaking","affected_versions":"farm-haystack 1.x code"},{"fix":"Explicitly connect all components after adding them to the pipeline.","message":"Pipeline connections must be explicit in 2.x. In 1.x, nodes were chained implicitly in order. In 2.x, you must call pipeline.connect('component_a.output_name', 'component_b.input_name') for every edge — both the component name AND the socket name are required.","severity":"breaking","affected_versions":"farm-haystack 1.x code"},{"fix":"Upgrade to Python 3.10 or later.","message":"Python 3.9 support dropped as of Haystack 2.22+ (October 2025). Python 3.9 reached EOL and Haystack now requires >=3.10.","severity":"breaking","affected_versions":"2.22+"},{"fix":"Always use: pip install haystack-ai","message":"pip install haystack installs an unrelated package (not Haystack by deepset). The correct package name is haystack-ai.","severity":"gotcha","affected_versions":"all"},{"fix":"Follow the ImportError message, or use pip install haystack-ai[all] to include everything upfront.","message":"Optional dependencies (pypdf, sentence-transformers, transformers, etc.) are NOT included in the base install. Components that need them will raise an ImportError at runtime with the specific pip install command needed. This is by design for a lightweight install.","severity":"gotcha","affected_versions":"all 2.x"},{"fix":"Remove return_empty_on_no_match from RegexTextExtractor initialization. The component now always returns an empty string on no match.","message":"RegexTextExtractor.return_empty_on_no_match parameter removed in 2.23.0. Previously ignored since 2.22, now raises an error on initialization if passed.","severity":"gotcha","affected_versions":"2.23.0+"},{"fix":"export HAYSTACK_TELEMETRY_ENABLED=false","message":"Haystack collects anonymous telemetry by default (pipeline component usage). To opt out, set the HAYSTACK_TELEMETRY_ENABLED=false environment variable.","severity":"gotcha","affected_versions":"all 2.x"},{"fix":"Ensure that the output type of the source component socket explicitly matches the input type of the destination component socket. If types are incompatible, introduce an intermediate component to perform the necessary type conversion (e.g., wrap a string into a `ChatMessage` object or a list thereof) before connecting.","message":"Pipeline connections in Haystack 2.x require strict type compatibility between connected component sockets. A common migration issue is attempting to connect components where the output type of the source socket (e.g., a single `str` from a `PromptBuilder`) does not match the expected input type of the destination socket (e.g., `list[ChatMessage]` for an LLM), leading to a `PipelineConnectError`.","severity":"breaking","affected_versions":"all 2.x"},{"fix":"Ensure the OPENAI_API_KEY environment variable is set with a valid OpenAI API key, or pass it directly to the component during initialization (e.g., OpenAIChatGenerator(api_key='sk-...')). You can find your API key at https://platform.openai.com/account/api-keys.","message":"OpenAIChatGenerator (and other OpenAI components) require a valid OpenAI API key. An openai.AuthenticationError with status 401 indicates an incorrect or missing API key.","severity":"gotcha","affected_versions":"all 2.x"}],"env_vars":null,"last_verified":"2026-05-12T04:48:53.878Z","next_check":"2026-05-28T00:00:00.000Z","problems":[{"fix":"Ensure you have 'haystack-ai' installed and 'farm-haystack' uninstalled. Then, update your code to use Haystack 2.x 'components' and their new import paths as specified in the Haystack 2.x documentation.","cause":"This error occurs when trying to use Haystack 1.x 'nodes' (from 'farm-haystack') in a Haystack 2.x environment (where the package is 'haystack-ai'). Haystack 2.x has refactored the architecture, replacing 'nodes' with 'components'.","error":"ModuleNotFoundError: No module named 'haystack.nodes'"},{"fix":"Install the missing dependency as instructed in the error message. For example, if 'xyz' is reported as missing, run: `pip install xyz`. For dependencies requiring a specific version, ensure you use quotation marks: `pip install \"package_name>=X.Y.Z\"`.","cause":"Haystack 2.x adopts a modular installation approach, meaning many components rely on optional dependencies that are not installed by default. This error indicates that a specific package required by a component you are trying to use is missing.","error":"ImportError: \"Haystack failed to import the optional dependency 'xyz'. Run 'pip install xyz'."},{"fix":"Uninstall both packages completely, then install only 'haystack-ai' in a clean virtual environment: `pip uninstall -y farm-haystack haystack-ai && pip install haystack-ai`.","cause":"This error often arises from conflicts when both 'farm-haystack' (Haystack 1.x) and 'haystack-ai' (Haystack 2.x) are installed in the same Python environment. These two major versions are not compatible and should not coexist.","error":"ImportError: cannot import name 'send_event' from 'haystack.telemetry'"},{"fix":"Consult the documentation for the specific integration component to identify its correct import path. For instance, for CohereGenerator, the correct import is `from cohere_haystack.generator import CohereGenerator`.","cause":"Components for specific integrations (e.g., CohereGenerator) are often part of separate 'haystack-ai' integration packages. They must be imported from their respective package path (e.g., 'cohere_haystack.generator') rather than the generic 'haystack.components' path.","error":"ImportError: cannot import name 'ComponentName' from 'haystack.components.generators'"}],"ecosystem":"pypi","meta_description":null,"install_score":95,"install_tag":"verified","quickstart_score":70,"quickstart_tag":"verified","pypi_latest":null,"install_checks":{"last_tested":"2026-05-12","tag":"verified","tag_description":"installs cleanly on critical runtimes, fast import, recently tested","results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":1.87,"mem_mb":33.1,"disk_size":"153.1M"},{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"all","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":1.86,"mem_mb":33.1,"disk_size":"153.1M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":1.49,"mem_mb":33.1,"disk_size":"148M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"all","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":1.45,"mem_mb":33.1,"disk_size":"148M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":2.4,"mem_mb":36.3,"disk_size":"169.9M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"all","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":2.4,"mem_mb":36.3,"disk_size":"169.9M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":2.08,"mem_mb":36.3,"disk_size":"164M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"all","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":2.04,"mem_mb":36.3,"disk_size":"164M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":2.46,"mem_mb":35.3,"disk_size":"156.2M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"all","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":2.49,"mem_mb":35.3,"disk_size":"156.2M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":2.56,"mem_mb":35.3,"disk_size":"151M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"all","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":2.43,"mem_mb":35.3,"disk_size":"151M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":2.34,"mem_mb":35.7,"disk_size":"155.5M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"all","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":2.28,"mem_mb":35.7,"disk_size":"155.5M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":2.35,"mem_mb":35.7,"disk_size":"150M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"all","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":2.34,"mem_mb":35.7,"disk_size":"150M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":1.82,"mem_mb":32.2,"disk_size":"170.9M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"all","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":1.8,"mem_mb":32.2,"disk_size":"170.9M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":1.64,"mem_mb":32.2,"disk_size":"168M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"all","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":1.62,"mem_mb":32.2,"disk_size":"168M"}]},"quickstart_checks":{"last_tested":"2026-05-11","tag":"verified","tag_description":"quickstart runs on critical runtimes, recently tested","results":[{"runtime":"python:3.10-alpine","exit_code":0},{"runtime":"python:3.10-slim","exit_code":0},{"runtime":"python:3.11-alpine","exit_code":0},{"runtime":"python:3.11-slim","exit_code":0},{"runtime":"python:3.12-alpine","exit_code":0},{"runtime":"python:3.12-slim","exit_code":0},{"runtime":"python:3.13-alpine","exit_code":0},{"runtime":"python:3.13-slim","exit_code":0},{"runtime":"python:3.9-alpine","exit_code":1},{"runtime":"python:3.9-slim","exit_code":1}]}}