构建工作流

Store and search data with vectors

Vector databases store information as numbers:

A vector database is a type of database that stores data as high-dimensional vectors, which are mathematical representations of features or attributes. (source)

This enables fast and accurate similarity searches. With a vector database, instead of using conventional database queries, you can search for relevant data based on semantic and contextual meaning.

A simplified example

A vector database could store the sentence "n8n is a source-available automation tool that you can self-host", but instead of storing it as text, the vector database stores an array of dimensions (numbers between 0 and 1) that represent its features. This doesn't mean turning each letter in the sentence into a number. Instead, the vectors in the vector database describe the sentence.

Suppose that in a vector store 0.1 represents automation tool, 0.2 represents source available, and 0.3 represents can be self-hosted. You could end up with the following vectors:

Sentence Vector (array of dimensions)
n8n is a source-available automation tool that you can self-host \[0.1, 0.2, 0.3]
Zapier is an automation tool \[0.1]
Make is an automation tool \[0.1]
Confluence is a wiki tool that you can self-host \[0.3]

Demonstrating the power of similarity search

Qdrant provides vector search demos to help users understand the power of vector databases. The food discovery demo shows how a vector store can help match pictures based on visual similarities.

This demo uses data from Delivery Service. Users may like or dislike the photo of a dish, and the app will recommend more similar meals based on how they look. It's also possible to choose to view results from the restaurants within the delivery radius. (source)

For full technical details, refer to the Qdrant demo-food-discovery GitHub repository.

Embeddings, retrievers, text splitters, and document loaders

Vector databases require other tools to function:

  • Document loaders and text splitters: document loaders pull in documents and data, and prepare them for embedding1. Document loaders can use text splitters to break documents into chunks.
  • Embeddings: these are the tools that turn the data (text, images, and so on) into vectors, and back into raw data. Note that n8n only supports text embeddings.
  • Retrievers: retrievers fetch documents from vector databases. You need to pair them with an embedding to translate the vectors back into data.

Footnotes

  1. Embeddings are numerical representations of data using vectors. They're used by AI to interpret complex data and relationships by mapping values across many dimensions. Vector databases, or vector stores, are databases designed to store and access embeddings.

    Back

官方原文和授权

本页来自 N8N 英文官方网站固定快照,并转换成 xueai 静态页面。内容以 N8N 持续更新的官方页面为准。

来源、授权与修改

本站保留许可证、固定提交号、社区作者和修改说明,不代表 n8n 对本站背书。

查看许可证查看来源和修改说明