Skip to content

Segmentation fault (core dumped) - while using Chroma from langchain_chroma #30589

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
5 tasks done
Yash2003Bisht opened this issue Apr 1, 2025 · 1 comment
Open
5 tasks done
Labels
investigate Flagged for investigation. Ɑ: vector store Related to vector store module

Comments

@Yash2003Bisht
Copy link

Yash2003Bisht commented Apr 1, 2025

Checked other resources

  • I added a very descriptive title to this issue.
  • I searched the LangChain documentation with the integrated search.
  • I used the GitHub search to find a similar question and didn't find it.
  • I am sure that this is a bug in LangChain rather than my code.
  • The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package).

Example Code

def find_similar_pages(self, query: str, website_id: int, 
                          num_results: int = 5) -> List[Dict[str, Any]]:
        """
        Find similar pages for a given query within a specific website.
        Returns pages with similarity scores >= 0.4
        """
        try:
            results = self.vectorstore.similarity_search_with_relevance_scores(
                query,
                k=num_results,
                score_threshold=0.4,
                filter={"website_id": website_id},
            )

            similar_pages = []
            for doc, similarity_score in results:
                metadata = doc.metadata
                similar_pages.append({
                    "url": metadata["url"],
                    "title": metadata["title"],
                    "summary": doc.page_content.split("\n\n")[1],
                    "query": query,
                    "similarity": round(similarity_score, 3)
                })
            
            logger.debug(f"Found {len(similar_pages)} similar pages for website_id {website_id}")
            return similar_pages
            
        except Exception as e:
            logger.error(f"Error querying ChromaDB for website_id {website_id}: {str(e)}", exc_info=True)
            return []

Error Message and Stack Trace (if applicable)

Image

Description

While performing the similarity search with relevance score i get Segmentation fault (core dumped). I'm using HuggingFaceInferenceAPIEmbeddings to embed documents using sentence-transformers/all-MiniLM-L6-v2

System Info

System Information

OS: Linux
OS Version: #1 SMP PREEMPT_DYNAMIC Debian 6.1.128-1 (2025-02-07)
Python Version: 3.11.11 (main, Mar 17 2025, 23:23:20) [GCC 12.2.0]

Package Information

langchain_core: 0.3.30
langchain: 0.3.14
langchain_community: 0.3.14
langsmith: 0.2.11
langchain_chroma: 0.2.0
langchain_openai: 0.3.0
langchain_text_splitters: 0.3.5

Optional packages not installed

langserve

Other Dependencies

aiohttp: 3.8.4
async-timeout: 4.0.2
chromadb: 0.5.20
dataclasses-json: 0.6.1
fastapi: 0.115.6
httpx: 0.28.1
httpx-sse: 0.4.0
jsonpatch: 1.33
langsmith-pyo3: Installed. No version info available.
numpy: 1.26.1
openai: 1.59.8
orjson: 3.10.14
packaging: 23.2
pydantic: 2.10.5
pydantic-settings: 2.7.1
PyYAML: 6.0
requests: 2.31.0
requests-toolbelt: 1.0.0
SQLAlchemy: 2.0.22
tenacity: 8.2.3
tiktoken: 0.8.0
typing-extensions: 4.12.2
zstandard: Installed. No version info available.

@langcarl langcarl bot added the investigate Flagged for investigation. label Apr 1, 2025
@dosubot dosubot bot added the Ɑ: vector store Related to vector store module label Apr 1, 2025
@DvGils
Copy link

DvGils commented Apr 14, 2025

I had a very similar issue using DuckDB. It was fixed when i installed pandas. Might work for you as well. See #29933 (and related PRs #30435 & #30445)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
investigate Flagged for investigation. Ɑ: vector store Related to vector store module
Projects
None yet
Development

No branches or pull requests

2 participants