- Filter chat responses so only files that match the metadata filter are referenced in the response. Chat requests without metadata filters don’t consider metadata.
- View a filtered list of files that match specific criteria.
Supported metadata size and format
Pinecone Assistant supports 16 KB of metadata per file.- Metadata fields must be key-value pairs in a flat JSON object. Nested JSON objects aren’t supported.
- Keys must be strings and must not start with a
$. - Values must be one of the following data types:
- String
- Integer (converted to a 64-bit floating point by Pinecone)
- Floating point
- Boolean (
true,false) - List of strings
- Null metadata values aren’t supported. Instead of setting a key to
null, remove the key from the metadata payload.
Metadata query language
Pinecone’s filtering language supports the following operators:
At the top level, list one or more fields (combined with implicit AND) or combine clauses with the logical operators
$and and $or. Use $not to negate a clause, as shown in the table. A bare comparison operator (like $gt) can’t appear at the top level. Nest it under a field.
A metadata field can hold an array of strings, such as {"genre": ["comedy", "documentary"]}. A filter on that field matches when any value in the array satisfies it, so each of these filters matches:
JSON
"drama" value and because $ne and $nin exclude an item when any of its values matches:
JSON
$in. These filters are invalid and return a 400 error:
JSON