pgvector gives PostgreSQL the ability to store and compare AI embeddings. In Odoo 20, it acts as the similarity-search layer that helps AI agents find relevant information in PDFs, web links, Documents, and Knowledge articles.
Simple idea: Odoo turns text into vectors, pgvector finds the closest matches, and the AI model turns those matches into an answer.
Why Odoo needs it
An AI agent cannot scan every document for every question efficiently. Odoo first processes each source and stores a numerical representation called an embedding. Similar ideas produce similar vectors.
"Refund an overpaid invoice"
│ embedding model
▼
[0.12, 0.87, 0.31, ...]
"Customer paid twice—how do I refund it?"
│ embedding model
▼
[0.10, 0.85, 0.29, ...]
▲
└── vectors are close: related meaning
This allows Odoo to search by meaning, not only by matching exact words.
How the integration works
PDF / webpage / Knowledge article
│
▼
Odoo extracts text
│
▼
Embedding model creates vectors
│
▼
pgvector stores vectors in PostgreSQL
User question ──► vector ──► nearest matching chunks
│
▼
Odoo agent + LLM answer
Odoo 20 agents have two important parts:
| Part | Job |
|---|---|
| Sources | Indexed information the agent may retrieve: PDFs, links, Documents, and Knowledge articles. |
| Skills and tools | Instructions and permitted actions, such as searching, creating a lead, or updating a record. |
pgvector powers the first part: finding relevant source content. It does not generate the final answer by itself and does not grant the agent permission to change records.
Core use cases in Odoo 20
Combining pgvector with large language models supports several practical AI experiences across Odoo applications.
| Feature | Application | How pgvector helps |
|---|---|---|
| Semantic knowledge search | Knowledge & Documents | Lets users ask natural-language questions such as “What is our return policy?” instead of relying on exact keyword matches. |
| Smart ticket handling | Helpdesk | Matches incoming tickets with similar resolved cases to recommend solutions or help draft instant FAQs. |
| AI product recommendations | eCommerce & Sales | Finds products whose descriptions or embeddings are similar to a customer's request or behavior. |
In each case, pgvector retrieves relevant context. The LLM then uses that context to produce a grounded answer, recommendation, or draft response.
Installation
Odoo 20 requires PostgreSQL 16 or later, which satisfies pgvector's PostgreSQL 15+ requirement. Install the extension package on the PostgreSQL server, then enable it in the Odoo database:
CREATE EXTENSION IF NOT EXISTS vector;
SELECT extversion
FROM pg_extension
WHERE extname = 'vector';
For large knowledge sets, pgvector can use approximate indexes such as HNSW or IVFFlat to search faster. Small collections may be fast enough without an approximate index.
What changes in Odoo 20?
Important version detail: pgvector integration is not completely new to Odoo 20. Odoo 19 already required it for AI features and documented indexed agent sources.
Odoo 20 keeps the same PostgreSQL-backed vector approach while making agents more action-oriented. Agents gain clearer skills and tools, including information retrieval, record creation and updates, website building, image generation, and web search. Sources can also be manually reprocessed after their content changes.
Good to remember
- pgvector stores and searches vectors; an LLM generates the response.
- Keep the PostgreSQL server, Odoo database, and pgvector package versions compatible.
- Vector indexes consume extra memory and storage; test HNSW or IVFFlat with real data sizes.
- Vector data follows normal PostgreSQL backup, replication, and access-control rules.
- Index only the sources users are allowed to use, and reprocess changed documents.
Bottom line
pgvector turns Odoo's business knowledge into searchable vectors. That lets an agent retrieve relevant document sections before asking the language model to answer, while ordinary PostgreSQL remains the system of record.