Favicon of FlagEmbedding

FlagEmbedding

A Python toolkit runs BGE embedding models and multilingual rerankers for semantic search and RAG, with model fine-tuning under an MIT license.

Screenshot of FlagEmbedding website

FlagEmbedding is a Python toolkit for developers building semantic search and retrieval-augmented generation (RAG). It runs embedding models to find relevant text and rerankers to refine the order of retrieved results.

  • Text embeddings: Convert sentences into representations that applications can compare by meaning rather than exact word matches.
  • Multilingual retrieval: BAAI/bge-m3 supports dense, sparse and ColBERT-style multi-vector search, with support for long text inputs.
  • Task-specific embeddings: BAAI/bge-en-icl accepts instructions and example pairs for English tasks, while BAAI/bge-multilingual-gemma2 supports multilingual tasks.
  • Reranking: Multilingual BGE rerankers score query-document relevance, and the MiniCPM-based layerwise model lets developers select output layers to reduce inference work.
  • Fine-tuning: Adapt supported models with the toolkit's training functionality rather than relying solely on their pretrained behavior.

The open-source library uses the MIT license. It loads models through Python for inference within your application.

Similar to FlagEmbedding