Ollama Embeddings
The Ollama Embeddings node converts text into numerical vectors (embeddings) that capture meaning and context. Think of it as creating a “fingerprint” for text that allows AI to understand similarity and relationships between different pieces of content.
This is the foundation for building smart document search systems and AI knowledge bases that work completely locally on your machine.
How it works
Section titled “How it works”The node takes your text content and uses a local Ollama model to convert it into a list of numbers (vectors) that represent the meaning of the text. These vectors can then be used to find similar content or build searchable databases.
graph LR Text[Your Text] --> Ollama[Ollama Model] Ollama --> Vectors[Number Vectors] Vectors --> Search[Searchable Database] style Ollama fill:#6d28d9,stroke:#fff,color:#fff
Setup guide
Section titled “Setup guide”-
Install Ollama: Download and install Ollama on your computer from ollama.com.
-
Download Embedding Model: Run
ollama pull nomic-embed-textto get a good embedding model. -
Start Ollama Server: Run
ollama serveto start the local server. -
Configure Node: Set the Ollama URL and model name in your workflow.
Practical example: Building searchable knowledge base
Section titled “Practical example: Building searchable knowledge base”Let’s convert website content into searchable vectors for a knowledge base.
Option 1: Basic Setup
- Server:
http://localhost:11434 - Model:
nomic-embed-text - Content: The single text block you want to process.
Option 2: Batch Processing
- Goal: Process multiple texts at once for speed.
- Input: List of text strings.
- Batch Size: 5 items at a time.
Option 3: Custom Configuration
- Normalize: Enable to improve vector math consistency.
- Timeout: 30 seconds (give it more time for longer texts).
Why use local embeddings
Section titled “Why use local embeddings”| Local Embeddings (Ollama) | Cloud Embeddings |
|---|---|
| Complete privacy - data never leaves your machine | Data sent to external servers |
| No ongoing costs | Pay per API call |
| Works offline | Requires internet connection |
| No rate limits | API rate limits apply |
| Full control over models | Limited model choices |
Popular embedding models
Section titled “Popular embedding models”| Model | Best For | Size | Speed |
|---|---|---|---|
| nomic-embed-text | General purpose, good quality | ~270MB | Fast |
| all-minilm | Lightweight, fast processing | ~90MB | Very Fast |
| bge-large | High quality, detailed embeddings | ~1.3GB | Slower |
Real-world examples
Section titled “Real-world examples”Document similarity search
Section titled “Document similarity search”Create embeddings to find similar documents:
Input: "How to optimize website performance"Output: [0.123, -0.456, 0.789, ...] (768 numbers)Use: Find documents with similar vector patternsKnowledge base creation
Section titled “Knowledge base creation”Convert company docs into searchable format:
Process: Company policies → Ollama Embeddings → Local KnowledgeResult: Smart search through all company documentationContent recommendation
Section titled “Content recommendation”Find related articles or content:
Process: User reads article → Get embedding → Find similar embeddingsResult: "You might also like these articles"Troubleshooting
Section titled “Troubleshooting”- “Connection failed” errors: Make sure Ollama is running (
ollama serve) and the URL is correct. - “Model not found” errors: Download the model first with
ollama pull nomic-embed-text. - Slow processing: Try a smaller/faster model like
all-minilmor reduce batch size. - Out of memory errors: Use smaller batch sizes or try a lighter embedding model.