mirror of
https://github.com/thedotmack/claude-mem
synced 2026-04-25 17:15:04 +02:00
feat: Add DefaultEmbeddingFunction for local vector embeddings
- Added @chroma-core/default-embed dependency for local embeddings - Updated ChromaSync to use DefaultEmbeddingFunction with collections - Added isServerReachable() async method for reliable server detection - Fixed start() to detect and reuse existing Chroma servers - Updated build script to externalize native ONNX binaries - Added runtime dependency to plugin/package.json The embedding function uses all-MiniLM-L6-v2 model locally via ONNX, eliminating need for external embedding API calls. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -58,7 +58,10 @@ async function buildHooks() {
|
||||
private: true,
|
||||
description: 'Runtime dependencies for claude-mem bundled hooks',
|
||||
type: 'module',
|
||||
dependencies: {},
|
||||
dependencies: {
|
||||
// Chroma embedding function with native ONNX binaries (can't be bundled)
|
||||
'@chroma-core/default-embed': '^0.1.9'
|
||||
},
|
||||
engines: {
|
||||
node: '>=18.0.0',
|
||||
bun: '>=1.0.0'
|
||||
@@ -94,9 +97,12 @@ async function buildHooks() {
|
||||
logLevel: 'error', // Suppress warnings (import.meta warning is benign)
|
||||
external: [
|
||||
'bun:sqlite',
|
||||
// Optional chromadb embedding providers (not needed for HTTP client mode)
|
||||
// Optional chromadb embedding providers
|
||||
'cohere-ai',
|
||||
'ollama'
|
||||
'ollama',
|
||||
// Default embedding function with native binaries
|
||||
'@chroma-core/default-embed',
|
||||
'onnxruntime-node'
|
||||
],
|
||||
define: {
|
||||
'__DEFAULT_PACKAGE_VERSION__': `"${version}"`
|
||||
|
||||
Reference in New Issue
Block a user