product-embedder
v1.0.0
Published
Generate text embeddings for Excel rows using Ollama
Maintainers
Readme
Product Embedder
Generate text embeddings for Excel rows using Ollama.
Prerequisites
- Node.js 16+
- Ollama running locally with nomic-embed-text model
Installation
npm install -g product-embedderOr use directly:
npx product-embedderUsage
Command Line
embedder input.xlsx
embedder file1.xlsx file2.xlsx file3.xlsxProgrammatic Usage
import { embedFiles } from 'product-embedder';
await embedFiles(['data.xlsx'], 'output.xlsx');How It Works
- Reads Excel files (.xlsx)
- Converts each row to text (columns joined with " | ")
- Generates embeddings using Ollama's nomic-embed-text model
- Saves results with original data + embeddings + source file column
- Outputs both .xlsx and .csv formats
Output
Creates timestamped files like products_with_embeddings_20250911T173045.xlsx containing:
- Original data columns
embeddingcolumn with JSON array of vectorssource_filecolumn with source filename
Configuration
Set Ollama endpoint (default: http://localhost:11434):
OLLAMA_API=http://your-ollama-server:11434 embedder input.xlsxRequirements
- Ollama server running locally or remotely
- nomic-embed-text model installed in Ollama
- Valid Excel files (.xlsx format)
License
MIT
