> For the complete documentation index, see [llms.txt](https://docs.degirum.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.degirum.com/face-recognition/guides/overview-3.md).

# Database

LanceDB-based storage for face embeddings and attributes.

## What is ReID Database?

`ReID_Database` is the underlying storage layer for face embeddings and person attributes in `degirum-face`. It uses LanceDB to store:

* Face embedding vectors for similarity search
* Person attributes (names, metadata)
* Associated face images
* Model metadata for validation

The database is automatically managed by `FaceRecognizer` and `FaceTracker` - you typically don't instantiate it directly.

## When to Use

**Automatic usage** - The database is created and managed when you initialize `FaceRecognizer` or `FaceTracker`:

```python
# Database created automatically at db_path
recognizer = degirum_face.FaceRecognizer(
    config=degirum_face.FaceRecognizerConfig(
        db_path="./my_faces.lance",  # Database location
        # ...
    )
)
```

**Direct usage** - Only needed for:

* Custom database operations
* Database migration/backup tools
* Advanced batch processing
* Direct embedding management

## How It Works

The database uses LanceDB with four internal tables:

| Table        | Purpose                                      |
| ------------ | -------------------------------------------- |
| `embeddings` | Face embedding vectors with image references |
| `attributes` | Person metadata (names, IDs)                 |
| `images`     | Face image storage (PNG format)              |
| `_metadata`  | Model validation metadata                    |

**Key features:**

* **Vector search** - Fast similarity search using cosine distance
* **Deduplication** - Automatic embedding deduplication via hashing
* **Thread-safe** - Safe for concurrent access
* **Model validation** - Ensures embeddings from same model
* **Connection pooling** - Single connection per database path

See [Configuration Guide](/face-recognition/guides/overview-3/configuration.md) for database initialization options.

See [Methods Reference](/face-recognition/guides/overview-3/methods.md) for complete API.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.degirum.com/face-recognition/guides/overview-3.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
