FlagEmbedding is the research library behind BGE, the widely used family of text embedding and reranking models from the Beijing Academy of Artificial Intelligence (BAAI). It provides the models, training code and evaluation tooling that made BGE a default choice for retrieval-augmented generation, and it has earned about 12,300 stars on GitHub.
Good RAG systems stand or fall on retrieval quality, and FlagEmbedding covers the full stack. The BGE model series spans general-purpose embeddings in several sizes, the multilingual and multi-granularity bge-m3, rerankers that refine first-pass search results, and LLM-based embedders for demanding workloads, together with visualized multimodal variants. The library is as much about making your own models as using theirs: it ships complete fine-tuning pipelines for embeddings and rerankers, including hard-negative mining and training on your own data, plus evaluation harnesses aligned with the MTEB and C-MTEB benchmarks where BGE models have repeatedly posted leading scores. Everything is released openly with weights on Hugging Face, and the project continues to publish new models and recipes โ the repository was actively updated through 2026, which keeps it a living reference for how modern embedding models are built and trained.
FlagEmbedding is free and open source under the MIT license, and the BGE models can be downloaded and self-hosted at no cost. You pay only for your own compute, or optionally for a hosted embedding API if you choose one instead.
FlagEmbedding is for developers and researchers building search, recommendation and RAG systems who need state-of-the-art open embeddings โ and for teams who want to fine-tune an embedding or reranking model on their own domain data rather than accept generic retrieval quality.