Building Ask Leya: Lessons Learned from Local ONNX Embeddings, Prisma Migrations, and Express Async Handlers
说明与用途
构建了一个使用本地ONNX嵌入进行多语言检索、简化Prisma迁移以及在Express中可靠处理异步错误的聊天小部件。
问题
Need a chat widget that answers from a business’s own content, supports multiple languages locally, handles database migrations with unreleased modules, and properly forwards async errors in Express.
结果
The project achieved a multilingual, locally hosted chat widget with efficient embeddings, streamlined migrations, and robust async error handling, reducing external dependencies and improving response reliability.
工作流
- 1. Load paraphrase-multilingual-MiniLM-L12-v2 ONNX model in-process for vector embeddings.
- 2. Embed user query and match against English knowledge base using pgvector.
- 3. Return answer in user language via chat model.
- 4. Use prisma migrate diff to filter additive statements for unreleased tables.
- 5. Add Express error-handling middleware to catch async rejections and send responses.
证据
Cross-language retrieval is local, not the LLM Retrieval uses paraphrase-multilingual-MiniLM-L12-v2 through ONNX, in-process — 384 dims, trained across 50+ languages.
Express 4 doesn't forward async rejections
- 记录日期: 2026-09-15T02:46:53.673Z