Embeddings, Vector Databases, and Search in LLM
Embeddings, Vector Databases, and Search in LLM
• Learn best practices for when to use vector stores and how to improve
search-retrieval performance
Word Embedding: Basics. Create a vector from a word | by Hariom Gautam | Medium
© Databricks Inc. — All rights reserved
Turn images and audio into vectors too
Data objects Vectors Tasks
• Object recognition
[ . , . , - . , ….] • Scene detection
• Product search
• Translation
[ . , . , - . , ….] • Question Answering
• Semantic search
• Speech to text
[ . , . , - . , ….] • Music transcription
• Machinery malfunction
© Databricks Inc. — All rights reserved
Use cases of vector databases
• Similarity search: text, images, audio
Are electric cars better for the environment?
• De-duplication
• Semantic match, rather than keyword match! electric cars climate impact
• Example on enhancing product search
• Very useful for knowledge-based Q/A Environmental impact of electric vehicles
• Recommendation engines
How to cope with the pandemic
• Example blog post: Spotify uses vector
search to recommend podcast episodes dealing with covid ptsd
Source: Spotify
The higher the metric, the less similar The higher the metric, the more similar
Source: buildin.com
Source: Pinecone
© Databricks Inc. — All rights reserved
Ability to search for similar
objects is
• Post-query
• In-query
• Pre-query
• # of results is highly
unpredictable
• Branding as a scalar
• Not as performant as
post- or in-query filtering
Pros Cons
Open-Sourced
Qdrant No HNSW
Redis No HNSW
Weaviate No HNSW
Not Open-Sourced
• Splitting doc into smaller docs = doc can produce N vectors of M tokens
Existing resources:
• Text Splitters by LangChain
• Blog post on semantic search by Vespa - light mention of chunking
• Chunking Strategies by Pinecone