Meet YOLO26: next-gen vision AI.
Ultralytics
Back to Ultralytics Glossary

Hybrid Search

Explore how hybrid search merges keyword matching and semantic AI. Learn to build context-aware search pipelines using metadata from Ultralytics YOLO26.

Combining the precision of traditional keyword matching with the contextual understanding of modern AI, this search methodology retrieves and ranks information by leveraging both sparse and dense data representations. While a standard search engine relies entirely on exact keyword matches (known as lexical search) and vector search engines rely purely on semantic similarity, a hybrid search engine merges these two approaches to deliver highly accurate and context-aware results.

How It Works

A typical hybrid search pipeline executes two distinct retrieval methods simultaneously, fusing their outputs into a single, optimized ranking:

  • Lexical (Sparse) Search: Uses algorithms like BM25 to score exact keyword matches based on term frequency. This is crucial for retrieving specific entities, acronyms, product SKUs, or specialized jargon that a purely semantic model might struggle to identify.
  • Semantic (Dense) Search: Generates high-dimensional arrays of numbers using AI models to understand the deeper meaning and context of a query. This allows the system to find relevant results even if the exact words are missing from the search query.

Once both methods retrieve their candidate results, a fusion algorithm—most commonly Reciprocal Rank Fusion (RRF)—combines the lists. RRF calculates a new score based on the rank of each item in the respective sparse and dense result sets. This ensures that documents ranking high in either or both searches bubble to the top, balancing broad contextual matches with pinpoint keyword accuracy.

Real-World AI and ML Applications

Modern AI architectures heavily rely on this technique to overcome the limitations of using a single retrieval method in production environments.

Today, almost every major vector database—including Pinecone, Qdrant, OpenSearch, and PostgreSQL via pgvector—supports hybrid search natively. This allows developers to index both sparse keywords and dense vectors efficiently in a single infrastructure.

In computer vision pipelines, you can extract meaningful keywords from images to build the sparse component of a hybrid index. Using Ultralytics YOLO26, you can automatically perform object detection on an image and use those class names as metadata tags. These keyword tags can then be paired with the image's dense vector embeddings for comprehensive indexing.

from ultralytics import YOLO

# Load the recommended Ultralytics YOLO26 object detection model
model = YOLO("yolo26n.pt")

# Run inference to detect objects in an image
results = model("store_aisle.jpg")

# Extract predicted class names to be indexed as keyword metadata (sparse data)
keywords = [model.names[int(box.cls)] for box in results[0].boxes]
print("Sparse keywords for lexical search:", keywords)

By enriching dense image embeddings with precise, AI-generated sparse keywords, developers can leverage the Ultralytics Platform and hybrid-compatible vector databases to build robust, multimodal search engines that perfectly understand both the explicit textual tags and the implicit visual context of their data.

Explore solutions

Real-time AI tailored to your operation

AI in Agriculture

Bring vision AI to smart agriculture with Ultralytics YOLO models. Power crop monitoring, livestock tracking, and precision farming for higher, smarter yields.

Learn more
Real-time AI that works with your operation

AI in Automotive

Apply computer vision in automotive with Ultralytics YOLO models. Vision AI elevates road safety, driver assistance, and vehicle automation for smarter roads.

Learn more
Real-time AI that works with your team

AI in Healthcare

Build healthcare solutions with Ultralytics YOLO models. Vision AI in healthcare powers faster medical imaging, smarter diagnostics, and patient monitoring.

Learn more
Real-time AI that works with your team

AI in Retail

Reimagine retail with Ultralytics YOLO models. Vision AI powers inventory tracking, shelf monitoring, queue management, and smarter customer insights.

Learn more
Real-time AI that works with your team

AI in Robotics

Power smarter machines with Ultralytics YOLO models. Vision AI in robotics drives autonomous navigation, perception, object tracking, and real-time control.

Learn more
Real-time AI that works with your team

AI in Manufacturing

Optimize manufacturing with Ultralytics YOLO models. Vision AI drives quality control, defect detection, PPE compliance, and assembly line automation.

Learn more
Real-time AI that works with your team

AI in Logistics

Streamline logistics with Ultralytics YOLO models. Vision AI enables package inspection, sorting, vehicle tracking, and real-time warehouse safety monitoring.

Learn more
Real-time AI tailored to your operation

AI in Agriculture

Bring vision AI to smart agriculture with Ultralytics YOLO models. Power crop monitoring, livestock tracking, and precision farming for higher, smarter yields.

Learn more
Real-time AI that works with your operation

AI in Automotive

Apply computer vision in automotive with Ultralytics YOLO models. Vision AI elevates road safety, driver assistance, and vehicle automation for smarter roads.

Learn more
Real-time AI that works with your team

AI in Healthcare

Build healthcare solutions with Ultralytics YOLO models. Vision AI in healthcare powers faster medical imaging, smarter diagnostics, and patient monitoring.

Learn more
Real-time AI that works with your team

AI in Retail

Reimagine retail with Ultralytics YOLO models. Vision AI powers inventory tracking, shelf monitoring, queue management, and smarter customer insights.

Learn more
Real-time AI that works with your team

AI in Robotics

Power smarter machines with Ultralytics YOLO models. Vision AI in robotics drives autonomous navigation, perception, object tracking, and real-time control.

Learn more
Real-time AI that works with your team

AI in Manufacturing

Optimize manufacturing with Ultralytics YOLO models. Vision AI drives quality control, defect detection, PPE compliance, and assembly line automation.

Learn more
Real-time AI that works with your team

AI in Logistics

Streamline logistics with Ultralytics YOLO models. Vision AI enables package inspection, sorting, vehicle tracking, and real-time warehouse safety monitoring.

Learn more
Real-time AI tailored to your operation

AI in Agriculture

Bring vision AI to smart agriculture with Ultralytics YOLO models. Power crop monitoring, livestock tracking, and precision farming for higher, smarter yields.

Learn more
Real-time AI that works with your operation

AI in Automotive

Apply computer vision in automotive with Ultralytics YOLO models. Vision AI elevates road safety, driver assistance, and vehicle automation for smarter roads.

Learn more
Real-time AI that works with your team

AI in Healthcare

Build healthcare solutions with Ultralytics YOLO models. Vision AI in healthcare powers faster medical imaging, smarter diagnostics, and patient monitoring.

Learn more
Real-time AI that works with your team

AI in Retail

Reimagine retail with Ultralytics YOLO models. Vision AI powers inventory tracking, shelf monitoring, queue management, and smarter customer insights.

Learn more
Real-time AI that works with your team

AI in Robotics

Power smarter machines with Ultralytics YOLO models. Vision AI in robotics drives autonomous navigation, perception, object tracking, and real-time control.

Learn more
Real-time AI that works with your team

AI in Manufacturing

Optimize manufacturing with Ultralytics YOLO models. Vision AI drives quality control, defect detection, PPE compliance, and assembly line automation.

Learn more
Real-time AI that works with your team

AI in Logistics

Streamline logistics with Ultralytics YOLO models. Vision AI enables package inspection, sorting, vehicle tracking, and real-time warehouse safety monitoring.

Learn more

Let's build the future of AI together!

Begin your journey with the future of machine learning