---
title: registry | CodeWeaver Docs
description: API reference for codeweaver.providers.embedding.registry
url: "https://docs.knitli.com/api/providers/embedding/registry"
type: static
generatedAt: "2026-04-17T17:21:09.174Z"
---

# registry
       [Open in ChatGPT](https://chatgpt.com/?q=Read%20https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fproviders%2Fembedding%2Fregistry%2F.%20I%20want%20to%20ask%20questions%20about%20it.)[Open in Claude](https://claude.ai/new?q=Read%20https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fproviders%2Fembedding%2Fregistry%2F.%20I%20want%20to%20ask%20questions%20about%20it.)[View in Markdown](/codeweaver/api/providers/embedding/registry.md)       [Share on LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fproviders%2Fembedding%2Fregistry%2F)[Share on X](https://x.com/intent/tweet?url=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fproviders%2Fembedding%2Fregistry%2F&text=registry)[Share on Threads](https://threads.net/intent/post?url=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fproviders%2Fembedding%2Fregistry%2F&text=registry)[Share on Bluesky](https://bsky.app/intent/compose?text=registry%20https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fproviders%2Fembedding%2Fregistry%2F)[Share on Facebook](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fproviders%2Fembedding%2Fregistry%2F)[Share on Reddit](https://reddit.com/submit?url=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fproviders%2Fembedding%2Fregistry%2F&title=registry)[Share on Hacker News](https://news.ycombinator.com/submitlink?u=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fproviders%2Fembedding%2Fregistry%2F&t=registry)[Share on Email](mailto:?subject=registry&body=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fproviders%2Fembedding%2Fregistry%2F)[Share on WhatsApp](https://wa.me/?text=registry%20https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fproviders%2Fembedding%2Fregistry%2F)[Share on Telegram](https://t.me/share/url?url=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fproviders%2Fembedding%2Fregistry%2F&text=registry)
# `codeweaver.providers.embedding.registry`
[Section titled “codeweaver.providers.embedding.registry”](#codeweaverprovidersembeddingregistry)
A UUIDStore registry for embedding providers.

This registry maps embedding batch IDs and indexes to their corresponding embedding vectors. It only stores the last `max_size` bytes, and moves old batches to a weakref store when the limit is exceeded (all UUIDStore instances work like this).

## Class: `EmbeddingRegistry`
[Section titled “Class: EmbeddingRegistry”](#class-embeddingregistry)
A UUIDStore registry for generated embeddings. It maps CodeChunk IDs to their corresponding embeddings (as `ChunkEmbeddings`).

UUID Stores are a key value store that enforces its value types. They have a weakref ‘trash_heap’ that stores old values when its main store is full, freeing up memory while still allowing access to old values in most cases. In practice, it provides guaranteed storage for the most recent items, and best-effort storage for older items.

Since vectors are large, the `size_limit` defaults to 100 MB.

### Method: `get_item_ages`
[Section titled “Method: get_item_ages”](#method-get_item_ages)

**

```
get_item_ages()
```

Get the ages of all items in the store, where age is defined as the number of insertions since the item was added.

### Method: `oldest_item`
[Section titled “Method: oldest_item”](#method-oldest_item)

**

```
oldest_item()
```

Get the oldest item in the store based on insertion time.

### Method: `validate_models`
[Section titled “Method: validate_models”](#method-validate_models)

**

```
validate_models()
```

Validate that all embeddings use the same model and return the set of models used.

## Function: `get_embedding_registry`
[Section titled “Function: get_embedding_registry”](#function-get_embedding_registry)

**

```
get_embedding_registry()
```

Get the global EmbeddingRegistry instance, creating it if it doesn’t exist.

Note: The backup parameter is now deprecated and ignored. With the new multi-vector approach, backup embeddings are stored as additional vectors on the same points. This function always returns the main registry.

## Function: `reset_embedding_registry`
[Section titled “Function: reset_embedding_registry”](#function-reset_embedding_registry)

**

```
reset_embedding_registry()
```

Reset the global EmbeddingRegistry instance.

Primarily used for testing to ensure isolation between tests.