Data Flow in Haystack Enterprise Platform
Explore the journey of data in Haystack Enterprise Platform, from upload or storage connection through processing to output.
Where Is My Data?
Where your files are stored depends on whether you upload synchronously or asynchronously, and on whether you connect your own virtual private cloud (VPC), like an AWS S3 bucket.
Uploading Files
All files uploaded to Haystack Enterprise Platform are eventually stored in the Haystack Platform AWS S3 bucket. When you upload synchronously, the files go through the Haystack Platform main API service before they're sent to S3. When you upload asynchronously, using sessions, your files go directly to the S3 bucket.
Haystack Enterprise Platform is also connected to a SQL database. It stores information about files, such as file name, file id, and creation time, but not their contents.

When you use your own VPC, like AWS S3 or OpenSearch, to store files, your files remain in your storage at all times. You authorize Haystack Platform to communicate with it when it needs to index the files.

Enabling Indexes
Enabling an index triggers indexing: your files are preprocessed, chunked into pieces of raw text called Documents, and stored in the document store. OpenSearchDocumentStore is the default document store of Haystack Enterprise Platform, but you can use any other supported database.
During indexing:
- product fetches the names of files to index from the database.
- It then communicates these file names to the index.
- The index fetches the actual files from the data storage and starts indexing. The files are temporarily stored in the Haystack Platform indexing service.
- The index preprocesses the files and sends the resulting documents to the document store. After that, the files are deleted from the temporary location.
This graphic shows the flow with OpenSearchDocumentStore:

The process is the same whether you store your files in Haystack Platform or in a private AWS S3 bucket. To keep your data in your accounts, we recommend connecting a private AWS S3 bucket and a private OpenSearch cluster. Otherwise, the documents (chunked files) are still stored in OpenSearch.

Searching
Your query goes to the query pipeline, where the Retriever node connects with the OpenSearchDocumentStore and fetches the documents that match the query.

If you use your private OpenSearch cluster, you authorize Haystack Platform to connect to it at query time, and the query pipeline fetches the documents from there.

These documents are held in temporary memory and not saved anywhere. In a question answering pipeline, the Retriever passes them to the Reader or Generator, which produces the final answer.
The query results are stored in the Haystack Platform SQL database, which is protected and accessible only to selected Haystack Platform employees.
Using Hosted Models
You can use models hosted by OpenAI, Hugging Face, Cohere, Azure OpenAI, SageMaker, or Amazon Bedrock in your query pipelines. For the full list, see Using Hosted Models and External Services.
To use a hosted model, you first connect to the model provider using your credentials. The encrypted credentials are securely stored in the database. When you make a query, Haystack Platform sends an HTTP request to the model provider with your credentials in the request header. If authorization succeeds, the model sends its response back to Haystack Enterprise Platform.

When using a hosted model, remember that your pipeline's stability depends on the model provider. If you disconnect Haystack Platform from a model provider, all pipelines using models hosted by this provider stop working.
Was this page helpful?