Skip to content

build(deps): drop langchain-chroma dependency - #541

Open
amirfz wants to merge 1 commit into
mainfrom
deps/drop-langchain-chroma
Open

build(deps): drop langchain-chroma dependency#541
amirfz wants to merge 1 commit into
mainfrom
deps/drop-langchain-chroma

Conversation

@amirfz

@amirfz amirfz commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Supersedes #532 (langchain-chroma 0.2.6 → 1.1.0) — instead of bumping it, this drops the dependency entirely.

langchain-chroma added nothing sherpa-ai actually used: LocalChromaStore and configure_chroma in vectorstores.py were thin wrappers around langchain_chroma.Chroma, and chromadb (the real vector DB client) is already a hard dependency — chroma_vector_store.py's ChromaVectorStore never used langchain-chroma to begin with.

Changes

  • LocalChromaStore now subclasses langchain_core.vectorstores.VectorStore directly and talks to chromadb via EphemeralClient() (or an injected client, for configure_chroma's remote-server case). Public surface is unchanged — same class name, from_folder(), similarity_search(), as_retriever() — so get_vectordb() and ContextSearch (its only real caller) need no changes.
  • query_chroma.py's one-off script use is replaced with chromadb's own query API + embedding_functions.OpenAIEmbeddingFunction (langchain's Embeddings interface isn't what chromadb's collection embedding_function param expects — different protocol, worth calling out since it's an easy mismatch to introduce).
  • test_context_search.py's availability check was gating on langchain_chroma being importable; updated to check chromadb instead — otherwise this real end-to-end test would have started silently skipping the moment langchain-chroma was uninstalled, without anyone noticing.
  • Added a focused round-trip test for LocalChromaStore (add_texts + similarity_search, with metadata) using a small deterministic fake embedding function — there was no dedicated test for this class before.
  • poetry.lock regenerated with the same Poetry version as the existing lock (2.2.1) to avoid unrelated format churn.

Verification

  • Mutated add_texts to drop metadata and confirmed both new tests fail; reverted and confirmed green.
  • Full suite (386 passed, 2 skipped) run for real with langchain-chroma uninstalled from the environment, not just removed from pyproject.toml.

Test plan

  • pytest tests/unit_tests/connectors/test_local_chroma_store.py — new round-trip tests pass
  • pytest tests/unit_tests/actions/test_context_search.py — real ContextSearchget_vectordb()LocalChromaStore path exercised, passes
  • Full suite — 386 passed, 2 skipped, langchain-chroma not installed
  • Mutation test on add_texts metadata handling — caught, reverted
  • CI on this PR

Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com

langchain-chroma added nothing sherpa-ai actually used: LocalChromaStore
and configure_chroma were thin wrappers around langchain_chroma.Chroma,
and chromadb (the actual vector DB client) is already a hard dependency
of the project (see chroma_vector_store.py, which never used
langchain-chroma to begin with).

LocalChromaStore now subclasses langchain_core.vectorstores.VectorStore
directly and talks to chromadb via an EphemeralClient (or an injected
client, for configure_chroma's remote-server case), instead of going
through the wrapper package. Public surface — class name, from_folder(),
similarity_search(), as_retriever() — is unchanged, so get_vectordb()
and ContextSearch (its only real caller) don't need to change at all.
query_chroma.py's one-off script use is replaced with chromadb's own
query API plus its own OpenAIEmbeddingFunction (langchain's Embeddings
interface isn't what chromadb's collection embedding_function expects).

test_context_search.py's availability check was gating on langchain_chroma
being importable; updated to check chromadb instead, since that's what's
now actually required — otherwise this real end-to-end test would have
started silently skipping the moment langchain-chroma was uninstalled.

Added a focused round-trip test for LocalChromaStore itself (add_texts +
similarity_search, with metadata) using a small deterministic fake
embedding function — there was no dedicated test for this class before.
Verified by mutating add_texts to drop metadata and confirming both new
tests fail, then reverting.

Full suite (386 passed, 2 skipped) run for real with langchain-chroma
uninstalled from the environment, not just removed from pyproject.toml.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@amirfz
amirfz force-pushed the deps/drop-langchain-chroma branch from f26c853 to 309a1f0 Compare August 1, 2026 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant