Skip to content
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

[Issue]: QdrantRetrieveUserProxyAgent is missing support for text-embedding-ada-002 embedding model #1282

Closed
Tracked by #1657
Halpph opened this issue Jan 16, 2024 · 6 comments
Labels
rag retrieve-augmented generative agents

Comments

@Halpph
Copy link

Halpph commented Jan 16, 2024

Describe the issue

Issue Overview:
In this GitHub issue, the proposal for implementing QdrantRetrieveUserProxyAgent has been successfully executed. However, upon attempting to use the feature, it was discovered that the current implementation relies on the qdrant_client, which in turn depends on fastembedding. Consequently, only a specific set of models listed in SUPPORTED_EMBEDDING_MODELS are supported. SUPPORTED_EMBEDDING_MODELS: Dict[str, Tuple[int, models.Distance]] = { "BAAI/bge-base-en": (768, models.Distance.COSINE), "sentence-transformers/all-MiniLM-L6-v2": (384, models.Distance.COSINE), "BAAI/bge-small-en": (384, models.Distance.COSINE), "BAAI/bge-small-en-v1.5": (384, models.Distance.COSINE), "BAAI/bge-base-en-v1.5": (768, models.Distance.COSINE), "intfloat/multilingual-e5-large": (1024, models.Distance.COSINE), }.

Enhancement Proposal:
It is suggested that the support for additional models be extended beyond the current list. A reference implementation, inspired by the approach taken in Issue 253, is provided below:

from litellm import embedding as test_embedding

embed_response = test_embedding('text-embedding-ada-002', input=query_texts)

all_embeddings: List[List[float]] = []

for item in embed_response['data']:
    all_embeddings.append(item['embedding'])

search_queries: List[SearchRequest] = []

for embedding in all_embeddings:
    search_queries.append(
        SearchRequest(
            vector=embedding,
            filter=Filter(
                must=[
                    FieldCondition(
                        key="page_content",
                        match=MatchText(
                            text=search_string,
                        )
                    )
                ]
            ),
            limit=n_results,
            with_payload=True,
        )
    )

search_response = client.search_batch(
    collection_name="{your collection name}",
    requests=search_queries,
)

This adds dependencies on litellm but I think your contribution to this enhancement would greatly benefit the community by expanding the scope of supported models and enhancing the overall utility of QdrantRetrieveUserProxyAgent.

Steps to reproduce

No response

Screenshots and logs

No response

Additional Information

No response

@ekzhu ekzhu added the rag retrieve-augmented generative agents label Jan 16, 2024
@ekzhu
Copy link
Collaborator

ekzhu commented Jan 16, 2024

We are currently understaffed on the RAG front. Would you be willing to submit a PR to fix this issue?

@ykim-isabel
Copy link

We've come up with a complete pull request for this issue using any general embedding function that returns a list of embeddings. We'll post our pull request in the next few hours.

@vitorsabbagh
Copy link

We've come up with a complete pull request for this issue using any general embedding function that returns a list of embeddings. We'll post our pull request in the next few hours.

Is this implemented?

@ykim-isabel
Copy link

We'll submit the draft pull request for review.

@joshkyh
Copy link
Collaborator

joshkyh commented Feb 19, 2024

I have also just tried to use ada-embedding by performing the vectorization of chunks outside of Autogen, using LlamaIndex. And then trying to query the populated QDrant database using the notebook example at https://github.com/microsoft/autogen/blob/main/notebook/agentchat_qdrant_RetrieveChat.ipynb
using "embedding_model": "default", and docs_path: None.

However, the error message is that embedding_model must be one of the 12 options at https://qdrant.github.io/fastembed/examples/Supported_Models/, and ada is not in it.

@thinkall thinkall mentioned this issue Apr 6, 2024
11 tasks
@thinkall
Copy link
Collaborator

Close as no active response for a long time. Please reopen it or create a new issue if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rag retrieve-augmented generative agents
Projects
None yet
Development

No branches or pull requests

6 participants