ArangoEmbeddingRetriever
Retrieve documents from an ArangoDocumentStore using vector similarity search. Use this component in query pipelines to find semantically similar documents based on dense embeddings.
The embedding model you use to embed documents in your indexing pipeline must be the same as the embedding model you use to embed the query in your query pipeline.
This means the embedders for your indexing and query pipelines must match. For example, if you use CohereDocumentEmbedder to embed your documents, you should use CohereTextEmbedder with the same model to embed your queries.
Key Features
- Performs vector similarity search against documents stored in ArangoDB.
- Supports cosine, dot product, and L2 similarity functions defined on the document store.
- Applies optional metadata filters at retrieval time.
- Requires ArangoDB 3.12 or later for vector search.
Configuration
Add Workspace-Level Integration
- Click your profile icon and choose Settings.
- Go to Workspace>Integrations.
- Find the provider you want to connect and click Connect next to them.
- Enter the API key and any other required details.
- Click Connect. You can use this integration in pipelines and indexes in the current workspace.
Add Organization-Level Integration
- Click your profile icon and choose Settings.
- Go to Organization>Integrations.
- Find the provider you want to connect and click Connect next to them.
- Enter the API key and any other required details.
- Click Connect. You can use this integration in pipelines and indexes in all workspaces in the current organization.
- First, configure an
ArangoDocumentStorein your pipeline. - Drag the
ArangoEmbeddingRetrievercomponent onto the canvas from the Component Library. - Connect an embedder component to provide
query_embeddingas input. - Connect the retriever output to downstream components such as
PromptBuilder.
Connections
ArangoEmbeddingRetriever receives a query_embedding (list of floats) from a text embedder such as SentenceTransformersTextEmbedder. It outputs a list of Document objects you can connect to PromptBuilder or other downstream components.
Source Code
To check this component's source code, open embedding_retriever.py in the Haystack Core Integrations repository.
Usage Examples
Basic Configuration
ArangoEmbeddingRetriever:
type: haystack_integrations.components.retrievers.arangodb.embedding_retriever.ArangoEmbeddingRetriever
init_parameters:
document_store: ArangoDocumentStore
top_k: 5
Using the Component in a Pipeline
# haystack-pipeline
components:
text_embedder:
type: haystack.components.embedders.sentence_transformers_text_embedder.SentenceTransformersTextEmbedder
init_parameters:
model: sentence-transformers/all-MiniLM-L6-v2
document_store:
type: haystack_integrations.document_stores.arangodb.document_store.ArangoDocumentStore
init_parameters:
host: http://localhost:8529
database: haystack
username:
type: env_var
env_vars:
- ARANGO_USERNAME
strict: false
password:
type: env_var
env_vars:
- ARANGO_PASSWORD
strict: false
embedding_dimension: 384
retriever:
type: haystack_integrations.components.retrievers.arangodb.embedding_retriever.ArangoEmbeddingRetriever
init_parameters:
document_store: document_store
top_k: 5
connections:
- sender: text_embedder.embedding
receiver: retriever.query_embedding
inputs:
query:
- text_embedder.text
outputs:
documents: retriever.documents
Parameters
Inputs
| Parameter | Type | Description |
|---|---|---|
query_embedding | List[float] | The query embedding vector to search for similar documents. |
top_k | Optional[int] | The maximum number of documents to retrieve. Overrides the init-time value. |
filters | Optional[Dict[str, Any]] | Filters to apply when retrieving documents. Overrides the init-time value. |
Outputs
| Parameter | Type | Description |
|---|---|---|
documents | List[Document] | A list of the most similar documents from the document store, sorted by score. |
Init Parameters
These are the parameters you can configure in Pipeline Builder:
| Parameter | Type | Default | Description |
|---|---|---|---|
document_store | ArangoDocumentStore | The ArangoDB document store to retrieve documents from. | |
top_k | int | 10 | The maximum number of documents to retrieve. |
filters | Optional[Dict[str, Any]] | None | Default filters to apply when retrieving documents. |
Run Method Parameters
These are the parameters you can configure for the component's run() method. This means you can pass these parameters at query time through the API, in Playground, or when running a job. For details, see Modify Pipeline Parameters at Query Time.
| Parameter | Type | Default | Description |
|---|---|---|---|
query_embedding | List[float] | The embedding vector to search with. | |
top_k | Optional[int] | None | Maximum number of documents to retrieve. Overrides the init-time value. |
filters | Optional[Dict[str, Any]] | None | Runtime filters to apply. Overrides the init-time value. |
Related Information
Was this page helpful?