Heuristic:FlagOpen FlagEmbedding Warning Deprecated Search Demo
| Knowledge Sources | |
|---|---|
| Domains | Retrieval, Search |
| Last Updated | 2026-02-09 22:00 GMT |
Overview
Deprecation warning: The search demo code in `research/old-examples/search_demo/` is legacy code superseded by the main FlagEmbedding library's inference and evaluation APIs.
Description
The search demo pipeline in `research/old-examples/` was an early prototype demonstrating BM25 + dense retrieval + GPT-based QA. It predates the current FlagEmbedding library architecture and has not been updated to use the modern `FlagAutoModel` / `FlagAutoReranker` APIs. The code remains functional but should not be used as a reference for new implementations.
Usage
Apply this warning when encountering the `research/old-examples/search_demo/` directory. For new search pipelines, use the current FlagEmbedding inference APIs (`FlagAutoModel`, `FlagAutoReranker`) instead.
The Insight (Rule of Thumb)
- Action: Do NOT use `research/old-examples/search_demo/` as a template for new projects.
- Value: Use `FlagEmbedding.FlagAutoModel` and `FlagEmbedding.FlagAutoReranker` instead.
- Trade-off: The old demo has simpler code but lacks multi-GPU support, batching optimizations, and current model compatibility.
Reasoning
The `old-examples/` directory is explicitly a legacy archive. The files `pre_process.py` and `tool.py` implement a complete search pipeline but use outdated model loading patterns (direct `FlagModel` import) and lack the abstraction layer provided by the current framework.