Embedding
An embedding is a dense numerical vector (array of numbers) that represents the semantic meaning of a piece of text. Embedding models convert words, sentences, or documents into fixed-size vectors in high-dimensional space, where semantically similar texts are positioned close together.
How it works
Embedding models (like OpenAI text-embedding-3, Cohere embed, or open-source models) convert text into vectors of 256-3072 dimensions. For example, "How do I cancel?" and "I want to end my subscription" would produce vectors that are close together in the embedding space because they have similar meaning.
Embeddings enable semantic search: instead of matching keywords, you compare the mathematical similarity (cosine similarity) between the query embedding and document embeddings. The closest vectors represent the most semantically relevant content.
Why it matters
How Chatsy uses embedding
Real-world examples
Key takeaways
Frequently asked questions
What is the difference between an embedding and a keyword?
A keyword is an exact text string. An embedding is a numerical representation of meaning. Keywords match literally ("pricing" only finds "pricing"). Embeddings match semantically ("pricing" also finds "cost," "fees," "how much," etc.).
How are embeddings stored?
Embeddings are stored in vector databases or vector-enabled databases. Chatsy uses pgvector (a PostgreSQL extension) to store embeddings alongside structured data in the same database, simplifying the architecture.
Do embeddings need to be regenerated when I update content?
Yes. When you edit a knowledge base article, the embeddings for the changed sections need to be regenerated to reflect the updated content. Platforms like Chatsy handle this automatically — updating an article triggers re-embedding within seconds.
What embedding model should I use?
For most customer support use cases, OpenAI text-embedding-3-small offers the best balance of quality and cost. For higher accuracy on complex content, text-embedding-3-large is recommended. Cohere embed and open-source models like BGE are strong alternatives.