crewAIInc / crewAI

Framework for orchestrating role-playing, autonomous AI agents. By fostering collaborative intelligence, CrewAI empowers agents to work together seamlessly, tackling complex tasks.
https://crewai.com
MIT License
21.24k stars 2.95k forks source link

i have a Issue with WebsiteSearchTool: Embedding Dimension Mismatch #1058

Open Jasonk0825 opened 3 months ago

Jasonk0825 commented 3 months ago

I'm encountering an error while trying to use the WebsiteSearchTool with Gemini Pro as the LLM. The error message is:

"Embedding dimension 768 does not match collection dimensionality 1536. This is commonly a side-effect when an embedding function, different from the one used to add the embeddings, is used to retrieve an embedding from the database."

To resolve this, I tried changing the embedding model to "models/text-embedding-004", but the same error persists. Here's my current configuration:

web_rag_tool = WebsiteSearchTool(
    config=dict(
        llm=dict(
            provider="google",
            config=dict(
                model="gemini-pro",
                temperature=0.7,
            ),
        ),
    )
)
        embedder=dict(
            provider="google",
            config=dict(
                model="models/text-embedding-004",
                task_type="retrieval_document",
            ),
        ),
    )
)

I'm unsure why the error mentions 768 dimensions when I'm using "models/text-embedding-004", which should produce 1024-dimensional embeddings.

Questions:

Is there a compatibility issue between Gemini Pro and the current embedding setup in WebsiteSearchTool? Are there any known issues or additional configurations needed when using Google's embedding models with this tool? How can I ensure that the correct embedding model is being used and properly recognized by the tool? Any guidance on resolving this dimension mismatch would be greatly appreciated. Thank you!

Jatayu-u commented 3 months ago

Hey @Jasonk0825, I am facing a similar issue. Did you get a solution for this?

brukted commented 2 months ago

+1

guilegarcia commented 1 month ago

+1