Guide to building a fully offline AI interview coach using Foundry Local, RAG with TF-IDF and SQLite, implemented in JavaScript. Covers setup, chunking, TF-IDF vectors, cosine retrieval, prompt assembly, streaming from a local LLM, web and CLI interfaces, testing, and edge mode.
Imagine a fully offline AI interview coach built with Foundry Local, RAG, and SQLite. This approach runs entirely on-device and avoids cloud data exfiltration. It combines TF-IDF retrieval with a local LLM to generate targeted, CV-grounded interview questions.
Main feature/change and impact
The main change is a 100% offline RAG pipeline using Foundry Local and SQLite as a vector store. Documents are chunked, TF-IDF vectors are stored in SQLite, and cosine similarity selects relevant chunks. A local LLM composes answers with retrieved context. This eliminates cloud APIs, removes network latency, and preserves privacy while keeping performance predictable for interview coaching.Practical implications
Developers can deploy interview assistants without API keys or external services. The stack uses JavaScript, Express, and sql.js for portability and zero native build steps. Testing relies on Node.js built-in test runner, reducing dependencies. For small corpora, brute-force cosine similarity on SQLite is fast and memory efficient. Edge mode reduces prompt size for constrained devices, enabling broader hardware compatibility.“No cloud. No API keys. No internet required.”This pattern matters for privacy-sensitive workflows and offline-first products. Next steps include adapting chunk sizes, adjusting TF-IDF preprocessing, and tuning temperature for consistent responses. Implementers should validate retrieval relevance and add unit tests for chunking and vector search.
Key points from the article:
Related Coverage:
- Building sovereign AI at the edge: Microsoft and Armada collaborate to deliver Azure Local on Galleon modular datacenters
- Live in Foundry today: MAI-Image-2-Efficient, 40% faster rendering than other top image generation models.
- Live in Foundry: MAI-Image-2-Efficient, 40% faster rendering than other top image generation models
From the Microsoft Developer Community Blog articles
