Vector Stores¶
ChromaStore
¶
ChromaStore persistence interface.
Purpose
Adds LangChain documents to a persistent Chroma vector collection.
Attributes:
| Name | Type | Description |
|---|---|---|
documents |
List[Document]
|
Documents for the current write. |
embedder |
Embeddings | None
|
Embedding adapter. |
collection_name |
str
|
Chroma collection name. |
persist_directory |
str
|
Persistent collection directory. |
vector_store |
Chroma | None
|
Active Chroma vector-store instance. |
Initialize Chroma vector storage state without connecting to a provider.
Purpose
Initialize Chroma vector storage state without connecting to a provider.
Returns:
| Name | Type | Description |
|---|---|---|
None |
None
|
Completes the operation through side effects. |
Source code in storage.py
Methods:¶
create
¶
create(
documents: List[Document],
embedder: Embeddings,
collection_name: str,
persist_directory: str,
) -> Chroma
Store LangChain document chunks in a persistent Chroma collection.
Purpose
Store LangChain document chunks in a persistent Chroma collection.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
documents
|
List[Document]
|
LangChain documents for vector storage. |
required |
embedder
|
Embeddings
|
LangChain embedding implementation. |
required |
collection_name
|
str
|
Chroma collection name. |
required |
persist_directory
|
str
|
Chroma persistence directory. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Chroma |
Chroma
|
Result of the create operation. |
Source code in storage.py
PineconeStore
¶
PineconeStore persistence interface.
Purpose
Adds LangChain documents to an existing managed Pinecone index.
Attributes:
| Name | Type | Description |
|---|---|---|
documents |
List[Document]
|
Documents for the current write. |
embedder |
Embeddings | None
|
Embedding adapter. |
index_name |
str
|
Pinecone index name. |
namespace |
str
|
Pinecone namespace. |
api_key |
str
|
Pinecone credential. |
client |
Any
|
Pinecone client. |
vector_store |
Any
|
Active Pinecone vector-store adapter. |
Initialize Pinecone vector storage state without connecting to a provider.
Purpose
Initialize Pinecone vector storage state without connecting to a provider.
Returns:
| Name | Type | Description |
|---|---|---|
None |
None
|
Completes the operation through side effects. |
Source code in storage.py
Methods:¶
create
¶
create(
documents: List[Document],
embedder: Embeddings,
index_name: str,
namespace: str,
api_key: str,
) -> Any
Store LangChain document chunks in an existing Pinecone index.
Purpose
Store LangChain document chunks in an existing Pinecone index.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
documents
|
List[Document]
|
LangChain documents for vector storage. |
required |
embedder
|
Embeddings
|
LangChain embedding implementation. |
required |
index_name
|
str
|
Existing Pinecone index name. |
required |
namespace
|
str
|
Optional cache namespace. |
required |
api_key
|
str
|
Pinecone API credential. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Any |
Any
|
Result of the create operation. |