Find answers from the community

Home
Members
Julowin
J
Julowin
Offline, last seen 3 months ago
Joined September 25, 2024
Hi guys, is there anyway to get Node in vectorstore or vector index when metadata is known in advance? My case is i have metadata is a link (and it known in advance) and i want get all Node with this metadata (get Node for pass it in my customQueryEngine).

here is example what i want:
Plain Text
# Load the storage context
index = vin_retriever.index
list_link = ['https://www.vinmec.com/vi/tin-tuc/5-dieu-can-biet-ve-viem-phoi-cap-do-virus-corona/','https://www.vinmec.com/vi/tin-tuc/5-dieu-can-biet-ve-viem-phoi-cap-do-virus-corona/']

node_list =[]
# Iterate over all nodes in the storage context
for node in index.vector_store.nodes:
    if node.metadata['url'] in list_link:
        node_list.append(node)


Another way i found is using MetadataFilters but i can't match Filter with multi value with same key (work with 1 filter, not with multi):
Plain Text
filters = MetadataFilters(
    filters=[
        ExactMatchFilter(key="url", value=list_link[1]),
        ExactMatchFilter(key="url", value=list_link[0]),
        ExactMatchFilter(key="url", value=list_link[2]),
        # Add more filters as needed
    ]
)

# Get the retriever with the filters
retriever = index.as_retriever(filters=filters)

Any idea? please
10 comments
W
J
hallo guys, Is there a way of enabling an agent to ask a user for input as an intermediate step? like including in the list of tools one "useful for asking for missing information", however with the important difference that the user should act as the oracle and not an llm. Then, the agent could use the user's input to decide next steps.? A good example is that how Perplexity AI copilot work, and that really impressing me.
5 comments
s
J
T
hello guys, is there anyways to handle with 'Ambiguity' and 'Lack of knowledge' for LLMs Text2SQL (im using GPT 3.5)? can you guys provide for me some paper or method please. I'm already re-search but i have no idea.
Example of my proplem:
query: Give me all clothes at Vietnam'
prompt:
Schema of database,.....
create table clothes(
id int,
price money,
region string,
),....


im just give the prompt Zero shot like this, this mean LLMs will lack of knowledged about list of region. I also try few-shot, with give some row example =3 but it still not solved my proplem, because for some another table have custome field.

Thank