Skip to content

Embed Texts

Embed Texts is a simple tool that turns words or sentences into numbers. These numbers (called vectors) can be used by other parts of Nappai to find similar text, store information, or feed into AI models.

How it Works

When you give the component a list of text items and an embeddings model, it runs each text through the model. The model translates the words into a series of numbers that capture the meaning of the text. The component then packages these numbers into a Data object so other components can use them.

Inputs

  • Texts: A list of strings that you want to embed.

    • Visible in: All
  • Embeddings: The embeddings model that will convert the texts into vectors.

    • Visible in: All

Outputs

The component returns a Data object that contains a field called vector. This field holds the list of numerical vectors produced from the input texts. You can feed this output into a vector store, similarity search, or any other component that works with vector data.

Usage Example

  1. Drag the Embed Texts component onto your workflow.
  2. In the Texts field, type or paste the sentences you want to embed, e.g.
    ["Hello world", "Nappai automates tasks"]
  3. Connect the Embeddings field to an embeddings model component (e.g., OpenAI embeddings).
  4. Run the workflow. The output will be a Data object with the vectors that represent each sentence.

You can then connect this output to a Vector Store component to save the vectors or to a Similarity Search component to find related text.

  • Text Splitter – Breaks long documents into smaller chunks before embedding.
  • Vector Store – Stores vectors for fast retrieval.
  • Similarity Search – Finds the most similar vectors to a query.
  • Embeddings Model – Provides the actual embedding algorithm (e.g., OpenAI, Hugging Face).

Tips and Best Practices

  • Keep the text length moderate; very long texts may need to be split first.
  • Use the same embeddings model for all components that interact with the vectors to avoid mismatches.
  • If privacy is a concern, choose a local embeddings model instead of a cloud service.

Security Considerations

If you use a cloud‑based embeddings model, the text you send may leave your local environment. Make sure you understand the data handling policies of the provider and consider using a local model if your data is sensitive.