Open-source embedding database for AI apps, storing documents and vectors to power semantic, hybrid and full-text search.
FlagOpen/FlagEmbedding
A retrieval toolkit from BAAI providing BGE embedding and reranker models plus training, evaluation and tutorials for search and RAG.
- Stars
- 12,259
- Forks
- 1,105
- Open issues
- 924
- Last commit
- 2 months ago
What is it?
FlagEmbedding (BGE, BAAI General Embedding) is a toolkit for text retrieval and retrieval-augmented LLM applications. It provides a family of embedding models that convert text into vectors for semantic search, along with cross-encoder reranker models that reorder the top results returned by an embedder.
The project covers the full workflow: inference with the Python package (installable via pip), fine-tuning scripts for embedders and rerankers, evaluation tools, and a dataset collection. Models are published on Hugging Face and include English, Chinese and multilingual variants, with the BGE-M3 model supporting dense, sparse and multi-vector retrieval over inputs up to 8192 tokens.
Beyond the core models, the repository hosts research projects such as LLM-Embedder for retrieval augmentation, Activation-Beacon for extending LLM context length, and C-MTEB, a Chinese embedding benchmark.
Key features
- 01Pip-installable Python package for running BGE embedding and reranker models.
- 02Multilingual BGE-M3 model supporting dense, sparse and multi-vector retrieval.
- 03Fine-tuning scripts for embedder and reranker models.
- 04Evaluation tools and a dataset collection for retrieval benchmarks.
- 05Models on Hugging Face covering English, Chinese and multilingual use.
Use cases
- Building semantic search over document collections.
- Adding a retrieval step to a RAG pipeline with a reranker over top-k results.
- Fine-tuning an embedding model on domain-specific query and passage pairs.
- Benchmarking Chinese or multilingual retrieval quality.
Quick start
- 1
Install the package with pip
pip install -U FlagEmbedding - 2
Load a BGE embedding model in Python
- 3
Encode sentences and compute similarity
Things to know
- Fine-tuning requires installing the extra finetune dependencies separately.
Topics
FAQ
- What is FlagEmbedding?
- A retrieval toolkit from BAAI providing BGE embedding and reranker models plus training, evaluation and tutorials for search and RAG. FlagEmbedding (BGE, BAAI General Embedding) is a toolkit for text retrieval and retrieval-augmented LLM applications. It provides a family of embedding models that convert text into vectors for semantic search, along with cross-encoder reranker models that reorder the top results returned by an embedder.
- Is FlagEmbedding free to use? What license does it have?
- FlagEmbedding is open source under the MIT license. Check the license terms before using it in commercial products.
- Is FlagEmbedding still maintained?
- Updated within 6 months. The last commit to FlagEmbedding was on Aug 24, 2026.
- What can I use FlagEmbedding for?
- Building semantic search over document collections. Adding a retrieval step to a RAG pipeline with a reranker over top-k results. Fine-tuning an embedding model on domain-specific query and passage pairs. Benchmarking Chinese or multilingual retrieval quality.
- How do I install FlagEmbedding?
- Install the package with pip: pip install -U FlagEmbedding Load a BGE embedding model in Python Encode sentences and compute similarity
- Where can I get FlagEmbedding?
- The source code and installation instructions are on GitHub: https://github.com/FlagOpen/FlagEmbedding
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
Open-source Python framework for building production-ready LLM applications with modular pipelines and agent workflows for RAG, search and agents.
Self-hosted inference server that serves embedding, reranking, OCR, extraction, safety and LLM models from one cluster through an OpenAI-compatible API.
Open-source RAG engine that pairs retrieval-augmented generation with agent capabilities to provide a context layer for LLM applications.
Local-first AI memory system that stores conversation history verbatim and retrieves it with semantic search, exposed as an MCP server and CLI.
A lightweight knowledge-graph RAG framework and server that indexes documents into entities and relations for retrieval-augmented LLM answers.