Find answers from the community

Updated 3 months ago

How to store metadata in llamaindex

How to store metadata in llamaindex?
Please advice me
L
o
4 comments
You can add metadata to the extra_info of input documents

Plain Text
document.extra_info = {'file_name': 'text.txt'}


https://gpt-index.readthedocs.io/en/latest/how_to/customization/custom_documents.html
Yes, I have stored like this, but output result from query was a bit different
Example
I have several documents
If I ask "what is these documents about?"
it didn't know
I have trained several pdf files using llama-Index.
And if I ask like this "What are these documents about?"
I get this response.
"I cannot provide a reliable response based on the available knowledge base as no specific documents have been mentioned. Please provide more information or upload the documents you are referring to, and I will be happy to assist you."

I want to get response about documents as I have already trained files.
Help me plz
If you are using a vector index, it's not going to know what all the documents are about because it's only retrieving the top 2 nodes by default

For a question like that, the LLM would have to read the entire index (either a ListIndex with response_mode="tree_summarize" or a TreeIndex will do that)
Add a reply
Sign up and join the conversation on Discord