Working with metadata to improve the context
What is metadata? It’s simply additional information we can attach to our documents and nodes. This extra context helps LlamaIndex better understand our data. It provides additional context about data and can be customized in terms of visibility and format.
For example, let’s say you’ve ingested some PDF reports as documents. You could then simply add some metadata like this:
document.metadata = { "report_name": "Sales Report April 2022", "department": "Sales", "author": "Jane Doe" }
This metadata gives vital clues when querying the data later. In this example, we can use it to locate reports by department or author. You can store anything useful as metadata – categories, timestamps, locations, and more.
And here’s a neat trick – any metadata you set on a...