SimpleDirectoryReader()
, some metadata will be assigned automatically (including filename)def get_metadata(filename): return {"filename": filename} document = SimpleDirectoryReader(..., file_metadata=get_metadata).load_data()
response = query_engine.query("..") print(response.source_nodes[0].node.metadata)