ダブルクリックで英日反転
Applied Sciences · Engineering
Vector Databases & Embeddings — Foundation of Semantic Search
An embedding turns text or images into a numeric vector encoding meaning; vector databases store millions of such vectors and retrieve the nearest neighbors at speed, making semantic search and RAG possible.
What is an Embedding?
- Text or image → sequence of numbers (vector) representing semantic meaning.
- "dog" and "cat" are close in vector space; "dog" and "economics" are far apart.
- Typical dimensionality: hundreds to thousands of numbers per vector.
What is a Vector Database?
- Stores large volumes of vectors; answers "return top-N closest vectors to this query."
- Uses ANN (Approximate Nearest Neighbor) — trades tiny accuracy loss for dramatic speed.
- Key products: Pinecone (managed SaaS), Qdrant (Rust, fast), pgvector (PostgreSQL extension), Chroma (lightweight local).
RAG — Why Vector DBs Matter
- RAG (Retrieval-Augmented Generation): retrieve external knowledge, pass it to an LLM for answers.
- Flow: embed docs → store → embed query → retrieve closest docs → LLM generates answer.
- Lets the LLM use knowledge it never saw during training (internal docs, latest news).
Embedding Services & Tools
- Paid APIs: Voyage AI (recommended by Anthropic docs), OpenAI Embeddings, Cohere Embed (multilingual), Google Gemini Embeddings.
- Local/OSS: Ollama (run models on your PC, independent OSS, not Meta), sentence-transformers (Python, HuggingFace).
- Quick start at zero cost: Chroma + Ollama locally.
→ Embeddings encode meaning as numbers; vector DBs find nearest neighbors fast; together they power RAG and semantic search.
Applied Sciences · Engineering
ベクトルDBと埋め込み(Embeddings)— セマンティック検索の基盤
埋め込み(embedding)はテキストや画像を意味を表す数値ベクトルに変換する技術。ベクトルDB(vector database)はその大量ベクトルを格納し近傍検索を高速に行うことで、RAGやセマンティック検索(意味的類似検索)を実現する。
埋め込み(Embedding)とは
- テキストや画像を数値の列(ベクトル)に変換し、意味を座標空間で表現する。
- 「dog」と「cat」は近傍、「dog」と「economics」は遠方に配置される。
- 次元数(数値の個数)は一般的に数百〜数千。
ベクトルDB(Vector Database)とは
- 大量のベクトルを格納し「意味的に近い上位N件」を返す専用ストア。
- ANN(近似最近傍探索=わずかな精度を犠牲に劇的な速度向上)を活用。
- 主要製品: Pinecone(フルマネージドSaaS)、Qdrant(Rust製・高速)、pgvector(PostgreSQL拡張)、Chroma(ローカル開発向け軽量)。
RAGにおける役割
- RAG(Retrieval-Augmented Generation=外部知識を検索してLLMに渡す手法)の基盤がベクトルDB。
- 流れ: 文書を埋め込み→DB蓄積→質問を埋め込み→近傍文書を取得→LLMが回答生成。
- 学習時に存在しなかった情報(社内文書・最新ニュース)をLLMに参照させられる。
埋め込みを作るサービスとツール
- 有料API: Voyage AI(Anthropic公式ドキュメントが推奨)、OpenAI Embeddings、Cohere Embed(多言語)、Google Gemini Embeddings。
- ローカル/OSS: Ollama(自PCでモデルを実行・Metaとは独立したOSS)、sentence-transformers(PythonライブラリでHuggingFaceモデルを利用)。
- ゼロコストで試すなら Chroma + Ollama の組み合わせが最速。
→ 埋め込みは意味を数値化し、ベクトルDBが近傍を高速に探す。この組み合わせがRAGとセマンティック検索の核心。
Applied Sciences · Engineering
Vector Databases & Embeddings — Foundation of Semantic Search
An embedding turns text or images into a numeric vector encoding meaning; vector databases store millions of such vectors and retrieve the nearest neighbors at speed, making semantic search and RAG possible.
What is an Embedding?
- Text or image → sequence of numbers (vector) representing semantic meaning.
- "dog" and "cat" are close in vector space; "dog" and "economics" are far apart.
- Typical dimensionality: hundreds to thousands of numbers per vector.
What is a Vector Database?
- Stores large volumes of vectors; answers "return top-N closest vectors to this query."
- Uses ANN (Approximate Nearest Neighbor) — trades tiny accuracy loss for dramatic speed.
- Key products: Pinecone (managed SaaS), Qdrant (Rust, fast), pgvector (PostgreSQL extension), Chroma (lightweight local).
RAG — Why Vector DBs Matter
- RAG (Retrieval-Augmented Generation): retrieve external knowledge, pass it to an LLM for answers.
- Flow: embed docs → store → embed query → retrieve closest docs → LLM generates answer.
- Lets the LLM use knowledge it never saw during training (internal docs, latest news).
Embedding Services & Tools
- Paid APIs: Voyage AI (recommended by Anthropic docs), OpenAI Embeddings, Cohere Embed (multilingual), Google Gemini Embeddings.
- Local/OSS: Ollama (run models on your PC, independent OSS, not Meta), sentence-transformers (Python, HuggingFace).
- Quick start at zero cost: Chroma + Ollama locally.
→ Embeddings encode meaning as numbers; vector DBs find nearest neighbors fast; together they power RAG and semantic search.
Applied Sciences · Engineering
ベクトルDBと埋め込み(Embeddings)— セマンティック検索の基盤
埋め込み(embedding)はテキストや画像を意味を表す数値ベクトルに変換する技術。ベクトルDB(vector database)はその大量ベクトルを格納し近傍検索を高速に行うことで、RAGやセマンティック検索(意味的類似検索)を実現する。
埋め込み(Embedding)とは
- テキストや画像を数値の列(ベクトル)に変換し、意味を座標空間で表現する。
- 「dog」と「cat」は近傍、「dog」と「economics」は遠方に配置される。
- 次元数(数値の個数)は一般的に数百〜数千。
ベクトルDB(Vector Database)とは
- 大量のベクトルを格納し「意味的に近い上位N件」を返す専用ストア。
- ANN(近似最近傍探索=わずかな精度を犠牲に劇的な速度向上)を活用。
- 主要製品: Pinecone(フルマネージドSaaS)、Qdrant(Rust製・高速)、pgvector(PostgreSQL拡張)、Chroma(ローカル開発向け軽量)。
RAGにおける役割
- RAG(Retrieval-Augmented Generation=外部知識を検索してLLMに渡す手法)の基盤がベクトルDB。
- 流れ: 文書を埋め込み→DB蓄積→質問を埋め込み→近傍文書を取得→LLMが回答生成。
- 学習時に存在しなかった情報(社内文書・最新ニュース)をLLMに参照させられる。
埋め込みを作るサービスとツール
- 有料API: Voyage AI(Anthropic公式ドキュメントが推奨)、OpenAI Embeddings、Cohere Embed(多言語)、Google Gemini Embeddings。
- ローカル/OSS: Ollama(自PCでモデルを実行・Metaとは独立したOSS)、sentence-transformers(PythonライブラリでHuggingFaceモデルを利用)。
- ゼロコストで試すなら Chroma + Ollama の組み合わせが最速。
→ 埋め込みは意味を数値化し、ベクトルDBが近傍を高速に探す。この組み合わせがRAGとセマンティック検索の核心。
Related notes
- Agentic Commerce — ACP and Visibility into Being 'Bought by AI'
- AI Search Evaluation: The 12 Metrics — Gateway
- AI Search Evaluation ①Citation Rate — How Many URLs Are Pulled In Per Answer
- AI Search Evaluation ②Source Diversity — How Unskewed the Cited Sources Are
- AI Search Evaluation ③Accuracy Score — How Often It Answers Factual Questions Correctly
- AI Search Evaluation ④Answer Length — How Many Characters It Returns to the User on Average