alicloud-ai-search-opensearchUse OpenSearch vector search edition via the Python SDK (ha3engine) to push documents and run HA/SQL searches. Ideal for RAG and vector retrieval pipelines in Claude Code/Codex.
Install via ClawdBot CLI:
clawdbot install cinience/alicloud-ai-search-opensearchCategory: provider
Use the ha3engine SDK to push documents and execute HA/SQL searches. This skill focuses on API/SDK usage only (no console steps).
python3 -m venv .venv
. .venv/bin/activate
python -m pip install alibabacloud-ha3engine
OPENSEARCH_ENDPOINT (API domain)OPENSEARCH_INSTANCE_IDOPENSEARCH_USERNAMEOPENSEARCH_PASSWORDOPENSEARCH_DATASOURCE (data source name)OPENSEARCH_PK_FIELD (primary key field name)import os
from alibabacloud_ha3engine import models, client
from Tea.exceptions import TeaException, RetryError
cfg = models.Config(
endpoint=os.getenv("OPENSEARCH_ENDPOINT"),
instance_id=os.getenv("OPENSEARCH_INSTANCE_ID"),
protocol="http",
access_user_name=os.getenv("OPENSEARCH_USERNAME"),
access_pass_word=os.getenv("OPENSEARCH_PASSWORD"),
)
ha3 = client.Client(cfg)
def push_docs():
data_source = os.getenv("OPENSEARCH_DATASOURCE")
pk_field = os.getenv("OPENSEARCH_PK_FIELD", "id")
documents = [
{"fields": {"id": 1, "title": "hello", "content": "world"}, "cmd": "add"},
{"fields": {"id": 2, "title": "faq", "content": "vector search"}, "cmd": "add"},
]
req = models.PushDocumentsRequestModel({}, documents)
return ha3.push_documents(data_source, pk_field, req)
def search_ha():
# HA query example. Replace cluster/table names as needed.
query_str = (
"config=hit:5,format:json,qrs_chain:search"
"&&query=title:hello"
"&&cluster=general"
)
ha_query = models.SearchQuery(query=query_str)
req = models.SearchRequestModel({}, ha_query)
return ha3.search(req)
try:
print(push_docs().body)
print(search_ha())
except (TeaException, RetryError) as e:
print(e)
python skills/ai/search/alicloud-ai-search-opensearch/scripts/quickstart.py
Environment variables:
OPENSEARCH_ENDPOINTOPENSEARCH_INSTANCE_IDOPENSEARCH_USERNAMEOPENSEARCH_PASSWORDOPENSEARCH_DATASOURCEOPENSEARCH_PK_FIELD (optional, default id)OPENSEARCH_CLUSTER (optional, default general)Optional args: --cluster, --hit, --query.
from alibabacloud_ha3engine import models
sql = "select * from <indexTableName>&&kvpair=trace:INFO;formatType:json"
sql_query = models.SearchQuery(sql=sql)
req = models.SearchRequestModel({}, sql_query)
resp = ha3.search(req)
print(resp)
push_documents for add/delete updates.pk_field alignment.alibabacloud-ha3enginereferences/sources.mdGenerated Mar 1, 2026
Integrate this skill to enable chatbots to retrieve relevant support documents and FAQs from an OpenSearch vector database, providing accurate and context-aware responses. Ideal for handling customer inquiries in real-time by combining keyword and semantic search.
Use the skill to push product data and perform hybrid searches (vector + keyword) for improved product discovery on e-commerce platforms. Enhances user experience by delivering more relevant search results based on descriptions and user queries.
Deploy in legal tech applications to index and search through large volumes of legal documents, cases, and regulations using HA or SQL queries. Supports efficient retrieval for research and compliance checks.
Implement to manage and search multimedia content metadata, such as articles or videos, enabling fast retrieval based on titles, tags, or semantic content. Useful for content recommendation and archival systems.
Apply in healthcare settings to build a searchable knowledge base of medical literature, patient records, or research papers, facilitating quick access to information for professionals via vector and keyword searches.
Offer a cloud-based search service using this skill to provide businesses with scalable vector and hybrid search capabilities. Monetize through subscription tiers based on data volume and query throughput.
Provide consulting services to help enterprises integrate OpenSearch vector search into their existing systems, such as CRM or ERP, for enhanced data retrieval. Charge per project or ongoing support contracts.
Develop analytics tools that leverage this skill to process and search large datasets, offering insights through customizable dashboards and reports. Generate revenue via licensing or usage-based pricing.
đŹ Integration Tip
Ensure all environment variables are correctly set before running scripts to avoid authentication errors, and test with small datasets first to validate schema alignment.
Summarize URLs or files with the summarize CLI (web, PDFs, images, audio, YouTube).
AI-optimized web search via Tavily API. Returns concise, relevant results for AI agents.
This skill should be used when users need to search the web for information, find current content, look up news articles, search for images, or find videos. It uses DuckDuckGo's search API to return results in clean, formatted output (text, markdown, or JSON). Use for research, fact-checking, finding recent information, or gathering web resources.
Web search and content extraction via Brave Search API. Use for searching documentation, facts, or any web content. Lightweight, no browser required.
Search indexed Discord community discussions via Answer Overflow. Find solutions to coding problems, library issues, and community Q&A that only exist in Discord conversations.
Multi search engine integration with 17 engines (8 CN + 9 Global). Supports advanced search operators, time filters, site search, privacy engines, and WolframAlpha knowledge queries. No API keys required.