ArticleIntermediate6 minUpdated 2026-10-09

Metadata, tags and PageRank

Document metadata and filtering by it in assistants and the API, tag sets for automatic labeling of chunks, the PageRank of a base, and how all of this is set in the interface and through the API.

Metadata, tag sets and PageRank are three ways to add to chunks information that is not in the text itself, and in this way to control the selection of sources. This article describes what each of them does and where it is configured.

Document metadata

Metadata is stored with a document as a JSON object with arbitrary keys: author, date, department, version, address of the source page. It is not indexed and does not take part in search by words or vectors. Its role is different: if chunks of the document get into the context of an answer, the metadata is appended to the prompt before the chunks, and the model can refer to it, for example name the source and the date.

You can set metadata in two ways:

  • in the document list of the base with the "Set Meta Data" action: a field for JSON opens, and the value must be a valid object, otherwise the change is not applied;
  • through the API: PUT /api/v1/datasets/{dataset_id}/documents/{document_id} with the meta_fields field, whose value is an object.
json
{ "meta_fields": { "Author": "HR department", "Date": "2026-02-01", "Version": "3" } }

There is no bulk setting in the interface, and each document is edited separately; for hundreds of documents, use a loop over the API. A metadata change is written to the audit log as a "Metadata updated" event.

Filtering by metadata

An assistant that has bases connected has a metadata setting with three modes:

ModeBehavior
DisabledMetadata does not affect the selection of documents
AutomaticThe model reads the question and the metadata values available in the bases and forms the selection conditions itself
ManualThe administrator sets the conditions: key, operator, value. Search goes only over the documents that satisfy them

Manual mode suits cases where the rule is known in advance, for example the assistant of a department must see only documents with "Department: Accounting". Automatic mode is convenient if questions contain selection features ("by version 3", "for the year 2025"), but it requires uniform keys and values in all documents. In the assistant API the same parameter is called meta_data_filter with the fields method (disabled, automatic, manual) and the list of conditions manual made of objects with key, op and value.

Tip

Agree on a dictionary of keys before uploading documents: one key "Date" in the format YYYY-MM-DD, one key "Department" with a fixed list of values. A mess of keys makes filtering useless.

Tag sets

A tag set is a separate knowledge base with the "Tag" chunking method. It contains a table of two columns: a description and a tag. The description is an example of a chunk or a typical question, and the tag is a label from a closed list; several tags in one row are separated by a comma. Formats: XLSX without a header row, or CSV or TXT in UTF-8 with the TAB delimiter.

Procedure:

  1. Create a base, choose the "Tag" method in its settings, then upload and process the table file. On the configuration page the "Cloud" and "Table" tabs with the frequency of tags appear; here you can rename or delete tags.
  2. In the target base, open "Advanced settings", choose one or several tag-set bases in the "Tag sets" field, change "Top-N Tags" if needed and save.
  3. Process the documents of the target base again. Each chunk is compared with the descriptions from the set and gets the nearest tags.

When a question comes in, the assistant tags the question itself too, and chunks with matching tags get an advantage. This helps when chunks are similar to each other (for example, most are about accessories and a few about the device itself) and ordinary search does not tell them apart.

Differences from auto-keywords: tags are a closed set defined by you, and they are assigned by vector similarity without calling a chat model; keywords are generated by a model, the set is open, and it is costlier. A tag set is not connected to an assistant: it does not take part in search directly. After a set changes, the documents of the target bases must be processed again.

PageRank of a base

PageRank is set for the whole base in "Advanced settings" as an integer from 0 to 100 and is added to the score of all its chunks. It is needed when an assistant searches several bases with one embedding model and one of them must have priority: current regulations above the archive, your own documentation above public materials. Zero means "off". Through the API the value is passed in the pagerank field of PUT /api/v1/datasets/{dataset_id}.

Note

PageRank works only with the Elasticsearch search engine. In installations on Infinity the parameter is not applied, and priority between bases is set through conditions in the prompt of the assistant or by splitting the assistants.

What to choose

TaskTool
The model must name the author, the date or the link to the sourceMetadata
Limit search to part of the documents by a formal featureMetadata filter
Tell similar chunks apart by topicTag set
Raise one base above anotherPageRank
Improve hits on synonymsAuto-keywords and auto-questions, see Chunking methods

The result of any change is checked on the "Retrieval testing" tab, see Checking search on a knowledge base.

Ask Sema

Was this helpful?