{"id":5245,"library":"haystack-experimental","title":"Haystack Experimental Components","description":"haystack-experimental provides experimental components and features for the Haystack LLM framework (version 2.x). It offers early access to new ideas, integrations, and architectural patterns before they potentially graduate to the main Haystack library. Currently at version 0.19.0, it has a frequent release cadence, often aligning with or preceding Haystack core releases, reflecting its rapidly evolving nature.","status":"active","version":"0.19.0","language":"en","source_language":"en","source_url":"https://github.com/deepset-ai/haystack-experimental","tags":["LLM","AI","Haystack","experimental","deepset","agent","memory"],"install":[{"cmd":"pip install \"haystack-experimental[openai]\"","lang":"bash","label":"For LLM usage"},{"cmd":"pip install haystack-experimental","lang":"bash","label":"Core experimental components"}],"dependencies":[{"reason":"This library is built on and integrates with the Haystack 2.x core, providing experimental components for it.","package":"haystack-ai","optional":false},{"reason":"Required for using OpenAI models with components like OpenAIChatGenerator, typically installed via the `[openai]` extra.","package":"openai","optional":true}],"imports":[{"symbol":"Agent","correct":"from haystack_experimental.agents.agent import Agent"},{"symbol":"InMemoryChatMessageStore","correct":"from haystack_experimental.memory.in_memory_chat_message_store import InMemoryChatMessageStore"},{"note":"The component moved from 'components.preprocessors' to top-level 'preprocessors' module in recent versions.","wrong":"from haystack_experimental.components.preprocessors.markdown_header_level_inferrer import MarkdownHeaderLevelInferrer","symbol":"MarkdownHeaderLevelInferrer","correct":"from haystack_experimental.preprocessors.markdown_header_level_inferrer import MarkdownHeaderLevelInferrer"}],"quickstart":{"code":"import os\nfrom haystack_experimental.agents.agent import Agent\nfrom haystack.components.generators.chat import OpenAIChatGenerator\nfrom haystack.components.builders.prompt_builder import PromptBuilder\n\n# Ensure your OpenAI API key is set as an environment variable\nos.environ['OPENAI_API_KEY'] = os.environ.get('OPENAI_API_KEY', 'sk-...') \n\n# Initialize LLM and PromptBuilder\nllm = OpenAIChatGenerator()\nprompt_builder = PromptBuilder(template=\"{{ query }}\")\n\n# Create an experimental Agent\nagent = Agent(\n    tools=[], # Agents can use tools, but for this quickstart we'll keep it simple\n    prompt_builder=prompt_builder,\n    llm=llm,\n    max_iterations=3,\n    debug=True\n)\n\n# Run the agent\nresult = agent.run(query=\"What is the capital of France?\")\nprint(f\"Agent Output: {result.answer}\")","lang":"python","description":"This quickstart demonstrates creating and running an experimental Haystack Agent. It uses `OpenAIChatGenerator` (requires `openai` extra) and `PromptBuilder` to respond to a simple query. The `Agent` is a core experimental component for orchestration."},"warnings":[{"fix":"Refer to the latest documentation and changelog (`docs.haystack.deepset.ai/reference/experimental-overview`) before upgrading or integrating. Expect to adapt your code frequently.","message":"Components within `haystack-experimental` are volatile. Their APIs are unstable and subject to frequent breaking changes, renaming, or complete removal without prior notice due to their experimental nature.","severity":"breaking","affected_versions":"All versions"},{"fix":"Always check the release notes of `haystack-experimental` for the compatible `haystack-ai` version. Pin your `haystack-ai` version accordingly.","message":"Compatibility with the core `haystack-ai` library is tightly coupled. Updates to either `haystack-experimental` or `haystack-ai` can introduce incompatibilities, requiring specific version alignments.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Upgrade your Python environment to 3.10 or higher.","message":"Python 3.9 support was dropped, requiring Python 3.10 or newer.","severity":"breaking","affected_versions":"0.16.0 and later"},{"fix":"Use standard Haystack DocumentSplitters (e.g., `DocumentSplitter`) or other available experimental text splitting components.","message":"The `EmbedderBasedDocumentsplitter` component was removed.","severity":"deprecated","affected_versions":"0.16.0 and later"},{"fix":"Refer to the core Haystack library for current HiTL functionalities, if applicable.","message":"Human-in-the-Loop (HiTL) related code was removed as it migrated out of `haystack-experimental`.","severity":"deprecated","affected_versions":"0.18.0 and later"}],"env_vars":null,"last_verified":"2026-04-13T00:00:00.000Z","next_check":"2026-07-12T00:00:00.000Z"}