Adapters¶
Adapters allow graph-retriever
to connect to specific vector stores.
Vector Store | Supported | Collections | Dict-In-List | Nested Metadata | Optimized Adjacency |
---|---|---|---|---|---|
DataStax Astra | |||||
OpenSearch | |||||
Apache Cassandra | |||||
Chroma |
- Supported
-
Indicates whether a given store is completely supported () or has limited support ().
- Collections
-
Indicates whether the store supports lists in metadata values or not. Stores which do not support it directly () can be used by applying the ShreddingTransformer document transformer to documents before writing, which spreads the items of the collection into multiple metadata keys.
- Dict-In-List
-
Indicates the store supports using a dict-value in a list for edges. For example, when using named-entity recognition, you may have
entities = [{"type": "PERSON", "entity": "Bell"}, ...]
and wish to link nodes with the same entity using an edge defined as("entities", "entities")
. - Nested Metadata
-
Whether edges can be defined using values of nested metadata. For example,
page_structure.section
to access the section ID stored in metadata asmetadata["page_structure"] = { "section": ... }
. - Optimized Adjacency
-
Whether the store supports an optimized query for nodes adjacent to multiple edges. Without this optimization each edge must be queried separately. Stores that support the combined adjacent query perform much better, especially when retrieving large numbers of nodes and/or dealing with high connectivity.
Warning
Graph Retriever can be used with any of these supported Vector Stores. However, stores that operate directly on nested collections (without denormalization) and support optimized adjacency much more performant and better suited for production use. Stores like Chroma are best employed for early experimentation, while it is generally recommended to use a store like DataStax AstraDB when scaling up.
Supported Stores¶
Astra¶
DataStax AstraDB is
supported by the
AstraAdapter
. The adapter
supports operating on metadata containing both primitive and list values.
Additionally, it optimizes the request for nodes connected to multiple edges into a single query.
OpenSearch¶
OpenSearch is supported by the OpenSearchAdapter
. The adapter supports operating on metadata containing both primitive and list values. It does not perform an optimized adjacent query.
Apache Cassandra¶
Apache Cassandra is supported by the CassandraAdapter
. The adapter requires shredding metadata containing lists in order to use them as edges. It does not perform an optimized adjacent query.
Chroma¶
Chroma is supported by the ChromaAdapter
. The adapter requires shredding metadata containing lists in order to use them as edges. It does not perform an optimized adjacent query.
Implementation¶
The Adapter interface may be implemented directly. For LangChain VectorStores, LangchainAdapter and ShreddedLangchainAdapter provide much of the necessary functionality.