mirror of
https://github.com/AJaySi/ALwrity.git
synced 2026-04-26 09:25:55 +03:00
[PR #403] [MERGED] Fix txtai IndexIDMap 'nprobe' fallback loop by skipping incompatible FAISS index load #707
Labels
No labels
AI Content Agents
AI Content Strategy
AI Content planning
AI Marketing Tools
AI SEO
AI personalization
AI writer
ALwrity Copi-lot
Alwrity web search
Anthropic
DeepSeek
Gemini AI
Integration
LLM
OnBoarding
OnBoarding
RAG knowledgebase Memory
bug
documentation
enhancement
good first issue
help wanted
invalid
openai
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ALwrity#707
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/AJaySi/ALwrity/pull/403
Author: @AJaySi
Created: 3/9/2026
Status: ✅ Merged
Merged: 3/9/2026
Merged by: @AJaySi
Base:
main← Head:codex/fix-nprobe-attribute-error-in-search📝 Commits (2)
cd8582eFix txtai nprobe fallback to avoid reloading incompatible faiss index952824aStabilize txtai nprobe handling without dropping loaded index state📊 Changes
1 file changed (+70 additions, -47 deletions)
View changed files
📝
backend/services/intelligence/txtai_service.py(+70 -47)📄 Description
Motivation
'IndexIDMap' object has no attribute 'nprobe'errors when the service attempted to fallback from FAISS to numpy but then reloaded a persisted FAISS ANN index, causing the same failure to recur.TxtaiIntelligenceServicemore resilient by ensuring backend switches do not reintroduce incompatible persisted ANN state and by providing safe retry/fallback code paths for search, similarity, and clustering.Description
_initialize_embeddingsto acceptload_existing_index: booland added logic to skip loading a persisted index when instructed (prevents reloading incompatible FAISS state)._is_nprobe_incompatibilityto centralize detection of the FAISSIndexIDMap/nprobeerror pattern and_switch_to_numpy_backendto encapsulate backend switching and reinitialization behavior.searchto retry against a numpy backend withload_existing_index=Falseand, if a retry still raises the same error, force a non-ANN retrieval path by callingsearch(..., index=False).get_similarityto switch to numpy on the incompatibility and, ifsimilarity()keeps failing, fall back to a cosine similarity computed from vectors obtained viatransform.clusterto use the centralized incompatibility detection and backend switch so clustering falls back cleanly to the non-graph routine when ANN/graph is unavailable.Testing
python -m py_compile backend/services/intelligence/txtai_service.py, and compilation succeeded.Codex Task
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.