Cosmos DB Hybrid Search Tool icon

Cosmos DB Hybrid Search Tool

Hybrid vector + full-text search on Azure Cosmos DB for AI Agent workflows

Cosmos DB Hybrid Search Tool

AI-generated

Summary

Searches an Azure Cosmos DB container with hybrid full-text and vector ranking, then returns the matching documents to the workflow or AI Agent. It requires an Embeddings connection; optionally connect a Reranker to reorder retrieved results.

Inputs

  • Authentication Type — Choose Master Key or Microsoft Entra ID authentication. A custom endpoint and access token in Options override the selected credentials when both are provided.
  • Database Name or ID (required) — Cosmos DB database to search.
  • Container Name or ID (required) — Container within the selected database.
  • Vector Field Name (required) — Document field containing vector embeddings; defaults to vector.
  • Full Text Field Name (required) — Document field used for full-text scoring; defaults to text.
  • Vector Query — Semantic query to embed. Set to Determine by AI model to let the AI Agent provide it.
  • Full Text Query — Keywords for full-text ranking. Set to Determine by AI model to let the AI Agent provide them. If empty, the vector query is used.
  • Top K — Maximum number of results to retrieve; defaults to 10. An AI-provided value is used only when this field is set to Determine by AI model.
  • Use Reranker — When enabled, adds an optional Reranker connection to reorder retrieved documents using the vector query.
  • Fields to Exclude — Comma-separated document fields to remove from results; defaults to vector,text.
  • Options — Optional SQL filter conditions, partition-key field and value, selected return fields, debug information, output simplification, or custom endpoint and access token. Fields to return, filters, and partition key values can be set to Determine by AI model for agent input.
  • Embeddings (required) — Connect an Embeddings model used to embed the vector query.
  • Reranker — Optional Reranker connection, available when Use Reranker is enabled.

Output shape

An AI Tool connection for use by an AI Agent; when executed directly, a list of items containing matched documents, or a message/error item.

The tool returns a JSON string containing the result array, or an object with results and debug when Include Debug Info is enabled. Direct execution returns one item per result; with debug enabled, debug details are added to the first item. No matches produce a message item. Cosmos internal metadata fields are stripped by default, and configured excluded fields are removed. Both query strings may be empty at configuration time, but execution needs at least one query; the vector query is embedded even when only a full-text query is supplied.

Links

Discussion