# Best of Biometrics

Best of Biometrics is an operation applied by GBDS when two or more profiles are unified or linked.

When applied, Best of Biometrics evaluates each fingerprint and palm template individually and selects the templates with the highest quality for each finger and/or palm position among all unified transactions. It then updates the person's profile to unify the "best" biometrics into a single active transaction that will be used for biometric comparison. This operation does not apply to face and iris templates, for which the most recent images will replace the older ones regardless of quality.

To enable Best of Biometrics, the configuration parameter `gbds.biometric.best-of-biometrics.enabled` must be set to `true` in both the GBDS configuration and the GBDS API configuration.

There are two cases in which Best of Biometrics is executed: when database profiles are not deduplicated and must be linked, and when an exception occurs and the UNIFY handling is applied.

## Linking Profiles

This option is an N-to-1 operation. The operator can link multiple profiles into a single resulting profile. This is done through direct API calls to the GBS ETR Server.

To link two profiles, the operator must first consolidate the transactions from Profile B into Profile A. This operation will compare the transactions in Profile B and the active transaction of Profile A to obtain the "best biometrics" according to the rules mentioned above. It will then generate a new transaction with the highest-quality biometrics that must be sent as an update `trusted` to Profile A.

Once Profiles A and B are successfully merged, Profile B can be disabled and will no longer be available for biometric comparison.

## Unifying Profiles

This option is a 1-to-1 operation. It can be executed when incoming profiles generate a registration or update exception with an existing profile in the ETR. If the chosen handling for those profiles is UNIFY, Best of Biometrics will be applied, if it is active.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.griaule.com/gbs/en/gbds-integration/bestofbiometrics.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
