()
| 324 | # ── Chunk loading ───────────────────────────────────────────────────────────── |
| 325 | |
| 326 | def _load_all_chunks() -> list: |
| 327 | chunk_dir = KB_ROOT / "embeddings" |
| 328 | if not chunk_dir.exists(): |
| 329 | return [] |
| 330 | all_chunks = [] |
| 331 | for cf in sorted(chunk_dir.glob("*.chunks.json")): |
| 332 | try: |
| 333 | with open(cf, encoding="utf-8") as f: |
| 334 | all_chunks.extend(json.load(f)) |
| 335 | except Exception: |
| 336 | pass |
| 337 | return all_chunks |
| 338 | |
| 339 | |
| 340 | # ── Vector index: build + load ──────────────────────────────────────────────── |
no test coverage detected