[DOC] Add Bedrock Cohere Rerank v3.5 connector blueprint#4832
[DOC] Add Bedrock Cohere Rerank v3.5 connector blueprint#4832gauravSsinha wants to merge 2 commits into
Conversation
Add a new connector blueprint for the Cohere Rerank v3.5 model on Amazon Bedrock. This enables OpenSearch users to leverage Bedrock's reranking capabilities for improving search relevance in RAG pipelines. The blueprint includes: - Self-managed OpenSearch configuration with AWS credentials - AWS OpenSearch Service configuration with IAM role - Built-in pre/post processing functions (connector.pre_process.cohere.rerank and connector.post_process.cohere.rerank) for OpenSearch 2.19+ - Custom Painless scripts for earlier OpenSearch versions - Model registration, deployment, and inference testing - Integration with OpenSearch reranking search pipeline - query_text_path usage to avoid duplicate query specification Resolves opensearch-project#4831 Related: opensearch-project#3254, opensearch-project#3396 Signed-off-by: Gaurav Kumar Sinha <gaurav@substrai.dev>
PR Reviewer Guide 🔍(Review updated until commit 6050fa7)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to 6050fa7
Previous suggestionsSuggestions up to commit 1a5618e
|
…less script - Hardcode api_version as 2 in request_body instead of using parameter substitution, since the value is fixed for this model - Add .replace() calls in pre_process_function to escape backslashes and double quotes in query_text and text_docs, preventing malformed JSON when documents contain special characters - Add security note recommending IAM roles or Secrets Manager over hardcoded credentials Signed-off-by: Gaurav Kumar Sinha <gaurav@substrai.dev>
|
Persistent review updated to latest commit 6050fa7 |
Description
Adds a connector blueprint for the Cohere Rerank v3.5 model on Amazon Bedrock (
cohere.rerank-v3-5:0). This blueprint was missing fromdocs/remote_inference_blueprints/despite the built-in pre/post processing functions being implemented in #3254.Issues Resolved
Resolves #4831
Related: #3254, #3396
Changes Made
Added
docs/remote_inference_blueprints/bedrock_connector_cohere_rerank_blueprint.mdcovering:connector.pre_process.cohere.rerankandconnector.post_process.cohere.rerank) for OpenSearch 2.19+query_text_pathusage to avoid duplicate query specificationContext
The Cohere Rerank model on Bedrock is widely used for improving RAG pipeline relevance. The built-in pre/post processing functions were added in #3254 (closed Jan 2025), but no corresponding blueprint documentation was created. This PR fills that gap, following the same structure as existing blueprints (e.g.,
bedrock_connector_cohere_cohere.embed-english-v3_blueprint.md,bedrock_connector_titan_embedding_blueprint.md).Testing
MLPreProcessFunction.javaandMLPostProcessFunction.javaChecklist