Retrieve Metadata in a Document
Is there a way to view the metadata in a document(s) in the knowledgebase?
2 Replies
At the moment the Knowledge Base panel inside the Voiceflow Creator does not surface the custom metadata you attach to a file, URL or table.
If you need to look at (or debug) the metadata you have saved you’ll need to call the Knowledge Base Management API instead: 1. Get the documentID you want to inspect (e.g. with the GET /v1/knowledge-base/docs list endpoint). 2. Call The response JSON looks like: •
• Metadata filtering examples: https://developer.voiceflow.com/docs/advanced-knowledge-base#filter-with-metadata
If you need to look at (or debug) the metadata you have saved you’ll need to call the Knowledge Base Management API instead: 1. Get the documentID you want to inspect (e.g. with the GET /v1/knowledge-base/docs list endpoint). 2. Call The response JSON looks like: •
metadata
at the document level contains the key-value pairs you supplied when you uploaded the source.
• Each individual chunk
also carries its own metadata
object (useful if you later patch a single chunk).
If you only need the metadata keys for filtering at query time you can skip the step above and just apply metadata filters directly in the /knowledge-base/query call.
Docs for reference:
• Document Chunk Retrieval: https://developer.voiceflow.com/reference/get_v1-knowledge-base-docs-documentid• Metadata filtering examples: https://developer.voiceflow.com/docs/advanced-knowledge-base#filter-with-metadata
The metadata value only appears in each chunk rather than the whole document.
Example JSON output:
{
"data": {
"tags": [],
"documentID": "id",
"data": {
"type": "text",
"name": "test.txt",
"canEdit": false
},
"updatedAt": "time zone",
"status": {
"type": "PENDING"
}
},
"chunks": [
{
"chunkID": "chunk id",
"content": "...",
"metadata": {
"schoolName": "school"
}
},
{...}
}
]
}
metadata only appears in each chunk instead of in the "data" section. Why is that?