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

Build search applications and query log analytics data with OpenSearch. Use this skill when the user mentions OpenSearch, search app, index setup, search architecture, semantic search, vector search, hybrid search, BM25, dense vector, sparse vector, agentic search, RAG, embeddings, KNN, PDF ingestion, document processing, or any related search topic. Also use for log analytics and observability — when the user wants to set up log ingestion, query logs with PPL, analyze error patterns, set up index lifecycle policies, investigate traces, or check stack health. Activate even if the user says log analysis, Fluent Bit, Fluentd, Logstash, syslog, traceId, OpenTelemetry, or log analytics without mentioning OpenSearch.

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

Nothing lands on disk. Nothing to clean up.

Fork this Skill

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

cli-reference.md

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

CLI Reference

All commands are run from the skill root directory.

uv run python scripts/opensearch_ops.py <command> [options]

Start OpenSearch

bash scripts/start_opensearch.sh

Check connectivity

uv run python scripts/opensearch_ops.py status

Load sample data

# Built-in IMDB dataset — uses a small bundled sample (20 titles) by
# default, no network call.
uv run python scripts/opensearch_ops.py load-sample --type builtin_imdb

# Same, but fetch a larger sample (up to 100k rows) from IMDb's dataset
# export instead. Downloads from datasets.imdbws.com on first use and
# caches locally (~/.cache/opensearch-agent-skills/sample_data/); tell the
# user this triggers a network download before using this flag.
uv run python scripts/opensearch_ops.py load-sample --type builtin_imdb --allow-download

# From a local file (JSON, JSONL, CSV, TSV, Parquet)
uv run python scripts/opensearch_ops.py load-sample --type local_file --value /path/to/data.json

# From a URL
uv run python scripts/opensearch_ops.py load-sample --type url --value https://example.com/data.json

# From an existing local index
uv run python scripts/opensearch_ops.py load-sample --type localhost_index --value my-index

# From pasted JSON
uv run python scripts/opensearch_ops.py load-sample --type paste --value '{"title": "Example", "description": "A sample doc"}'

Deploy a model

# Local pretrained model (e.g. sentence-transformers)
uv run python scripts/opensearch_ops.py deploy-model --name "huggingface/sentence-transformers/all-mpnet-base-v2"

# Bedrock embedding model
uv run python scripts/opensearch_ops.py deploy-bedrock --name "amazon.titan-embed-text-v2:0"

Create an index

uv run python scripts/opensearch_ops.py create-index --name my-index --body '{"settings": {"index": {"knn": true}}, "mappings": {"properties": {"title": {"type": "text"}, "embedding": {"type": "knn_vector", "dimension": 768, "method": {"engine": "faiss", "name": "hnsw"}}}}}'

Use --replace (default: true) to delete and recreate if the index already exists.

Create and attach a pipeline

# Ingest pipeline
uv run python scripts/opensearch_ops.py create-pipeline --name my-pipeline --index my-index --type ingest --body '{"description": "Embedding pipeline", "processors": [{"text_embedding": {"model_id": "<MODEL_ID>", "field_map": {"title": "embedding"}}}]}'

# Search pipeline
uv run python scripts/opensearch_ops.py create-pipeline --name my-search-pipeline --index my-index --type search --body '{"request_processors": [{"neural_query_enricher": {"default_model_id": "<MODEL_ID>"}}]}'

# Hybrid pipeline with custom weights
uv run python scripts/opensearch_ops.py create-pipeline --name my-hybrid-pipeline --index my-index --type search --hybrid --weights '[0.3, 0.7]' --body '{"phase_results_processors": [{"normalization-processor": {"normalization": {"technique": "min_max"}, "combination": {"technique": "arithmetic_mean", "parameters": {"weights": [0.3, 0.7]}}}}]}'

Index documents

# Single document
uv run python scripts/opensearch_ops.py index-doc --index my-index --id doc1 --doc '{"title": "Example", "description": "A sample document"}'

# Bulk index from file
uv run python scripts/opensearch_ops.py index-bulk --index my-index --source-file /path/to/data.tsv --count 50

Search

# Simple match query
uv run python scripts/opensearch_ops.py search --index my-index --body '{"query": {"match": {"title": "search term"}}}' --size 10

# Neural (semantic) search
uv run python scripts/opensearch_ops.py search --index my-index --body '{"query": {"neural": {"embedding": {"query_text": "find similar documents", "model_id": "<MODEL_ID>", "k": 5}}}}'

# Hybrid search
uv run python scripts/opensearch_ops.py search --index my-index --body '{"query": {"hybrid": {"queries": [{"match": {"title": "search term"}}, {"neural": {"embedding": {"query_text": "search term", "model_id": "<MODEL_ID>", "k": 5}}}]}}}'

Launch Search Builder UI

uv run python scripts/opensearch_ops.py launch-ui --index my-index

Launch Comparison View

After evaluation and restart, compare the baseline and improved indices side by side:

uv run python scripts/opensearch_ops.py compare-ui \
  --baseline my-index-v1 \
  --improved my-index-v2

Connect UI to remote endpoint

# Amazon OpenSearch Service
uv run python scripts/opensearch_ops.py connect-ui --endpoint search-my-domain.us-east-1.es.amazonaws.com --aws-region us-east-1 --aws-service es --index my-index

# Amazon OpenSearch Serverless
uv run python scripts/opensearch_ops.py connect-ui --endpoint abc123.us-east-1.aoss.amazonaws.com --aws-region us-east-1 --aws-service aoss --index my-index

# Basic auth
uv run python scripts/opensearch_ops.py connect-ui --endpoint my-opensearch.example.com --port 443 --username admin --password admin --index my-index

Agentic search setup

# 1. Deploy Bedrock Claude model for agent reasoning
# Method A: Using environment variables (recommended for manual use)
export AWS_ACCESS_KEY_ID="your-access-key"
export AWS_SECRET_ACCESS_KEY="your-secret-key"
export AWS_REGION="us-east-1"
uv run python scripts/opensearch_ops.py deploy-agentic-model --region us-east-1

# Method B: Passing credentials as arguments (for automation, delete from chat history after use)
uv run python scripts/opensearch_ops.py deploy-agentic-model \
  --access-key "your-access-key" \
  --secret-key "your-secret-key" \
  --region us-east-1

# 2a. For stateless searches (REST APIs, search apps):
# Create a flow agent
# For sparse (rank_features): add --sparse --embedding-model-id <SPARSE_TOKENIZER_ID> --index my-index
uv run python scripts/opensearch_ops.py create-flow-agent --name my-flow-agent --model-id <CONNECTOR_MODEL_ID>
# Create flow agent pipeline
# For sparse: add --sparse --agentic-model-id <LLM_MODEL_ID> (stores in _meta, no search pipeline needed)
uv run python scripts/opensearch_ops.py create-flow-agentic-pipeline --name my-flow-pipeline --agent-id <AGENT_ID> --index my-index


# 2b. For multi-turn conversations (chatbots):
# Create a conversational agent
uv run python scripts/opensearch_ops.py create-conversational-agent --name my-conv-agent --model-id <CONNECTOR_MODEL_ID>
# Deploy a separate RAG model (uses /invoke API, different from agent's /converse API)
uv run python scripts/opensearch_ops.py deploy-rag-model --region us-east-1
# Create conversational agent pipeline with RAG
uv run python scripts/opensearch_ops.py create-conversational-agent-pipeline --name my-conv-pipeline --agent-id <AGENT_ID> --index my-index --model-id <RAG_MODEL_ID>

Read knowledge base files

uv run python scripts/opensearch_ops.py read-knowledge --file dense_vector_models.md
uv run python scripts/opensearch_ops.py read-knowledge --file sparse_vector_models.md
uv run python scripts/opensearch_ops.py read-knowledge --file opensearch_semantic_search_guide.md
uv run python scripts/opensearch_ops.py read-knowledge --file agentic_search_guide.md
uv run python scripts/opensearch_ops.py read-knowledge --file evaluation_guide.md

Cleanup

uv run python scripts/opensearch_ops.py cleanup

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 alert3d4 checks · Risk SAFE
  • Gen Agent Trust Hub5d

    The skill provides a comprehensive set of tools for OpenSearch development, including data ingestion, deployment to AWS/Aiven, and observability analytics. It implements robust security measures such as SSRF protection for remote data loading. Potential security considerations include the ingestion of unstructured data (Indirect Prompt Injection surface) and the transmission of feedback to a third-party domain.

  • Socket3d

    5 alerts: gptSecurity, gptAnomaly

  • Snyk5d

    Risk: CRITICAL · 3 issues

  • ZeroLeaks7mo

    Score: 93/100 · 2 sections analyzed

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 6 days ago
compatibility
Requires Docker and uv. AWS deployment requires AWS credentials.
metadata
{
  "author": "opensearch-project",
  "version": "2.0"
}

README badge

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