---
title: "Resilience: The Safety Net | CodeWeaver Docs"
description: CodeWeaver is a code search engine for AI agents, designed to provide precise results that give agents exactly what they need for their tasks -- no more, no less.
url: "https://docs.knitli.com/guides/resilience"
type: static
generatedAt: "2026-04-17T17:21:09.989Z"
---

# Resilience: The Safety Net
       [Open in ChatGPT](https://chatgpt.com/?q=Read%20https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fguides%2Fresilience%2F.%20I%20want%20to%20ask%20questions%20about%20it.)[Open in Claude](https://claude.ai/new?q=Read%20https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fguides%2Fresilience%2F.%20I%20want%20to%20ask%20questions%20about%20it.)[View in Markdown](/codeweaver/guides/resilience.md)       [Share on LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fguides%2Fresilience%2F)[Share on X](https://x.com/intent/tweet?url=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fguides%2Fresilience%2F&text=Resilience%3A%20The%20Safety%20Net)[Share on Threads](https://threads.net/intent/post?url=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fguides%2Fresilience%2F&text=Resilience%3A%20The%20Safety%20Net)[Share on Bluesky](https://bsky.app/intent/compose?text=Resilience%3A%20The%20Safety%20Net%20https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fguides%2Fresilience%2F)[Share on Facebook](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fguides%2Fresilience%2F)[Share on Reddit](https://reddit.com/submit?url=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fguides%2Fresilience%2F&title=Resilience%3A%20The%20Safety%20Net)[Share on Hacker News](https://news.ycombinator.com/submitlink?u=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fguides%2Fresilience%2F&t=Resilience%3A%20The%20Safety%20Net)[Share on Email](mailto:?subject=Resilience%3A%20The%20Safety%20Net&body=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fguides%2Fresilience%2F)[Share on WhatsApp](https://wa.me/?text=Resilience%3A%20The%20Safety%20Net%20https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fguides%2Fresilience%2F)[Share on Telegram](https://t.me/share/url?url=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fguides%2Fresilience%2F&text=Resilience%3A%20The%20Safety%20Net)
# Resilience: The Safety Net
[Section titled “Resilience: The Safety Net”](#resilience-the-safety-net)
> **TL;DR:** This module handles Resilient Intelligence. Use it to ensure your agents never lose context, even when cloud APIs fail. It saves your workflow by automatically switching to local providers (FastEmbed/Sentence-Transformers) during outages.

CodeWeaver includes an industrial-grade “Safety Net” that protects your AI agents from cloud provider failures. Whether it’s an API timeout, a rate limit, or a total service outage, CodeWeaver keeps your context pipeline flowing.

---

## How It Works: The Multi-Vector Approach
[Section titled “How It Works: The Multi-Vector Approach”](#how-it-works-the-multi-vector-approach)
Unlike traditional search tools that rely on a single model, CodeWeaver uses a **Multi-Vector** architecture. When you index your code, the system generates both your primary cloud embeddings and a set of lightweight “backup” embeddings stored on the same data points.

### 1. Automatic Cloud Fallback
[Section titled “1. Automatic Cloud Fallback”](#1-automatic-cloud-fallback)
If your primary embedding provider (e.g., Voyage AI) becomes unreachable, CodeWeaver detects the failure in milliseconds. It immediately reroutes all search queries to your local backup provider (FastEmbed or Sentence-Transformers). Your agent receives relevant context without ever seeing an “API Error.”

### 2. Resilient Vector Storage
[Section titled “2. Resilient Vector Storage”](#2-resilient-vector-storage)
If you use a cloud vector store and it fails, CodeWeaver switches to a local backup. The system maintains this backup using:

 - **Regular Snapshots:** Point-in-time copies of your index.
 - **Write-Ahead Logging (WAL):** A record of every change made since the last snapshot.

### 3. Interchangeable Reranking
[Section titled “3. Interchangeable Reranking”](#3-interchangeable-reranking)
Reranking models are interchangeable by design. If your high-precision cloud reranker fails, CodeWeaver falls back to a local reranking model to ensure your search results are still prioritized by relevance.

---

## Configuration
[Section titled “Configuration”](#configuration)
The Safety Net is **enabled by default** for all cloud-based profiles. You don’t need to do anything to turn it on.

### Disabling the Safety Net
[Section titled “Disabling the Safety Net”](#disabling-the-safety-net)
If you are running in a strictly resource-constrained environment or a 100% airgapped local setup, you can disable the backup system in your `codeweaver.toml`:


**

```
[provider]disable_backup_system = true
```

> **Warning:** Disabling the backup system means CodeWeaver will stop working if your primary cloud providers are unreachable. We do not recommend this for production environments.

---

## Supported Local Providers
[Section titled “Supported Local Providers”](#supported-local-providers)
CodeWeaver integrates with industry-standard local embedding libraries to provide its Safety Net:

| Provider | Library | Best For |
| --- | --- | --- |
| **FastEmbed** | `fastembed` | High-performance CPU-based fallback. |
| **Sentence-Transformers** | `sentence-transformers` | GPU-accelerated local search. |
| **BM25** | Built-in | Traditional keyword fallback when all else fails. |

---

## Why Resilience Matters
[Section titled “Why Resilience Matters”](#why-resilience-matters)
For AI agents, **Context is Oxygen**. If an agent loses access to its context tool (CodeWeaver), it can become confused, hallucinate, or fail to complete its task. By providing a transparent Safety Net, CodeWeaver ensures your agents remain productive regardless of cloud status.