A practical primer on how vectors and embeddings power semantic search and AI memory, and how the OCA field_vector module brings vector fields into Odoo, with a migration to Odoo 19.0 contributed by Trobz.

Fundamentals: Vectors and Embeddings

What Is a Vector?

In computer science and data work, a vector is an ordered list of numbers, for example [1.2, -0.5, 0.8]. In mathematics and physics, a vector describes magnitude and direction. In AI, it is used to represent features or coordinates in a multi-dimensional space.

What Are Embeddings?

An embedding is a vector that represents a real-world object, such as a piece of text, an image, a user or a product, in a form that machines can process and compare.

An embedding model takes data such as the word “Apple” and turns it into a long list of numbers, for example a vector with 1,536 dimensions. The important part is that this transformation preserves meaning:

  • The vector for “Apple” is closer to “Banana” (both fruits) than to “Car” (a vehicle).
  • In classic word embeddings, “King” minus “Man” plus “Woman” gives a vector very close to “Queen”.

Why Embeddings Matter for AI

Embeddings are the foundation of modern semantic search and RAG (Retrieval-Augmented Generation).

ApproachMatches onWhen the user searches for “fruit”
Traditional searchKeywords (WHERE name ILIKE '%apple%')Misses “Apple”, because the word “fruit” does not appear
Vector searchMeaning (ORDER BY embedding <-> query_embedding)Finds “Apple”, because the two vectors are close

Embeddings also give AI agents a form of memory. Instead of loading an entire database into context, an agent retrieves only the snippets most relevant to the user’s question. This is what makes RAG practical on large amounts of data.

OCA Module: field_vector

Purpose

The field_vector module, part of OCA/server-tools , adds a native vector field type to the Odoo framework. Laurent Mignon (ACSONE) introduced it for Odoo 16.0 in PR #3251 .

What it enables:

  • Native integration: developers define vector fields on any Odoo model in the same way as Char or Integer fields.
  • pgvector backend: vectors are stored and queried with the pgvector PostgreSQL extension, inside the existing database.
  • No separate vector database: there is no need for an external service such as Pinecone or Weaviate, so the architecture stays simpler and the data stays in one place.

Odoo 19.0 Support

Trobz contributed to the migration of field_vector to Odoo 19.0, which was merged in January 2026 through PR #3430 . Projects on Odoo 19.0 can use native vector fields without backports or workarounds.