---
title: reconciliation_service | CodeWeaver Docs
description: API reference for codeweaver.engine.services.reconciliation_service
url: "https://docs.knitli.com/api/engine/services/reconciliation_service"
type: static
generatedAt: "2026-04-17T17:21:08.592Z"
---

# reconciliation_service
       [Open in ChatGPT](https://chatgpt.com/?q=Read%20https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fengine%2Fservices%2Freconciliation_service%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%2Fengine%2Fservices%2Freconciliation_service%2F.%20I%20want%20to%20ask%20questions%20about%20it.)[View in Markdown](/codeweaver/api/engine/services/reconciliation_service.md)       [Share on LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fengine%2Fservices%2Freconciliation_service%2F)[Share on X](https://x.com/intent/tweet?url=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fengine%2Fservices%2Freconciliation_service%2F&text=reconciliation_service)[Share on Threads](https://threads.net/intent/post?url=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fengine%2Fservices%2Freconciliation_service%2F&text=reconciliation_service)[Share on Bluesky](https://bsky.app/intent/compose?text=reconciliation_service%20https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fengine%2Fservices%2Freconciliation_service%2F)[Share on Facebook](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fengine%2Fservices%2Freconciliation_service%2F)[Share on Reddit](https://reddit.com/submit?url=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fengine%2Fservices%2Freconciliation_service%2F&title=reconciliation_service)[Share on Hacker News](https://news.ycombinator.com/submitlink?u=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fengine%2Fservices%2Freconciliation_service%2F&t=reconciliation_service)[Share on Email](mailto:?subject=reconciliation_service&body=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fengine%2Fservices%2Freconciliation_service%2F)[Share on WhatsApp](https://wa.me/?text=reconciliation_service%20https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fengine%2Fservices%2Freconciliation_service%2F)[Share on Telegram](https://t.me/share/url?url=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fengine%2Fservices%2Freconciliation_service%2F&text=reconciliation_service)
# `codeweaver.engine.services.reconciliation_service`
[Section titled “codeweaver.engine.services.reconciliation_service”](#codeweaverengineservicesreconciliation_service)
Vector reconciliation service for backup vector validation and repair.

This service ensures that all points in the vector store have the required backup vectors. It operates in a lazy repair mode, only fixing points that are missing backup vectors rather than proactively checking everything.

The service integrates with the failover maintenance loop and runs periodically to ensure backup vector coverage for disaster recovery scenarios.

## Class: `ReconciliationResult`
[Section titled “Class: ReconciliationResult”](#class-reconciliationresult)
Results from reconciliation operations.

## Class: `RepairStats`
[Section titled “Class: RepairStats”](#class-repairstats)
Statistics for repair operations.

## Class: `VectorReconciliationService`
[Section titled “Class: VectorReconciliationService”](#class-vectorreconciliationservice)
Service for reconciling backup vectors in the vector store.

This service ensures that all points have the required backup vectors for failover scenarios. It operates in two modes:

 1. Detection: Identify points missing backup vectors
 1. Repair: Generate and add missing backup vectors

The service uses batch processing for efficiency and integrates with the failover maintenance loop for periodic execution.

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

**

```
cleanup()
```

Cleanup service resources.

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

**

```
detect_missing_vectors()
```

Detect points missing backup vectors.

This method scrolls through the collection and identifies points that don’t have the backup vector field populated.

Args: collection_name: Name of collection to check limit: Maximum number of missing points to detect (None = all)

Returns: List of point IDs missing backup vectors

Example: >>> service = VectorReconciliationService(vector_store) >>> missing = await service.detect_missing_vectors(“my_collection”) >>> print(f”Found {len(missing)} points missing backup vectors”)

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

**

```
reconcile()
```

Perform full reconciliation: detect and optionally repair missing vectors.

This is the main entry point for the reconciliation service. It detects points missing backup vectors and optionally repairs them.

Args: collection_name: Collection to reconcile auto_repair: Whether to automatically repair detected issues detection_limit: Maximum points to detect (None = all)

Returns: Dictionary with reconciliation results:

 - detected: Number of points missing backup vectors
 - repaired: Number of successfully repaired points
 - failed: Number of points that failed to repair
 - errors: List of error messages

Example: >>> service = VectorReconciliationService(vector_store) >>> result = await service.reconcile(“my_collection”, auto_repair=True) >>> print(f”Detected: {result[‘detected’]}, Repaired: {result[‘repaired’]}“)

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

**

```
repair_missing_vectors()
```

Repair points by generating and adding missing backup vectors.

This method retrieves the points, generates backup embeddings from their content, and updates the vector store with the new backup vectors.

Args: collection_name: Name of collection containing points point_ids: List of point IDs to repair

Returns: Dictionary with repair statistics:

 - repaired: Number of successfully repaired points
 - failed: Number of points that failed to repair
 - errors: List of error messages encountered

Example: >>> missing = await service.detect_missing_vectors(“collection”) >>> stats = await service.repair_missing_vectors(“collection”, missing) >>> print(f”Repaired: {stats[‘repaired’]}, Failed: {stats[‘failed’]}”)