Index of every page on this site: llms.txt
All skills
Run it yourself

Deploy OpenSearch search applications to Amazon OpenSearch Service or Amazon OpenSearch Serverless. Use this skill when the user wants to provision an OpenSearch domain or serverless collection on AWS, deploy search configurations to AWS, set up Bedrock connectors, configure IAM roles for OpenSearch, migrate a local search setup to AWS, or manage Amazon OpenSearch infrastructure. Activate even if the user says AOS, AOSS, OpenSearch Service, serverless collection, Bedrock connector, SigV4, or AWS deployment without mentioning search.

Use this Skill: https://skilld.dev/gh/opensearch-project/opensearch-agent-skills/aws-setup

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

aosdomain-03-agentic-setup.md

≈1.4k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Amazon OpenSearch Service Domain — Step 3: Configure Agentic Search

This guide configures conversational agents with QueryPlanningTool for natural language search. Only follow this for agentic search strategy.

Agentic search requires OpenSearch 3.3 on a managed AOS domain and uses Bedrock Claude as the reasoning model.

State Input

From .opensearch-deploy-state.json:

  • resource_endpoint: domain endpoint URL
  • index_name: target index
  • aws_region: for Bedrock endpoint
  • aws_account_id: for IAM role ARN

Step 1: Create IAM Role for Bedrock Access

POST /iam/CreateRole
{
  "RoleName": "opensearch-bedrock-agent-role",
  "AssumeRolePolicyDocument": {
    "Version": "2012-10-17",
    "Statement": [{
      "Effect": "Allow",
      "Principal": { "Service": "opensearchservice.amazonaws.com" },
      "Action": "sts:AssumeRole"
    }]
  }
}

Attach Bedrock invoke permissions:

POST /iam/PutRolePolicy
{
  "RoleName": "opensearch-bedrock-agent-role",
  "PolicyName": "BedrockClaudeInvokePolicy",
  "PolicyDocument": {
    "Version": "2012-10-17",
    "Statement": [{
      "Effect": "Allow",
      "Action": "bedrock:InvokeModel",
      "Resource": "arn:aws:bedrock:*::foundation-model/anthropic.claude-3-5-sonnet-*"
    }]
  }
}

Update state: "iam_role_arn": "<role-arn>"

Step 2: Map ML Role (if fine-grained access control enabled)

  1. Log in to OpenSearch Dashboards
  2. Navigate to Security > Roles > ml_full_access
  3. Mapped users > Manage mapping
  4. Add IAM role ARN under Backend roles: arn:aws:iam::<aws_account_id>:role/opensearch-bedrock-agent-role
  5. Click Map

Step 3: Create Bedrock Claude Connector

POST <domain-endpoint>/_plugins/_ml/connectors/_create
{
  "name": "Amazon Bedrock Claude 3.5 Sonnet",
  "description": "Connector for Bedrock Claude for agentic search",
  "version": 1,
  "protocol": "aws_sigv4",
  "credential": { "roleArn": "<iam_role_arn>" },
  "parameters": {
    "region": "<aws_region>",
    "service_name": "bedrock",
    "model": "anthropic.claude-3-5-sonnet-20240620-v1:0",
    "system_prompt": "You are a helpful assistant that plans and executes search queries.",
    "temperature": 0.0,
    "top_p": 0.9,
    "max_tokens": 2000
  },
  "actions": [{
    "action_type": "predict",
    "method": "POST",
    "headers": { "content-type": "application/json" },
    "url": "https://bedrock-runtime.${parameters.region}.amazonaws.com/model/${parameters.model}/converse",
    "request_body": "{ \"system\": [{\"text\": \"${parameters.system_prompt}\"}], \"messages\": ${parameters.messages}, \"inferenceConfig\": {\"temperature\": ${parameters.temperature}, \"topP\": ${parameters.top_p}, \"maxTokens\": ${parameters.max_tokens}} }"
  }]
}

Update state: "connector_id": "<connector_id>"

Step 4: Register and Deploy Model

POST <domain-endpoint>/_plugins/_ml/models/_register?deploy=true
{
  "name": "Bedrock Claude 3.5 Sonnet for Agentic Search",
  "function_name": "remote",
  "description": "Claude model for query planning and reasoning",
  "connector_id": "<connector_id>"
}

Test the model:

POST <domain-endpoint>/_plugins/_ml/models/<model-id>/_predict
{
  "parameters": {
    "messages": [{ "role": "user", "content": [{ "text": "hello" }] }]
  }
}

Verify the response contains generated text.

Update state: "model_id": "<model_id>"

Step 5: Create Conversational Agent

POST <domain-endpoint>/_plugins/_ml/agents/_register
{
  "name": "Agentic Search Agent",
  "type": "conversational",
  "description": "Agent for natural language search with query planning",
  "llm": {
    "model_id": "<model_id>",
    "parameters": { "max_iteration": 15 }
  },
  "memory": { "type": "conversation_index" },
  "parameters": { "_llm_interface": "bedrock/converse" },
  "tools": [{ "type": "QueryPlanningTool" }],
  "app_type": "os_chat"
}

Update state: "agent_id": "<agent_id>"

Step 6: Create Agentic Search Pipeline

PUT <domain-endpoint>/_search/pipeline/agentic-search-pipeline
{
  "request_processors": [{
    "agentic_query_translator": { "agent_id": "<agent_id>" }
  }]
}

Update state: "search_pipeline_name": "agentic-search-pipeline"

Step 7: Test Agentic Search

GET <domain-endpoint>/<index-name>/_search?search_pipeline=agentic-search-pipeline
{
  "query": {
    "agentic": {
      "query_text": "Find all documents about machine learning published in the last year",
      "query_fields": ["title", "content", "publish_date"]
    }
  }
}

The agent will:

  1. Analyze the natural language question
  2. Examine the index mapping
  3. Generate appropriate OpenSearch DSL query
  4. Execute the query and return results

State Output

Final .opensearch-deploy-state.json:

{
  "step_completed": "agentic-setup",
  "iam_role_arn": "<role-arn>",
  "connector_id": "<connector-id>",
  "model_id": "<model-id>",
  "agent_id": "<agent-id>",
  "search_pipeline_name": "agentic-search-pipeline"
}

Connect Search UI to AWS Endpoint

After agentic setup is complete, switch the local Search Builder UI to query the AWS domain:

Call connect_search_ui_to_endpoint(
  endpoint="<domain-endpoint>",
  port=443,
  use_ssl=true,
  username="<master-user>",
  password="<master-password>",
  index_name="<index-name>"
)

The UI header badge will change from "Local" to "AWS Cloud" with a green connection indicator.

Provide Access Information

Give the user:

  • Domain endpoint URL
  • Domain ARN
  • OpenSearch Dashboards URL
  • Master user credentials (securely)
  • Sample agentic search queries
  • Search Builder UI URL (already connected to AWS endpoint)
  • Agent ID for direct agent invocation

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

1 warning1mo3 checks · Risk SAFE
  • Gen Agent Trust Hub1mo

    This skill provides comprehensive automation for deploying Amazon OpenSearch Service and Serverless infrastructure on AWS. It uses standard AWS CLI commands for provisioning and fetches specialized MCP servers from trusted organizations and well-known service domains. The skill follows security best practices such as mandatory credential verification and explicit IAM role configurations.

  • Socket1mo

    1 alert: gptAnomaly

  • Snyk1mo

    Risk: LOW · No issues

Signed by skilld at c4f7b1e. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 4 days ago.

Activeupdated 4 months ago
metadata
{
  "author": "opensearch-project",
  "version": "2.0"
}
Other metadata
compatibility
Requires AWS credentials (IAM role or access keys), awslabs.aws-api-mcp-server, and opensearch-mcp-server. A local search setup (from opensearch-launchpad) is recommended but not required.

README badge

README badge for opensearch-project/opensearch-agent-skills/aws-setup