Skip to content

Metadata Tagger

Metadata Tagger asks a model to read each document or piece and fill in the data you describe: the machine it is about, the topic, the codes it mentions, the product, the date… That data is stored next to the text in the vector database and lets a search look only among the pieces that meet a condition, for example “only the ones about the Q90 model”.

Without tags, a question like “what does error E07 mean on the Q90?” can bring back E07 from another machine, because the text is similar. With a machine tag on every piece, the search is limited to the Q90 ones.

When to use it

  • Your documents cover several machines, products, brands or customers, and questions usually name one.
  • The data you want to filter by is not in the file details but inside the text.
  • You want to filter with SelfQueryRetriever, which turns the question into a search with filters.
  • You want an agent or a flow to filter the vector database by that data, for example with Filter by Metadata in Qdrant or another vector database.

Configuration

FieldWhat it does
Data (required)The documents or pieces to tag, usually the Chunks output of a text splitter such as Contextual Text Splitter.
Language Model (required)The model that reads each text and fills in the data. A fast, inexpensive model is enough.
Metadata SchemaThe data to tag. You edit it with the Edit Argument Schema button, the same editor SelfQueryRetriever uses. Each item has a name, a type and a description of what it means.

Data types

TypeFor
stringA text: the machine, the topic, the customer.
integerA whole number: a year, a quantity.
numberA number with decimals: a price, a weight.
booleanYes or no: whether the piece is about a fault.
arrayA list of values: every code a piece mentions.

Any other type in the editor is stored as text. If the text says nothing about an item, the piece is left without it.

Advanced options

FieldWhat it does
InstructionsExtra guidance for the model, for example how to write product names (“write the model without the brand: Q90, not Cafés del Sur Q90”).
Overwrite Existing ValuesOn (default), the model’s value replaces one the document already had under the same name: a file read from storage, for example, already carries type = file, and a schema field called type gets the model’s value instead. Off, it keeps the document’s own value and only fills in what is missing.
Parallel RequestsHow many texts are tagged at the same time, from 1 to 20. Default: 5. More is faster, if your model provider allows it.

Output

  • Tagged Data: the same documents or pieces, with the new data. In the output table you see the text first, then the tags and finally the data the document already had (for example, the context and the original piece if they come from Contextual Text Splitter). Connect it to Ingest Data of a vector database.

If the model does not answer with the requested data on the second attempt either, the run stops with an error instead of storing untagged pieces.

Example

A coffee machine repair service prepares its machine manuals for its assistant.

  1. Read the PDF manual with Storage Files and split it with Contextual Text Splitter.

  2. Connect Chunks to Data of Metadata Tagger and a model to Language Model.

  3. In Metadata Schema describe three items:

    NameTypeDescription
    machinestringMachine model the text is about: Q90, Q60 or M64.
    topicstringWhat it is about: fault, maintenance, installation or cleaning.
    codesarrayEvery error code in the text, such as E07.
  4. Connect Tagged Data to Ingest Data of Qdrant with Operation set to Add and run the flow.

Each piece is stored with its machine, topic and codes. In the assistant’s flow, use the same schema in SelfQueryRetriever so the question “error E07 on the Q90” only searches that machine’s pieces.

The video on Self Query Retriever shows a schema like this one in an ingestion flow, and how it is then used to filter by brand and month.

Good practices

  • List the possible values in the description. “Machine model: Q90, Q60 or M64” gives the same tags on every piece; “the machine” gives variants like “Q-90” or “Q90 coffee machine” that then don’t match in the filter.
  • If an item can have several values, declare it array. In our test on 17 October 2026, an error-code field declared as text left a piece listing three codes with only one, and searches filtered by the other two did not find it. That test set (9 documents, 40 questions) is synthetic: it shows how the technique behaves, not a promise.
  • Items that have a single value by nature filter best: document type, brand, model, month.
  • Use the same schema here and in SelfQueryRetriever: what is tagged when storing is what can be filtered when searching.
  • It has a cost: there is one model call per piece. In the test, 80 pieces were tagged in about 15 seconds, 5 at a time. It happens once, when the documents are stored.

To see the full preparation flow, see Preparing documents in the RAG guide.