Favicon of BGE Embeddings

BGE Embeddings

Open-source Python toolkit for semantic search and RAG, with BGE embedding models, multilingual rerankers, evaluation and fine-tuning under MIT.

Screenshot of BGE Embeddings website

BGE Embeddings is a family of embedding models and rerankers for developers building semantic search and retrieval-augmented generation (RAG). Developed by the Beijing Academy of Artificial Intelligence, it includes the MIT-licensed Python toolkit FlagEmbedding for running inference, evaluating retrieval and fine-tuning models.

Embedding models turn text into numerical representations that let an application compare meaning rather than rely only on matching words. Rerankers score query-document pairs to reorder retrieved results. BGE provides both, so developers can choose models for finding candidate passages and for assessing their relevance before passing them to an LLM.

The models cover different retrieval needs. BAAI/bge-m3 supports multilingual search with dense, sparse and ColBERT-style multi-vector retrieval, plus longer text inputs. BAAI/bge-en-icl is an English embedding model that accepts task instructions and example pairs through in-context learning. BAAI/bge-multilingual-gemma2 provides another multilingual option with task-based instructions.

For reranking, BAAI/bge-reranker-v2-m3 is a lightweight multilingual cross-encoder. BAAI/bge-reranker-v2-gemma also handles multilingual query-document scoring, while BAAI/bge-reranker-v2-minicpm-layerwise lets developers select output layers to reduce inference work. FlagEmbedding includes examples for embedding and reranker inference, evaluation and fine-tuning.

Similar to BGE Embeddings