Find answers from the community

Updated 7 months ago

Ive made an issue

Ive made an issue
L
O
9 comments
This is fixed

pip install -U llama-index-vector-stores-qdrant
Saw it, thanks!
Do you know how to make this work btw? It used to work great with the default VectorStore but fails with Qdrant:

Plain Text
def find_documents(by, index, *,
                   order=None,
                   as_nodes=True):
    """
    Find documents in the index.

    Args:
        by (Callable): A function to filter the documents.
        index (llama_index.VectorStoreIndex): The index to search in.
        order (Callable): A function to order the retrieved documents. Defaults to None.
        as_nodes (bool, optional): Whether to return the documents as nodes. Defaults to True.

    Returns:
        list[Node]: The retrieved documents.
    """
    doc_store = index.storage_context.docstore

    doc_refs = [(doc_id, doc_ref) for doc_id, doc_ref in index.ref_doc_info.items()
                if by(doc_ref)]

    res = doc_refs
    if as_nodes:
        res = [node for _, doc_ref in doc_refs
               for node in doc_store.get_nodes(doc_ref.node_ids)]

    if order is not None:
        res = order(res)

    return res


Traceback:
Plain Text
  File "/mnt/1472CC7972CC615A/_DISK_/_Documentos_/Scripts/RAG_Develop/LlamaIndex_RAG_Qdrant/modules/summaries.py", line 63, in recent_news_summary
    documents = find_documents(DateInInterval(seven_days_ago, today),
  File "/mnt/1472CC7972CC615A/_DISK_/_Documentos_/Scripts/RAG_Develop/LlamaIndex_RAG_Qdrant/modules/index.py", line 281, in find_documents
    doc_refs = [(doc_id, doc_ref) for doc_id, doc_ref in index.ref_doc_info.items()
  File "/mnt/1472CC7972CC615A/_DISK_/_Documentos_/Scripts/RAG_Develop/LlamaIndex_RAG_Qdrant/.venv/lib/python3.10/site-packages/llama_index/core/indices/vector_store/base.py", line 385, in ref_doc_info
    raise NotImplementedError(
NotImplementedError: Vector store integrations that store text in the vector store are not supported by ref_doc_info yet.
This is how Im calling my function:

Plain Text
documents = find_documents(DateInInterval(seven_days_ago, today),
                           highlights_db,
                           order=OrderByDatetime)[:last_k_nodes]


I need to retrieve from Qdrant the last K documents that are inside a certain date interval as nodes (including their full text)
yea for vector db intgrations, the docstore is disabled to simplify storage (all the nodes are in the vector db)

You can manually override this, but then you need to make sure you persist/load the docstore somewhere (either locally, or using a remote one like redis or mongodb)

Plain Text
index = VectorStoreIndex(..., store_nodes_override=True)
Isnt there any way to query the DocStore for entire nodes (including their text) if I know what they look like?
Like for example telling the docstore to send over nodes that check a certain condition
Like similarity search but the entire text of the document instead
I need something like that
Add a reply
Sign up and join the conversation on Discord