Find answers from the community

H
HK
Offline, last seen 2 months ago
Joined September 25, 2024
I am using ReACT agent and I am trying to set a variable mapping like this:

agent = ReActAgent.from_tools(tools=[ask_followup_question_tool],llm=llm, verbose=True)
react_system_header_str = """

You have access to the following tools to ask a question:
{tool_desc}

You have access to the following attributes and values to guide your questions:
{unique_attributes}
"""
template_var_mappings = {str(unique_attributes): "unique_attributes"}
react_system_prompt = PromptTemplate(react_system_header_str, template_var_mappings=template_var_mappings)
agent.update_prompts({"agent_worker:system_prompt": react_system_prompt})
agent.reset()

response = agent.chat("bike")

--------
unique_attributes is string but I am getting this error when I use agent.chat: ---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
/Users/hasnain/Desktop/workspace/Embedding Finetuning/Advisor_Debugger.ipynb Cell 70 line 1
----> 1 response = agent.chat("A blue bike")
KeyError: 'unique_attributes'
7 comments
k
H
I am having an index having 170000 embeddings and if I use query engine then it takes 15-20 seconds to give me an answer. What is the most appropriate way to handle these many embeddings index. I want to have results within 2-3 seconds.
4 comments
H
L
I am building a RAG with llamaindex and I need to connect multiple modules to get this working. I want to have a;
  1. SQL query engine
  2. Vector Search
  3. Keyword search
  4. Image search (OpenAI ClIP)
How can I build a system like this? I have seen examples but till now i couldn't find any examples having more than 2 retrievers.
2 comments
H
W
I am building a RAG with llamaindex and I need to connect multiple modules to get this working. I want to have a;
SQL query engine
Vector Search
Keyword search
Image search (OpenAI ClIP)

How can I build a system like this? I have seen examples but till now i couldn't find any examples having more than 2 retrievers.
3 comments
k
I am working on finetuning embeddings for my RAG pipeline and I have followed LLamaindex finetuning to finetune "intfloat/multilingual-e5-large-instruct". I have ecomemrce products data (product description) and description is having some numeric data as well for example, there can be size in cm (100 cm, 100 mm. 100 m) and there can be price in numeric format and there can be other numeric data as well. According to my experiments, Embedding models are not good with numeric data and if the search query is "XYZ with 50 cm long and 1000$ price" then it gives me the products related to XYZ ignoring the 50 cm and 1000$ price.

That's why I finetuned a model where I used GPT4 to generate synthetic search queries for each product and finetuned a model but finetuned model is worse than the baseline model. In synthetic queries, I made sure to include this numeric data as well according to each product but it seems like this is not working. What am I doing wrong?
52 comments
R
H
T
@kapa.ai I wanna finetune an embedding ("intfloat/multilingual-e5-large") for e-commerce products and I am curious how the data should look like for training/finetuning? I read a few articles and basically what everybody is doing is just creating question/answer pairs and then using that to finetune the model but in my case, against one query/question there can be more than 1 product so should I add all the possible products in answer against a query and if yes then how the data should look like?
7 comments
k
H
I have a question regarding query method. While creating the index, if I have some metadata like below:

nodes = [] for index, row in data_embedding.iterrows(): text_embedding = json.loads(row["embedding"]) text = row["combined"] node = TextNode(text=text, metadata={"uuid":row["uuid"], "brand_name": row["brand_name"]}, embedding=text_embedding) nodes.append(node) index = VectorStoreIndex(nodes=nodes) query_engine = index.as_query_engine(similarity_top_k=5)

While doing the quering using query method, do I have to pass metadata for this query as well or llamaindex will do this on its own in backend. I am really confused because I have seen a few videos where people were passing metadata explicitly and some were just defining the metadata in the TextNode but they didn't pass metadata in query. How exactly query method is working in backend with metadata?
5 comments
W
H
I have already created embeddings with OpenAI "text-embedding-3-large" and stored in supabase vector. Now, I have a table named "embeddings" where there is a column "embedding" having the vector embedding of size 1024 and a column named "docs" having the text belongs to each embedding.

I have created LlamaIndex Supabase vectorstore and but the query is showing empty response. Why is that?

vector_store = SupabaseVectorStore( postgres_connection_string=( "URI string" ), collection_name="embeddings", dimension=1024 ) index = VectorStoreIndex.from_vector_store(vector_store=vector_store) query_engine = index.as_query_engine(similarity_top_k=3) response = query_engine.query("Can you show me some funds?")
Now the response is empty.
4 comments
H
L
@kapa.ai Hello everyone, I am working on a RAG project where I built a very simple pipeline with OpenAI embeddings (with no modules from Llamaindex) and doing simple embedding similarity and it is working good but there are a few problems such as it is not asking follow-up questions to have more precise results and I think that's where I will need to implement agents. I have been reading LlamaIndex documentation and I read about Controllable agents which can be used to ask followup questions but still there are a number of questions and confusions about how to use Controllable agents in such a way that it should ask some relevant followup question before doing retrieval.

Would it be enough to just add a tool def ask_follow_up_question and let the agent think about asking a question or doing the retrieval search? I know this is not an easy question without knowing the context and the problem I am working on so here is a bit more details;

Let's suppose you are having a furniture shop where you are selling bed, sofa, etc. user is asking a query "Do you have any king size bed?"
Then the answer should be "Yes" but a few followup questions can be ["Do you have any budget in mind", "Do you have any color preferences?", "What kind of material are you looking for?", etc]

So how can I implement an agent like this? Any help would be appreciated and you can point me towards some useful links as well. Thanks 🙂
10 comments
k
H