Skip to content

Ollama Embeddings

The Ollama Embeddings component lets you turn plain text into numerical vectors (embeddings) that can be used for searching, clustering, or feeding into other AI models. It connects to an Ollama server running locally or on a network and uses the chosen model to produce the embeddings.

How it Works

When you provide a piece of text, the component sends it to the Ollama API at the URL you specify. Ollama runs the selected model (for example, llama3.1) and returns a list of numbers that represent the meaning of the text in a high‑dimensional space. These numbers can then be stored in a vector database or compared with other embeddings to find similarities.

Inputs

Mapping Mode

This component has a special mode called “Mapping Mode”. When you enable this mode using the toggle switch, an additional input called “Mapping Data” is activated, and each input field offers you three different ways to provide data:

  • Fixed: You type the value directly into the field.
  • Mapped: You connect the output of another component to use its result as the value.
  • Javascript: You write Javascript code to dynamically calculate the value.

This flexibility allows you to create more dynamic and connected workflows.

Input Fields

The following fields are available to configure this component. Each field may be visible in different operations:

  • Ollama Base URL: The address of the Ollama server (e.g., http://localhost:11434). This tells the component where to send the text for embedding.
  • Ollama Model: The name of the model you want to use, such as llama3.1. Different models can produce different quality or size of embeddings.
  • Model Temperature: A number that controls how random the model’s output can be. Lower values (e.g., 0.1) make the embeddings more deterministic, while higher values add more variation.
  • Mapping Mode: A toggle that, when turned on, lets you process many records at once by mapping inputs from other components.

Outputs

  • Embeddings: The component returns a set of embeddings (a list of numbers) that represent the input text. These can be passed to a vector store, used for similarity searches, or combined with other data in your workflow.

Usage Example

  1. Add the component to your workflow and connect a text source (e.g., a “Text Input” component or a database query that returns a string).
  2. Set the Ollama Base URL to the address where your Ollama server is running.
  3. Choose a model (the default is llama3.1).
  4. Adjust the temperature if you want more or less variation in the embeddings.
  5. Connect the output of this component to a vector store or a similarity search component to use the embeddings in downstream tasks.

This simple setup lets you turn any text into a usable vector representation with just a few clicks.

  • Text Splitter – Breaks long documents into smaller chunks before embedding.
  • Vector Store – Stores embeddings for fast retrieval and similarity search.
  • Similarity Search – Finds the most similar embeddings to a query vector.
  • Prompt Builder – Creates prompts that can include embeddings for advanced LLM interactions.

Tips and Best Practices

  • Keep the Ollama server running and reachable; otherwise the component will fail to connect.
  • Use a consistent model across your workflow to maintain comparable embeddings.
  • If you process large volumes of text, enable Mapping Mode to batch the requests and improve performance.
  • Store embeddings in a vector database to enable quick similarity searches later.

Security Considerations

  • The component communicates with the Ollama server over HTTP by default. If you expose the server to the internet, consider using HTTPS or a VPN to protect the data in transit.
  • Ensure that the server’s access controls are configured so that only authorized users can send requests to it.