community: add len() implementation to Chroma
diff --git a/libs/community/langchain_community/vectorstores/chroma.py b/libs/community/langchain_community/vectorstores/chroma.py
index 3bcb389cff5e10..7723285fafa6c7 100644
--- a/libs/community/langchain_community/vectorstores/chroma.py
+++ b/libs/community/langchain_community/vectorstores/chroma.py
@@ -795,3 +795,7 @@ def delete(self, ids: Optional[List[str]] = None, **kwargs: Any) -> None:
             ids: List of ids to delete.
         """
         self._collection.delete(ids=ids)
+
+    def __len__(self) -> int:
+        """Count the number of documents in the collection."""
+        return self._collection.count()
diff --git a/libs/community/tests/integration_tests/vectorstores/test_chroma.py b/libs/community/tests/integration_tests/vectorstores/test_chroma.py
index 58e9bcf454e93a..0a0cf529d08e63 100644
--- a/libs/community/tests/integration_tests/vectorstores/test_chroma.py
+++ b/libs/community/tests/integration_tests/vectorstores/test_chroma.py
@@ -21,6 +21,7 @@ def test_chroma() -> None:
     )
     output = docsearch.similarity_search("foo", k=1)
     assert output == [Document(page_content="foo")]
+    assert len(docsearch) == 3
 
 
 async def test_chroma_async() -> None:

Thank you for contributing to LangChain!

- [x] **Add len() implementation to Chroma**: "package: community"


- [x] **PR message**: 
    - **Description:** add an implementation of the __len__() method for the Chroma vectostore, for convenience.
    - **Issue:** no exposed method to know the size of a Chroma vectorstore
    - **Dependencies:** None
    - **Twitter handle:** lowrank_adrian


- [x] **Add tests and docs**

- [x] **Lint and test**
