Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs-website/docs/concepts/data-classes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ image = ByteStream.from_file_path("dog.jpg")

### ChatMessage

`ChatMessage` is the central abstraction to represent a message for a LLM. It contains role, metadata and several types of content, including text, tool calls and tool calls results.
`ChatMessage` is the central abstraction to represent a message for a LLM. It contains role, metadata and several types of content, including text, tool calls and tool calls results.

Read the detailed documentation for the `ChatMessage` data class on a dedicated [ChatMessage](data-classes/chatmessage.mdx) page.

Expand Down Expand Up @@ -301,7 +301,7 @@ print(info.name) # Name assigned in the pipeline, if any

#### Overview

The `SparseEmbedding` class represents a sparse embedding: a vector where most values are zeros.
The `SparseEmbedding` class represents a sparse embedding: a vector where most values are zeros.

#### Attributes

Expand Down
2 changes: 1 addition & 1 deletion docs-website/docs/concepts/data-classes/chatmessage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ description: "`ChatMessage` is the central abstraction to represent a message fo

`ChatMessage` is the central abstraction to represent a message for a LLM. It contains role, metadata and several types of content, including text, images, tool calls, tool call results, and reasoning content.

To create a `ChatMessage` instance, use `from_user`, `from_system`, `from_assistant`, and `from_tool` class methods.
To create a `ChatMessage` instance, use `from_user`, `from_system`, `from_assistant`, and `from_tool` class methods.

The [content](#types-of-content) of the `ChatMessage` can then be inspected using the `text`, `texts`, `image`, `images`, `file`, `files`, `tool_call`, `tool_calls`, `tool_call_result`, `tool_call_results`, `reasoning`, and `reasonings` properties.

Expand Down
2 changes: 1 addition & 1 deletion docs-website/docs/concepts/document-store.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ See the installation and initialization details for each Document Store in the "

### Work with Documents

Convert your data into `Document` objects before writing them into a Document Store along with its metadata and document ID.
Convert your data into `Document` objects before writing them into a Document Store along with its metadata and document ID.

The ID field is mandatory, so if you don’t choose a specific ID yourself, Haystack will do its best to come up with a unique ID based on the document’s information and assign it automatically. However, since Haystack uses the document’s contents to create an ID, two identical documents might have identical IDs. Keep it in mind as you update your documents, as the ID will not be updated automatically.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,9 @@ Haystack comes with some testing functionalities you can use in a custom Documen
### Implementation Tips

- The best way to learn how to write a custom Document Store is to look at the existing ones: the `InMemoryDocumentStore`, which is part of Haystack, or the [`ElasticsearchDocumentStore`](https://github.com/deepset-ai/haystack-core-integrations/tree/main/integrations/elasticsearch), which is a Core Integration, are good places to start.
- When starting from scratch, it might be easier to create the four CRUD methods of the `DocumentStore` protocol one at a time and test them one at a time as well. For example:
- When starting from scratch, it might be easier to create the four CRUD methods of the `DocumentStore` protocol one at a time and test them one at a time as well. For example:
1. Implement the logic for `count_documents`.
2. In your `test_document_store.py` module, define the test class `TestDocumentStore(CountDocumentsTest)`. Note how we only inherit from the specific testing mix-in `CountDocumentsTest`.
2. In your `test_document_store.py` module, define the test class `TestDocumentStore(CountDocumentsTest)`. Note how we only inherit from the specific testing mix-in `CountDocumentsTest`.
3. Make the tests pass.
4. Implement the logic for `write_documents`.
5. Change `test_document_store.py` so that your class now also derives from the `WriteDocumentsTest` mix-in: `TestDocumentStore(CountDocumentsTest, WriteDocumentsTest)`.
Expand Down
6 changes: 3 additions & 3 deletions docs-website/docs/concepts/experimental-package.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ description: "Try out new experimental features with Haystack."

Try out new experimental features with Haystack.

The `haystack-experimental` package allows you to test new experimental features without committing to their official release. Its main goal is to gather user feedback and iterate on new features quickly.
The `haystack-experimental` package allows you to test new experimental features without committing to their official release. Its main goal is to gather user feedback and iterate on new features quickly.

Check out the `haystack-experimental` [GitHub repository](https://github.com/deepset-ai/haystack-experimental) for the latest catalog of available features, or take a look at our [Experiments API Reference](/reference).

### Installation

For simplicity, every release of `haystack-experimental` includes all the available experiments at that time. To install the latest features, run:
For simplicity, every release of `haystack-experimental` includes all the available experiments at that time. To install the latest features, run:

```shell
pip install -U haystack-experimental
Expand Down Expand Up @@ -45,7 +45,7 @@ c = FoobarGenerator()
c.run([ChatMessage.from_user("What's an experiment? Be brief.")])
```

Experiments can also override existing Haystack features. For example, you can opt into an experimental type of `Pipeline` by changing the usual import:
Experiments can also override existing Haystack features. For example, you can opt into an experimental type of `Pipeline` by changing the usual import:

```python
# from haystack import Pipeline
Expand Down
10 changes: 5 additions & 5 deletions docs-website/docs/concepts/integrations.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ description: "The Haystack ecosystem integrates with many other technologies, su

The Haystack ecosystem integrates with many other technologies, such as vector databases, model providers and even custom components made by the community. Here you can explore our integrations, which may be maintined by deepset, or submitted by others.

Haystack integrates with a number of other technologies and tools. For example, you can use a number of different model providers or databases with Haystack.
Haystack integrates with a number of other technologies and tools. For example, you can use a number of different model providers or databases with Haystack.

There are two main types of integrations:

Expand All @@ -20,7 +20,7 @@ There are two main types of integrations:

An integration is any type of external technology that can be used to extend the capabilities of the Haystack framework. Some integration examples are those providing access to model providers like OpenAI or Cohere, to databases like Weaviate and Qdrant, or even to monitoring tools such as Traceloop. They can be components, Document Stores, or any other feature that can be used with Haystack.

We maintain a list of available integrations on the [Haystack Integrations](https://haystack.deepset.ai/integrations) page, where you can see which integrations we maintain or which have been contributed by the community.
We maintain a list of available integrations on the [Haystack Integrations](https://haystack.deepset.ai/integrations) page, where you can see which integrations we maintain or which have been contributed by the community.

An integrations page focuses on explaining how Haystack integrates with that technology. For example, the OpenAI integration page will provide a summary of the various ways Haystack and OpenAI can work together.

Expand Down Expand Up @@ -48,13 +48,13 @@ Check out the [video walkthrough](https://www.youtube.com/watch?v=SWC0QecAMcI) f

## How do I showcase my integration?

To make your integration visible to the Haystack community, contribute it to our [haystack-integrations](https://github.com/deepset-ai/haystack-integrations) GitHub repository. There are several requirements you have to follow:
To make your integration visible to the Haystack community, contribute it to our [haystack-integrations](https://github.com/deepset-ai/haystack-integrations) GitHub repository. There are several requirements you have to follow:

- Make sure your contribution is [packaged](https://packaging.python.org/en/latest/), installable, and runnable. We suggest using [hatch](https://hatch.pypa.io/latest/) for this purpose.
- Provide the GitHub repo and issue link.
- Create a Pull Request in the [haystack-integrations](https://github.com/deepset-ai/haystack-integrations) repo by following the [draft-integration.md](https://github.com/deepset-ai/haystack-integrations/blob/main/draft-integration.md) and include a clear explanation of what your integration is. This page should include:
- Create a Pull Request in the [haystack-integrations](https://github.com/deepset-ai/haystack-integrations) repo by following the [draft-integration.md](https://github.com/deepset-ai/haystack-integrations/blob/main/draft-integration.md) and include a clear explanation of what your integration is. This page should include:
- Installation instructions
- A list of the components the integration includes
- Examples of how to use it with clear/runnable code
- Licensing information
- (Optionally) Documentation and/or API docs that you’ve generated for your repository
- (Optionally) Documentation and/or API docs that you’ve generated for your repository
2 changes: 1 addition & 1 deletion docs-website/docs/concepts/jinja-templates.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ Due to how we use Jinja in some Components, there are some security consideratio

To mitigate this risk, Jinja templates are executed and rendered in a [sandbox environment](https://jinja.palletsprojects.com/en/3.1.x/sandbox/). While this approach is safer, it's also less flexible and limits the expressiveness of the template. If you need the more advanced functionality of Jinja templates, components that use them provide an `unsafe` init parameter - setting it to `False` will disable the sandbox environment and enable unsafe template rendering.

With unsafe template rendering, the [OutputAdapter](../pipeline-components/converters/outputadapter.mdx) and [ConditionalRouter](../pipeline-components/routers/conditionalrouter.mdx) components allow their `output_type` to be set to one of the [Haystack data classes](data-classes.mdx) such as `ChatMessage`, `Document`, or `Answer`.
With unsafe template rendering, the [OutputAdapter](../pipeline-components/converters/outputadapter.mdx) and [ConditionalRouter](../pipeline-components/routers/conditionalrouter.mdx) components allow their `output_type` to be set to one of the [Haystack data classes](data-classes.mdx) such as `ChatMessage`, `Document`, or `Answer`.
10 changes: 5 additions & 5 deletions docs-website/docs/concepts/metadata-filtering.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@ The available logic operators may vary depending on the specific Document Store

Here is a more complex filter that uses both Comparison and Logic to find documents where:

- Meta field `type` is "article",
- Meta field `date` is between 1420066800 and 1609455600 (a specific date range),
- Meta field `rating` is greater than or equal to 3,
- Documents are either classified as `genre`  ["economy", "politics"] `OR` the meta field `publisher` is "nytimes".
- Meta field `type` is "article",
- Meta field `date` is between 1420066800 and 1609455600 (a specific date range),
- Meta field `rating` is greater than or equal to 3,
- Documents are either classified as `genre` ["economy", "politics"] `OR` the meta field `publisher` is "nytimes".

```python
filters = {
Expand Down Expand Up @@ -133,7 +133,7 @@ pipeline.run(
)
```

In Document Stores, the `filter_documents` method is used to apply filters to stored documents, if the specific integration supports filtering.
In Document Stores, the `filter_documents` method is used to apply filters to stored documents, if the specific integration supports filtering.

The example below shows how filters can be passed to the `QdrantDocumentStore`:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Learn how to pause and resume Haystack pipeline or Agent execution using breakpo

## Introduction

Haystack pipelines support breakpoints for debugging complex execution flows. A `Breakpoint` allows you to pause the execution at specific components, inspect the pipeline state, and resume execution from saved snapshots. This feature works for any regular component as well as an `Agent` component.
Haystack pipelines support breakpoints for debugging complex execution flows. A `Breakpoint` allows you to pause the execution at specific components, inspect the pipeline state, and resume execution from saved snapshots. This feature works for any regular component as well as an `Agent` component.

You can set a `Breakpoint` on any component in a pipeline with a specific visit count. When triggered, the system stops the execution of the `Pipeline` and captures a snapshot of the current pipeline state. The state can be saved to a JSON file when snapshot file saving is enabled, see [Snapshot file saving](#snapshot-file-saving) below. You can inspect and modify the snapshot and use it to resume execution from the exact point where it stopped.

Expand Down Expand Up @@ -115,7 +115,7 @@ print(result["llm"]["replies"])

You can also set breakpoints in an Agent component. An Agent supports two types of breakpoints:

1. **Chat Generator Breakpoint**: Pauses before LLM calls.
1. **Chat Generator Breakpoint**: Pauses before LLM calls.
2. **Tool Invoker Breakpoint**: Pauses before any tool execution.

A `ChatGenerator` breakpoint is defined as shown below. You need to define a `Breakpoint` as for a pipeline breakpoint and then an `AgentBreakpoint` where you pass the breakpoint defined before and the name of Agent component.
Expand Down Expand Up @@ -148,7 +148,7 @@ agent_breakpoint = AgentBreakpoint(break_point=tool_bp, agent_name="my_agent")

### Resuming Agent Execution

When an Agent breakpoint is triggered, you can resume execution using the saved snapshot. Similar to the regular component in a pipeline, pass the JSON file with the snapshot to the `run()` method of the pipeline.
When an Agent breakpoint is triggered, you can resume execution using the saved snapshot. Similar to the regular component in a pipeline, pass the JSON file with the snapshot to the `run()` method of the pipeline.

```python
from haystack.core.pipeline.breakpoint import load_pipeline_snapshot
Expand Down
2 changes: 1 addition & 1 deletion docs-website/docs/development/deployment/kubernetes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ spec:

```

After applying the above to an existing Kubernetes cluster, a `hayhooks` Pod will show up as a Service called `haystack-service`.
After applying the above to an existing Kubernetes cluster, a `hayhooks` Pod will show up as a Service called `haystack-service`.
<ClickableImage src="/img/6eb9fb0c7b00367bfbe8182ffc7c3746f3f3d03b720e963df045e28160362d7f-Screenshot_2025-04-15_at_16.15.28.png" alt="Kubernetes Lens interface showing the hayhooks Pod running in the default namespace with status Running" />

Note that the `Service` defined above is of type `ClusterIP`. That means it's exposed only _inside_ the Kubernetes cluster. To expose the Hayhooks API to the _outside_ world as well, you need a `NodePort` or `Ingress` resource. As an alternative, it's also possible to use [Port Forwarding](https://kubernetes.io/docs/tasks/access-application-cluster/port-forward-access-application-cluster/) to access the `Service` locally.
Expand Down
4 changes: 2 additions & 2 deletions docs-website/docs/development/logging.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ Haystack logs through Python’s standard library. This gives you full flexibili

### Changing the Log Level

By default, Haystack's logging level is set to `WARNING`. To display more information, you can change it to `INFO`. This way, not only warnings but also information messages are displayed in the console output.
By default, Haystack's logging level is set to `WARNING`. To display more information, you can change it to `INFO`. This way, not only warnings but also information messages are displayed in the console output.

To change the logging level to `INFO`, run:
To change the logging level to `INFO`, run:

```python
import logging
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ A Document Store for storing and retrieval from Azure AI Search Index.

This integration requires you to have an active Azure subscription with a deployed [Azure AI Search](https://azure.microsoft.com/en-us/products/ai-services/ai-search) service.

Once you have the subscription, install the `azure-ai-search-haystack` integration:
Once you have the subscription, install the `azure-ai-search-haystack` integration:

```python
pip install azure-ai-search-haystack
Expand All @@ -36,7 +36,7 @@ To use the `AzureAISearchDocumentStore`, you need to provide a search service en

During initialization the Document Store will either retrieve the existing search index for the given `index_name` or create a new one if it doesn't already exist. Note that one of the limitations of `AzureAISearchDocumentStore` is that the fields of the Azure search index cannot be modified through the API after creation. Therefore, any additional fields beyond the default ones must be provided as `metadata_fields` during the Document Store's initialization. However, if needed, [Azure AI portal](https://azure.microsoft.com/) can be used to modify the fields without deleting the index.

It is recommended to pass authentication data through `AZURE_AI_SEARCH_API_KEY` and `AZURE_AI_SEARCH_ENDPOINT` before running the following example.
It is recommended to pass authentication data through `AZURE_AI_SEARCH_API_KEY` and `AZURE_AI_SEARCH_ENDPOINT` before running the following example.

```python
from haystack_integrations.document_stores.azure_ai_search import (
Expand Down
6 changes: 3 additions & 3 deletions docs-website/docs/document-stores/chromadocumentstore.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ slug: "/chromadocumentstore"

</div>

[Chroma](https://docs.trychroma.com/) is an open source vector database capable of storing collections of documents along with their metadata, creating embeddings for documents and queries, and searching the collections filtering by document metadata or content. Additionally, Chroma supports multi-modal embedding functions.
[Chroma](https://docs.trychroma.com/) is an open source vector database capable of storing collections of documents along with their metadata, creating embeddings for documents and queries, and searching the collections filtering by document metadata or content. Additionally, Chroma supports multi-modal embedding functions.

Chroma can be used in-memory, as an embedded database, or in a client-server fashion. When running in-memory, Chroma can still keep its contents on disk across different sessions. This allows users to quickly put together prototypes using the in-memory version and later move to production, where the client-server version is deployed.

Expand All @@ -27,7 +27,7 @@ First, install the Chroma integration, which will install Haystack and Chroma if
pip install chroma-haystack
```

To store data in Chroma, create a `ChromaDocumentStore` instance and write documents with:
To store data in Chroma, create a `ChromaDocumentStore` instance and write documents with:

```python
from haystack_integrations.document_stores.chroma import ChromaDocumentStore
Expand All @@ -47,7 +47,7 @@ In this case, since we didn’t pass any embeddings along with our documents, Ch

### Connection Options

1. **In-Memory Mode (Local)**: Chroma can be set up as a local Document Store for fast and lightweight usage. You can use this option during development or small-scale experiments. Set up a local in-memory instance of `ChromaDocumentStore` like this:
1. **In-Memory Mode (Local)**: Chroma can be set up as a local Document Store for fast and lightweight usage. You can use this option during development or small-scale experiments. Set up a local in-memory instance of `ChromaDocumentStore` like this:

```python
from haystack_integrations.document_stores.chroma import ChromaDocumentStore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ It features the approximate nearest neighbours (ANN) search.

### Initialization

[Install](https://www.elastic.co/guide/en/elasticsearch/reference/current/install-elasticsearch.html) Elasticsearch and then [start](https://www.elastic.co/guide/en/elasticsearch/reference/current/starting-elasticsearch.html) an instance. Haystack supports Elasticsearch 8.
[Install](https://www.elastic.co/guide/en/elasticsearch/reference/current/install-elasticsearch.html) Elasticsearch and then [start](https://www.elastic.co/guide/en/elasticsearch/reference/current/starting-elasticsearch.html) an instance. Haystack supports Elasticsearch 8.

If you have Docker set up, we recommend pulling the Docker image and running it.

Expand Down
Loading