Skip to content

~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.

refactor: convert RAGIndex.status to SQLAlchemy Enum

LearningCircuitbd20594148a6
diff --git a/src/local_deep_research/database/models/library.py b/src/local_deep_research/database/models/library.py
index acc80cbe85..c2e6409628 100644
--- a/src/local_deep_research/database/models/library.py
+++ b/src/local_deep_research/database/models/library.py
@@ -3,11 +3,14 @@ Library and document download models.
Tracks downloaded PDFs and other documents from research sources.
"""
+import enum
+
from sqlalchemy import (
JSON,
Boolean,
Column,
Date,
+ Enum,
ForeignKey,
Index,
Integer,
@@ -21,6 +24,14 @@ from sqlalchemy_utc import UtcDateTime, utcnow
from .base import Base
+class RAGIndexStatus(enum.Enum):
+ """Status values for RAG indices."""
+
+ ACTIVE = "active"
+ REBUILDING = "rebuilding"
+ DEPRECATED = "deprecated"
+
+
class LibraryDocument(Base):
"""
Documents downloaded and stored in the user's library.
@@ -489,8 +500,10 @@ class RAGIndex(Base):
# Status
status = Column(
- String(50), nullable=False, default="active"
- ) # active, rebuilding, deprecated
+ Enum(RAGIndexStatus),
+ nullable=False,
+ default=RAGIndexStatus.ACTIVE,
+ )
is_current = Column(
Boolean, default=True
) # Whether this is the current index for this collection