mem0ai / mem0

The Memory layer for your AI apps
https://mem0.ai
Apache License 2.0
22.94k stars 2.11k forks source link

Embedchain upgrade to latest version error #2027

Open Rainismer opened 1 week ago

Rainismer commented 1 week ago

🐛 Describe the bug

Using embedchain version 0.1.124 everything works fine, but when upgrading to 0.1.125, chroma errors occur.

TypeError: SegmentAPI.get_or_create_collection() got an unexpected keyword argument 'embedding_function'

AbhigyaWangoo commented 4 days ago

The key problem is the version upgrade from 0.1.124 to 0.1.125 causing a TypeError with SegmentAPI's get_or_create_collection() method, specifically related to the embedding_function argument.

Here's a step-by-step resolution:

  1. Update ChromaDB Dependency First, ensure you're using a compatible version of ChromaDB. Update to at least version 0.4.13:

    pip install chromadb>=0.4.13
  2. Modify Collection Initialization Update your code to explicitly handle collection creation:

from embedchain import App

# Option 1: Specify collection name explicitly
app = App(config={
    "collection_name": "my_custom_collection"
})

# Option 2: If using a specific embedding function
from embedchain.embedder.openai import OpenAIEmbedder

embedder = OpenAIEmbedder()
app = App(embedder=embedder)
  1. Potential Configuration Workaround If the above doesn't work, create a configuration file (config.yaml):

    vectordb:
    provider: chroma
    config:
    collection_name: 'my-app-collection'
  2. Clean Slate Approach If persistent issues occur:

    • Delete existing Chroma DB folder
    • Ensure embedding dimensions match your vector store configuration
    • Reinstall Embedchain and ChromaDB

Recommendations:

Would you like me to elaborate on any of these steps or do you need more specific guidance based on your exact implementation?

Rainismer commented 4 days ago

@AbhigyaWangoo Thank you for your reply, but it doesn't work for me.

AbhigyaWangoo commented 2 days ago

What specifically won't work for you?