Weaviate
WeaviateDocumentRetriever
Bases: Retriever, WeaviateRetrieverVectorStoreParams
Document Retriever using Weaviate.
This class implements a document retriever that uses Weaviate as the vector store backend.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
vector_store |
WeaviateVectorStore
|
An instance of WeaviateVectorStore to interface with Weaviate vectors. |
required |
filters |
dict[str, Any]
|
Filters to apply for retrieving specific documents. Defaults to None. |
required |
top_k |
int
|
The maximum number of documents to return. Defaults to 10. |
required |
Attributes:
| Name | Type | Description |
|---|---|---|
group |
Literal[RETRIEVERS]
|
The group of the node. |
name |
str
|
The name of the node. |
vector_store |
WeaviateVectorStore | None
|
The WeaviateVectorStore instance. |
filters |
dict[str, Any] | None
|
Filters for document retrieval. |
top_k |
int
|
The maximum number of documents to return. |
document_retriever |
WeaviateDocumentRetriever
|
The document retriever component. |
Source code in dynamiq/nodes/retrievers/weaviate.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 | |
__init__(**kwargs)
Initialize the WeaviateDocumentRetriever.
If neither vector_store nor connection is provided in kwargs, a default Weaviate connection will be created.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
**kwargs |
Keyword arguments to initialize the retriever. |
{}
|
Source code in dynamiq/nodes/retrievers/weaviate.py
40 41 42 43 44 45 46 47 48 49 50 51 | |
execute(input_data, config=None, **kwargs)
Execute the document retrieval process.
This method retrieves documents based on the input embedding.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_data |
RetrieverInputSchema
|
The input data containing the query embedding. |
required |
config |
RunnableConfig
|
The configuration for the execution. Defaults to None. |
None
|
**kwargs |
Additional keyword arguments. |
{}
|
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
dict[str, Any]: A dictionary containing the retrieved documents. |
Source code in dynamiq/nodes/retrievers/weaviate.py
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 | |
init_components(connection_manager=None)
Initialize the components of the retriever.
This method sets up the document retriever component if it hasn't been initialized yet.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
connection_manager |
ConnectionManager
|
The connection manager to use. Defaults to a new ConnectionManager instance. |
None
|
Source code in dynamiq/nodes/retrievers/weaviate.py
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 | |