Blame
|
1 | --- |
||||||
| 2 | category: reference |
|||||||
|
3 | tags: [tasks, semantic-search, faiss, multi-tenant] |
||||||
| 4 | last_updated: 2026-03-20 |
|||||||
|
5 | confidence: high |
||||||
| 6 | --- |
|||||||
| 7 | ||||||||
|
8 | # Semantic Search Multi-Tenant — IMPLEMENTED |
||||||
|
9 | |||||||
|
10 | ## Solution (2026-03-20) |
||||||
|
11 | |||||||
|
12 | All multi-tenant issues resolved. FAISS backend with `BackendRegistry` provides per-wiki isolation. |
||||||
|
13 | |||||||
|
14 | ### Implementation |
||||||
| 15 | - **BackendRegistry** manages per-wiki FAISS backends with lazy initialization |
|||||||
| 16 | - **Per-wiki FAISS indexes** at `/srv/data/faiss/{slug}/` — natural isolation, no slug-prefix hacking |
|||||||
| 17 | - **Lifecycle hooks** (`page_saved`/`page_deleted`/`page_renamed`) via `HookListener` replace the single-tenant sync thread |
|||||||
| 18 | - **`reindex_all` is per-wiki scoped** — reindexing one wiki does not affect others |
|||||||
| 19 | - **Auto-index on first access** — existing pages are back-filled when a wiki is first accessed |
|||||||
| 20 | - **ONNX MiniLM-L6-v2 embeddings** (ChromaDB bundled) — no model download issues |
|||||||
| 21 | - ChromaDB deprecated and disabled |
|||||||
|
22 | |||||||
|
23 | ### Original problems (all resolved) |
||||||
|
24 | |||||||
|
25 | 1. **One shared ChromaDB collection** — Replaced by per-wiki FAISS directories. |
||||||
| 26 | 2. **One sync thread** tied to default wiki — Replaced by per-request lifecycle hooks. |
|||||||
| 27 | 3. **`reindex_all` wipes everything** — Now per-wiki scoped. |
|||||||
| 28 | 4. **No auto-index for new wikis** — Auto-reindex on first wiki access. |
|||||||
| 29 | 5. **Embedding model download** — ONNX model bundled, no download needed. |
|||||||
|
30 | |||||||
| 31 | ## Related |
|||||||
|
32 | - [[Tasks/Semantic_Search_Architecture]] — overall architecture |
||||||
|
33 | - [[Dev/Proxmox_CPU_Type]] — numpy X86_V2 issue (workaround in place) |
||||||
| 34 | - [[Design/Async_Embedding_Pipeline]] — original FAISS + MiniLM design (AWS, archived) |
|||||||
