# Generate and evaluate retrieval embeddings with FlagEmbedding

> Use FlagEmbedding to choose BGE embedding or reranking models, encode documents and queries, evaluate retrieval quality, and feed stronger context into RAG workflows.

- Skill: `agentskillexchange/generate-and-evaluate-retrieval-embeddings-with-flagembeddin` (Agent Skill)
- Install (CLI): `npx skillmds@latest add agentskillexchange/generate-and-evaluate-retrieval-embeddings-with-flagembeddin`
- Raw SKILL.md: https://api.skillmd.com/api/skills/agentskillexchange/generate-and-evaluate-retrieval-embeddings-with-flagembeddin/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: agentskillexchange (https://skillmd.com/u/agentskillexchange)
- Updated: 2026-09-08
- Page: https://skillmd.com/skills/agentskillexchange/generate-and-evaluate-retrieval-embeddings-with-flagembeddin

---


# Generate and evaluate retrieval embeddings with FlagEmbedding

Use FlagEmbedding to choose BGE embedding or reranking models, encode documents and queries, evaluate retrieval quality, and feed stronger context into RAG workflows.

## Prerequisites

Python environment, FlagEmbedding package, selected BGE embedding or reranker model, local corpus, query set, and a downstream vector or RAG pipeline.

## Installation

Use the upstream install or setup path that matches your environment:
- pip install -U FlagEmbedding
- pip install -U FlagEmbedding[finetune]
- git clone https://github.com/FlagOpen/FlagEmbedding.git
- pip install .

Basic usage or getting-started notes:
- <a href=#quick-start>Quick Start</a> |
- If you do not want to finetune the models, you can install the package without the finetune dependency:
- If you want to finetune the models, you can install the package with the finetune dependency:

- Source: https://github.com/FlagOpen/FlagEmbedding
- Extracted from upstream docs: https://raw.githubusercontent.com/FlagOpen/FlagEmbedding/HEAD/README.md

## Documentation

- https://github.com/FlagOpen/FlagEmbedding

## Source

- [Agent Skill Exchange](https://agentskillexchange.com/skills/generate-and-evaluate-retrieval-embeddings-with-flagembedding/)

