localvectordb.exceptions module
- exception localvectordb.exceptions.BaseLocalVectorDBException
Bases:
ExceptionBase class for all LocalVectorDB exceptions.
- exception localvectordb.exceptions.DatabaseError
Bases:
BaseLocalVectorDBExceptionRaised for general database operation failures.
- exception localvectordb.exceptions.DatabaseNotFoundError
Bases:
DatabaseError,KeyErrorRaised if the Database cannot be found
- exception localvectordb.exceptions.MetadataFilterError
Bases:
DatabaseError,ValueErrorRaised when there’s an error in metadata filter specification or processing
- exception localvectordb.exceptions.DuplicateDocumentIDError
Bases:
DatabaseError,ValueErrorRaised when inserting document(s) and the id(s) already exist
- exception localvectordb.exceptions.IngestError(message: str, failures: Dict[str, str] | None = None, succeeded: List[str] | None = None)
Bases:
DatabaseErrorRaised by
upsert/insert(and their async twins) when one or more documents fail to embed or write anderrors="raise"(the default).Each document is committed in its own transaction, so the documents that succeeded are durably persisted – their IDs are in
succeeded. The documents that failed are infailures(doc_id -> error message). Passerrors="ignore"to suppress this and get best-effort ingestion that returns only the IDs that landed.
- exception localvectordb.exceptions.IndexIntegrityError
Bases:
DatabaseErrorRaised when the SQLite rows and the FAISS index disagree in a way that corrupts query results – notably duplicate
faiss_idvalues, which cause one vector to be attributed to two different documents.Recover with
lvdb db <name> repair.
- exception localvectordb.exceptions.UnsupportedIndexOperationError
Bases:
DatabaseErrorRaised when an operation is not supported by the configured FAISS index type.
Most commonly:
IndexHNSWFlatcannot remove vectors, so documents cannot be deleted or replaced in a database backed by it.
- exception localvectordb.exceptions.DocumentNotFoundError(message: str, missing_ids: str | List[str] | None = None)
Bases:
DatabaseError,KeyErrorRaised when one or more requested documents cannot be found
- exception localvectordb.exceptions.PatchConflictError(message: str, expected: str | None = None, actual: str | None = None)
Bases:
DatabaseErrorRaised when a document patch’s
expect_hashprecondition does not match the storedcontent_hash– i.e. the document changed since the caller read it.This is a distinct outcome from “document not found” and “no-op”: the document exists and the ops are valid, but applying them would clobber a concurrent write. Surfaces as HTTP 409 on the server.
- exception localvectordb.exceptions.PatchError
Bases:
DatabaseError,ValueErrorRaised when a document patch’s ops cannot be applied: an unmatched or ambiguous
find, an out-of-range or overlapping splice, or a malformed op.The whole patch fails atomically – no partial write. Surfaces as HTTP 422 on the server.
- exception localvectordb.exceptions.EmbeddingError
Bases:
BaseLocalVectorDBException,RuntimeErrorRaised when an embedding provider fails to generate embeddings.
- exception localvectordb.exceptions.ProviderHTTPError(message: str, status_code: int | None = None)
Bases:
EmbeddingErrorA provider HTTP failure that keeps its status code.
Providers used to report an API error as a bare
RuntimeErrorbuilt from the JSON error message, discarding the status. That made the error unclassifiable:EmbeddingProvider._should_retrymatches onhttpxtypes and a status code, so a 429 was never retried despitemax_retries=3and a docstring promising “automatic retry handling” – a bulk ingest died on a rate limit whose own message said “try again in 174ms”.Subclasses
EmbeddingError(and thereforeRuntimeError), so any caller already catching those is unaffected.
- exception localvectordb.exceptions.OllamaNotFoundError
Bases:
EmbeddingErrorRaised when Ollama is not installed or not running.
- exception localvectordb.exceptions.ConfigurationError
Bases:
BaseLocalVectorDBException,RuntimeErrorRaised when configuration is invalid or inconsistent.
- exception localvectordb.exceptions.ValidationError
Bases:
BaseLocalVectorDBException,ValueErrorRaised when there’s a validation error in input data
- exception localvectordb.exceptions.ConnectionPoolError
Bases:
BaseLocalVectorDBExceptionRaised when a database connection cannot be acquired from the pool.
- exception localvectordb.exceptions.RerankerError
Bases:
BaseLocalVectorDBException,RuntimeErrorRaised when there’s an error in reranking operations.
- exception localvectordb.exceptions.CursorError
Bases:
BaseLocalVectorDBExceptionBase class for cursor-related errors.
- exception localvectordb.exceptions.CursorExpiredError
Bases:
CursorErrorRaised when a cursor has expired or been closed.
- exception localvectordb.exceptions.CursorExhaustedError
Bases:
CursorErrorRaised when attempting to fetch from an exhausted cursor.