Index uploaded files for search: PDF and Office text first, then OCR and audio transcripts
Problem
The chat assistant finds files with search_files, which only searches plain text files. A PDF or an Office file with an unhelpful name (for example a UUID) can not be found by its content. The text is in the file, but the search does not read it. Scanned documents, photos and audio have no searchable text at all.
Plan
Extract text when a file is uploaded (and when an agent writes one), store it in LocalAI's own store keyed by file and content hash, and make search_files and read_file use it. Extracted text is not a visible file in the user's folders. In cluster mode one runner does the extraction and every frontend searches the shared text.
Phase 1 (first version, in the studio chats work)
- Text layer of PDF files.
- Text of Word, Excel and PowerPoint files.
search_filesfinds hits inside these files and shows the file, a snippet and a page or sheet.read_filereturns the text of these files in pages.- A one-time background pass indexes the files that already exist.
Follow-ups tracked here
- [ ] OCR for scanned PDFs and photos with a small vision model on llama.cpp. It runs only when a file has no text layer, and the result is cached.
- [ ] Transcripts for audio (and video) files with a speech-to-text backend such as Parakeet. Transcripts keep timestamps, and a hit shows the time.
- [ ] A step in the first-start wizard that offers the default models (speech and OCR) with a one-click install. No automatic downloads.
- [ ] A state per file on the Files page: indexing, ready, failed, needs a model. A file that needs a model shows the same one-click install button, and waiting files are processed after the install.
- [ ] When the index is incomplete, the assistant says so and shows the install button, instead of answering "nothing found".
- [ ] Optional: add a file to a Collection (embeddings) at upload.
Acceptance for each follow-up
Tests (Ginkgo for Go, Playwright for the UI), documentation under docs/content/, and behaviour in cluster mode as described in .agents/distributed-state.md.