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.

feat: always store text content in database

LearningCircuitc92f6c9169c8
diff --git a/src/local_deep_research/database/models/library.py b/src/local_deep_research/database/models/library.py
index 3f19e5341c..ada0e3807d 100644
--- a/src/local_deep_research/database/models/library.py
+++ b/src/local_deep_research/database/models/library.py
@@ -147,8 +147,8 @@ class LibraryTextDocument(Base):
# File information
file_path = Column(
- Text, nullable=False
- ) # Path relative to library root (txt/ folder)
+ Text, nullable=True
+ ) # Path relative to library root (txt/ folder) - can be None if storage disabled
file_size = Column(Integer, nullable=False) # Size in bytes
character_count = Column(Integer, nullable=True) # Number of characters
word_count = Column(Integer, nullable=True) # Number of words
@@ -187,6 +187,11 @@ class LibraryTextDocument(Base):
has_formatting_issues = Column(Boolean, default=False)
has_encoding_issues = Column(Boolean, default=False)
+ # Text content storage
+ text_content = Column(
+ Text, nullable=True
+ ) # Always store text content for quick access
+
# Timestamps
created_at = Column(UtcDateTime, default=utcnow(), nullable=False)
updated_at = Column(
diff --git a/src/local_deep_research/research_library/services/download_service.py b/src/local_deep_research/research_library/services/download_service.py
index 4de663e346..3979650685 100644
--- a/src/local_deep_research/research_library/services/download_service.py
+++ b/src/local_deep_research/research_library/services/download_service.py
@@ -1287,7 +1287,7 @@ class DownloadService:
text_doc.extraction_error = None
text_doc.extracted_at = datetime.now(UTC)
text_doc.document_id = pdf_document_id
- # Store text content in database
+ # Always store text content in database
text_doc.text_content = text
# Set quality based on method
@@ -1319,6 +1319,7 @@ class DownloadService:
extraction_quality="high"
if extraction_method == "native_api"
else "medium",
+ text_content=text, # Always store text content in database
)
session.add(text_doc)