Aliyun Opensearch Search
cinience/alicloud-skills
A skill your agent uses when working with OpenSearch vector search edition via the Python SDK (ha3engine) to push documents and run HA/SQL searches.
Optimize accuracy for RAG (Retrieval-Augmented Generation) systems.
$ npx skills add LeoYeAI/openclaw-master-skills --skill rag-accuracy-optimizer -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install LeoYeAI/openclaw-master-skills rag-accuracy-optimizer --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/LeoYeAI/openclaw-master-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/rag-accuracy-optimizer .claude/skills/rag-accuracy-optimizer && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "rag-accuracy-optimizer" agent skill from https://github.com/LeoYeAI/openclaw-master-skills/tree/main/skills/rag-accuracy-optimizer into .claude/skills/rag-accuracy-optimizer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "rag-accuracy-optimizer", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/LeoYeAI/openclaw-master-skills/tree/main/skills/rag-accuracy-optimizerType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add LeoYeAI/openclaw-master-skills --skill rag-accuracy-optimizer -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install LeoYeAI/openclaw-master-skills rag-accuracy-optimizer --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/LeoYeAI/openclaw-master-skills.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/rag-accuracy-optimizer .agents/skills/rag-accuracy-optimizer && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "rag-accuracy-optimizer" agent skill from https://github.com/LeoYeAI/openclaw-master-skills/tree/main/skills/rag-accuracy-optimizer into .agents/skills/rag-accuracy-optimizer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "rag-accuracy-optimizer", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add LeoYeAI/openclaw-master-skills --skill rag-accuracy-optimizer -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install LeoYeAI/openclaw-master-skills rag-accuracy-optimizer --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/LeoYeAI/openclaw-master-skills.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/rag-accuracy-optimizer .cursor/skills/rag-accuracy-optimizer && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "rag-accuracy-optimizer" agent skill from https://github.com/LeoYeAI/openclaw-master-skills/tree/main/skills/rag-accuracy-optimizer into .cursor/skills/rag-accuracy-optimizer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "rag-accuracy-optimizer", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/LeoYeAI/openclaw-master-skills.git --path skills/rag-accuracy-optimizer--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add LeoYeAI/openclaw-master-skills --skill rag-accuracy-optimizer -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install LeoYeAI/openclaw-master-skills rag-accuracy-optimizer --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/LeoYeAI/openclaw-master-skills.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/rag-accuracy-optimizer .gemini/skills/rag-accuracy-optimizer && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "rag-accuracy-optimizer" agent skill from https://github.com/LeoYeAI/openclaw-master-skills/tree/main/skills/rag-accuracy-optimizer into .gemini/skills/rag-accuracy-optimizer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "rag-accuracy-optimizer", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install LeoYeAI/openclaw-master-skills rag-accuracy-optimizerInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add LeoYeAI/openclaw-master-skills --skill rag-accuracy-optimizer -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/LeoYeAI/openclaw-master-skills.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/rag-accuracy-optimizer .github/skills/rag-accuracy-optimizer && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "rag-accuracy-optimizer" agent skill from https://github.com/LeoYeAI/openclaw-master-skills/tree/main/skills/rag-accuracy-optimizer into .github/skills/rag-accuracy-optimizer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "rag-accuracy-optimizer", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add LeoYeAI/openclaw-master-skills --skill rag-accuracy-optimizer -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install LeoYeAI/openclaw-master-skills rag-accuracy-optimizer --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/LeoYeAI/openclaw-master-skills.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/rag-accuracy-optimizer .opencode/skills/rag-accuracy-optimizer && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "rag-accuracy-optimizer" agent skill from https://github.com/LeoYeAI/openclaw-master-skills/tree/main/skills/rag-accuracy-optimizer into .opencode/skills/rag-accuracy-optimizer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "rag-accuracy-optimizer", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
rag-accuracy-optimizerOptimize accuracy for RAG (Retrieval-Augmented Generation) systems.
RAG Accuracy Optimizer is an agent skill from LeoYeAI/openclaw-master-skills. Optimize accuracy for RAG (Retrieval-Augmented Generation) systems. Covers: DB schema design, chunking strategies, retrieval optimization, accuracy testing, and anti-hallucination safeguards. Use when: (1) designing or improving a RAG pipeline, (2) choosing the right chunking strategy, (3) optimizing retrieval accuracy (hybrid search, reranking, multi-query), (4) evaluating chunk quality or testing accuracy, (5) setting up monitoring & safeguards for RAG production, (6) choosing SQL vs Vector DB, (7) designing…
Its SKILL.md is about 5.5k tokens, which your agent loads only when the skill is triggered. The skill folder holds 15 other files, including scripts and reference files (for example `_meta.json`, `references/advanced-rag.md` and `references/chunking-patterns.md`).
It sits in AI & LLM Engineering, covering Retrieval-augmented generation. It works with SQL. The repository describes itself as: 🧠 Curated collection of 1209+ best OpenClaw skills — weekly updated by MyClaw.ai. The licence is MIT.
11 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit e5199b5. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Ships 4 files in scripts/ (Python), which the agent can run.
Shell commands in SKILL.md call:
python3pipjustFrom the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md. Its commands use pip, which can reach the network depending on how they are called.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
RAG Accuracy Optimizer loads about 5.5k tokens when it runs, and up to ~34k if it reads all its reference files. Until then it costs about 157 tokens; SKILL.md has 1,520 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.
The full file from LeoYeAI/openclaw-master-skills at commit e5199b5, republished under its MIT licence (© LeoYeAI). 1,520 words, ~5,456 tokens.
.claude/skills/rag-accuracy-optimizer/SKILL.md (or your agent's skills folder). This skill also uses 13 other files; get the full folder from GitHub.A skill for optimizing end-to-end accuracy in RAG systems.
Data Design → Chunking → Indexing → Retrieval → Generation → Testing → MonitoringEach step impacts accuracy. Optimize each step in order.
| Criteria | SQL (PostgreSQL, MySQL) | Vector DB (Pinecone, Qdrant, Weaviate) |
|---|---|---|
| Exact facts (price, date, product code) | ✅ Optimal | ❌ Not suitable |
| Semantic search (query meaning) | ❌ Not supported | ✅ Optimal |
| Aggregation (SUM, COUNT, AVG) | ✅ Native | ❌ Not supported |
| Fuzzy matching ("similar to...") | ⚠️ Limited | ✅ Optimal |
| Hybrid (recommended) | pgvector for both | Vector DB + SQL metadata store |
Principle: Clearly structured data → SQL. Unstructured data requiring semantic understanding → Vector DB. Most production systems need both.
Insurance:
policies(policy_id, product_type, effective_date)
clauses(clause_id, policy_id, clause_number, title, content)
exclusions(exclusion_id, clause_id, description)
-- Vector: embedding for clause.content + exclusion.descriptionFinance:
securities(ticker, name, sector, exchange)
reports(report_id, ticker, period, report_type)
sections(section_id, report_id, heading, content)
-- Vector: embedding for section.content, metadata: ticker + periodHealthcare:
drugs(drug_id, generic_name, brand_name, category)
guidelines(guideline_id, condition, recommendation, evidence_level)
interactions(drug_a_id, drug_b_id, severity, description)
-- Vector: embedding for guidelines.recommendationE-commerce:
products(product_id, name, category, brand, price)
reviews(review_id, product_id, rating, content)
specs(product_id, attribute, value)
-- Vector: embedding for review.content + product descriptionEach chunk/document needs at minimum:
metadata = {
"source": "policy_doc_v2.pdf", # Origin
"source_type": "pdf", # File type
"domain": "insurance", # Domain
"category": "life_insurance", # Classification
"entity_id": "POL-2024-001", # Related entity ID
"section": "exclusions", # Section in doc
"chunk_index": 3, # Chunk position
"total_chunks": 12, # Total chunks in doc
"created_at": "2024-01-15", # Creation date
"version": "2.0", # Version
"language": "en" # Language
}Metadata principles:
source for traceability and citationentity_id enables pre-filtering before search → reduces noisechunk_index + total_chunks enables fetching surrounding context| Normalized | Denormalized | |
|---|---|---|
| Pros | Less duplication, easy to update | Faster queries, fewer JOINs |
| Cons | Requires JOINs, slower | Duplication, harder to sync |
| Use when | Source of truth (SQL) | Vector store chunks |
Recommendation: Normalized for SQL source → Denormalized when creating chunks for Vector DB. Each chunk should contain sufficient context, no JOINs needed at retrieval time.
Detailed code examples: read
references/chunking-patterns.md
Data has clear structure (clauses, sections)?
→ Semantic chunking (by heading/section)
Long, continuous data (articles, transcripts)?
→ Fixed size + overlap (512 tokens, 10-20% overlap)
Need both overview + detail?
→ Hierarchical chunking (parent-child)
Domain-specific with its own logical units?
→ Domain-specific chunking| Size | Use case | Trade-off |
|---|---|---|
| 128-256 tokens | FAQ, short definitions | High precision, less context |
| 256-512 tokens | Recommended default | Good balance |
| 512-1024 tokens | Complex text, legal docs | More context, potential noise |
| >1024 tokens | Rarely used | Too much noise |
Split by meaning (section, topic) instead of fixed size:
# Split by markdown headings
# Split by paragraph breaks (\n\n)
# Split by topic change (using NLP or LLM detection)Document (summary)
└── Section (heading + key points)
└── Paragraph (details)parent_id in metadataEach chunk should be enriched with:
Detailed code examples: read
references/retrieval-patterns.md
User Query
→ Query Rewriting (expand/reformulate)
→ Multi-Query Generation (3-5 variants)
→ Metadata Filtering (narrow scope)
→ Hybrid Search (Vector + BM25)
→ Merge & Deduplicate
→ Reranking (top 20 → top 5)
→ Contextual Compression
→ LLM Generation (with citations)final_score = α × vector_score + (1-α) × bm25_score
# α = 0.7 is a good starting point, tune per domainUse LLM to reformulate the user question for clarity:
User: "does insurance pay?"
→ Rewritten: "Under what circumstances does life insurance pay out benefits?"From 1 question, generate 3-5 variants → search each variant → merge results:
Original: "Which bank has the highest savings rate?"
Query 1: "Compare savings interest rates across banks 2024"
Query 2: "Bank with highest deposit rate currently"
Query 3: "Top banks with best deposit interest rates"After retrieval, use a reranking model to re-sort by relevance:
Retrieve top 20 → rerank → take top 3-5 for generation.
After reranking, compress each chunk: keep only the part relevant to the question.
Original chunk (500 tokens) → Compressed (150 tokens, relevant part only)Reduces noise, saves context window, improves accuracy.
Narrow the search space BEFORE vector search:
# Instead of searching all 1M chunks:
filter = {"domain": "insurance", "product_type": "life"}
# Only search within ~50K relevant chunks
results = vector_db.search(query, filter=filter, top_k=20)Create ground truth Q&A pairs:
{
"test_cases": [
{
"question": "Does life insurance pay out for suicide?",
"expected_answer": "No payout within the first 2 years",
"expected_source": "clause_15_exclusions.pdf",
"category": "exclusions",
"difficulty": "medium"
}
]
}Recommendation: Minimum 50-100 test cases, evenly distributed across categories and difficulty levels.
| Metric | Meaning | Target |
|---|---|---|
| Precision@K | % relevant results in top K | >0.8 |
| Recall@K | % ground truth found in top K | >0.9 |
| F1 | Harmonic mean of Precision and Recall | >0.85 |
| MRR | Mean Reciprocal Rank — average position of first correct result | >0.8 |
| NDCG | Normalized Discounted Cumulative Gain — ranking quality | >0.85 |
| Answer Accuracy | % correct answers (human eval or LLM judge) | >0.9 |
Compare strategies by running the same test suite:
Config A: chunk_size=256, overlap=10%, no_rerank
Config B: chunk_size=512, overlap=20%, cohere_rerank
→ Compare MRR, NDCG, Answer Accuracy
→ Choose the config with better metricsClassify errors to know where to optimize:
| Error Type | Cause | Solution |
|---|---|---|
| Retrieval Miss | Correct chunk not found | Improve chunking, add hypothetical Q |
| Ranking Error | Correct chunk found but ranked low | Add reranking |
| Generation Error | Correct chunk but LLM answers wrong | Improve prompt, add few-shot |
| No Answer | Information not in DB | Expand knowledge base |
| Hallucination | LLM fabricates information | Add citation enforcement |
Log each query:
log_entry = {
"timestamp": "2024-01-15T10:30:00",
"query": "...",
"retrieved_chunks": [...],
"reranked_chunks": [...],
"answer": "...",
"confidence": 0.85,
"latency_ms": 450,
"user_feedback": None # thumbs up/down
}Alerts:
Mandatory system prompt:
Answer ONLY based on the information provided in the context.
If you cannot find the information, respond: "I could not find this
information in the available data."
NEVER fabricate information.Require source citations:
Every answer must include [Source: file_name, section/clause].
If a specific source cannot be cited, mark it as "unverified".if max_relevance_score < 0.3:
return "No relevant information found."
elif max_relevance_score < 0.6:
return answer + "\n⚠️ Low confidence. Please verify."
else:
return answer + f"\n📎 Source: {sources}"Cross-check the answer with the DB:
Detailed comparison: read
references/embedding-models.md
| Scenario | Model | Reason |
|---|---|---|
| Production, budget OK | Cohere embed-v4 | Highest MTEB, input_type optimization |
| Production, low cost | OpenAI text-embedding-3-small | $0.02/1M tokens, good quality |
| Self-host, multilingual | BGE-M3 ⭐ | Hybrid dense+sparse, 100+ languages, free |
| Self-host, Vietnamese | BGE-M3 or multilingual-e5-large | Best for Vietnamese RAG |
| POC / Prototype | all-MiniLM-L6-v2 | 90MB, runs on CPU |
normalize_embeddings=True when encoding for cosine similarityDetailed comparison + HNSW tuning: read
references/vector-db-comparison.md
Already have PostgreSQL and <5M vectors? → pgvector
Just prototype/POC? → ChromaDB
Production, want zero-ops? → Pinecone
Need performance + HNSW control? → Qdrant
Need hybrid BM25+vector built-in? → Weaviate| Param | Default | Accuracy-critical | Speed-critical |
|---|---|---|---|
| M | 16 | 48-64 | 8-16 |
| ef_construction | 200 | 400-500 | 100-200 |
| ef (search) | 100 | 200-256 | 50-100 |
Trade-off: Higher M and ef → better recall but more RAM and slower. Tune per SLA.
Detailed code examples: read
references/advanced-rag.md
Embed the entire document first, then pool embeddings by chunk boundaries. Each chunk retains context from surrounding text.
Traditional: Doc → Chunk → Embed each (loses context)
Late Chunking: Doc → Embed full → Pool by boundaries (retains context)Use when: Documents have many co-references ("it", "this", "the package"). Quality gain: +5-10%.
Build a multi-level summary tree: Level 0 (chunks) → Level 1 (summaries) → Level 2 (summary of summaries).
Use when: Need to answer both broad queries ("Compare all insurance packages") and narrow queries ("Clause X of Package Y"). Quality gain: +10-15%.
Build a knowledge graph from documents → detect communities → summarize communities → query via map-reduce.
Use when: Multi-hop reasoning, synthesize across many documents. Quality gain: +15-25% for synthesis queries. High overhead (many LLM calls when building the graph).
1. Late Chunking → better embeddings
2. Hybrid Search (BM25 + vector) → high recall
3. Reranking (Cohere/Cross-encoder) → high precision
4. RAPTOR → multi-level retrieval (optional)
5. GraphRAG → synthesis queries (optional, high cost)# Cache embeddings (avoid re-computation)
import hashlib, json, redis
r = redis.Redis()
def cached_embed(text, model):
key = f"emb:{hashlib.md5(text.encode()).hexdigest()}"
cached = r.get(key)
if cached:
return json.loads(cached)
embedding = model.encode([text])[0].tolist()
r.setex(key, 3600, json.dumps(embedding)) # TTL 1h
return embedding
# Cache search results (avoid re-searching)
def cached_search(query, search_fn, ttl=300):
key = f"search:{hashlib.md5(query.encode()).hexdigest()}"
cached = r.get(key)
if cached:
return json.loads(cached)
results = search_fn(query)
r.setex(key, ttl, json.dumps(results))
return resultsimport asyncio
async def parallel_retrieve(query, retrievers):
"""Run multiple retrievers in parallel."""
tasks = [r.search(query) for r in retrievers]
results = await asyncio.gather(*tasks)
return merge_and_deduplicate(results)See details in references/vector-db-comparison.md HNSW section. Key: tune ef (search) per latency SLA, tune M per recall target.
Details: read
references/vietnam-nlp.md
| Issue | Solution |
|---|---|
| Diacritics (with vs without) | Dual indexing: index both versions |
| Compound words ("bảo hiểm") | Word segmentation (underthesea) |
| Abbreviations (BHXH, TTCK, BLLĐ) | Abbreviation expansion dictionary |
| Vietnamese proper names | NER with underthesea/PhoBERT |
| Domain terms (finance, law, medical) | Domain-specific term enrichment |
Input text
→ Unicode normalize (NFC)
→ Expand abbreviations (BHXH → Social Insurance)
→ Domain term enrichment
→ Dual index: original + no-diacritics version
→ Extract entities → metadataDetailed prompt templates, code examples: read
references/orchestrator-patterns.md
Each user query is classified into 1 of 5 categories:
| Category | Description | Example | Model |
|---|---|---|---|
| simple | Greeting, FAQ, simple lookup | "Hello", "Opening hours?" | No LLM / Local |
| rag | Needs knowledge base search | "Does insurance cover cancer?" | Cheap (Gemini Flash) |
| complex | Multi-hop reasoning, comparison, analysis | "Compare 3 insurance packages for a family of 4" | Standard (GPT-4o-mini) / Premium (Claude Sonnet) |
| action | Needs tool/API execution (create form, calculate) | "Calculate insurance premium for me, age 30" | Standard + Tools |
| unsafe | Violation content, injection, jailbreak | "Ignore instructions..." | Block — No LLM |
User Query
→ Stage 1: Rule-based pre-classifier (regex, keywords, NO LLM)
→ confidence ≥ 0.8? → DONE (skip LLM)
→ confidence < 0.8? → Stage 2: LLM classifier (cheap model, ~50 tokens)Stage 1 blocks 60-80% of queries without spending a single LLM token.
Category → Model Selection:
greeting/simple → No LLM (rule-based response)
rag (simple) → Gemini Flash ($0.075/1M input) — cheap, fast
rag (complex) → GPT-4o-mini ($0.15/1M input) — balanced
complex → Claude Sonnet ($3/1M input) — premium quality
action → Gemini Flash + Tool calls
unsafe → Block response (no LLM cost)| Condition | RAG On/Off |
|---|---|
| Query contains domain keywords | ✅ ON |
| Classification = "rag" or "complex" | ✅ ON |
| Greeting, simple lookup, unsafe | ❌ OFF |
| Confidence score > 0.9 from cache/FAQ | ❌ OFF (answer from cache) |
| Condition | Tools |
|---|---|
| Query requests calculation (fees, interest) | calculator tool |
| Query requests form creation/submission | form_builder tool |
| Query requests real-time lookup (price, exchange rate) | api_lookup tool |
| Classification ≠ "action" | No tools |
{
"category": "rag",
"confidence": 0.92,
"risk_level": "low",
"model": "gemini-flash",
"rag_enabled": true,
"tools": [],
"max_tokens": 300,
"reasoning": "User asks about insurance benefits — needs knowledge base search"
}RAGAS evaluation pipeline. Run:
python3 scripts/eval_ragas.py --test-file eval_dataset.json --output results.json
python3 scripts/eval_ragas.py --test-file eval_dataset.json --metrics faithfulness,answer_relevancyInput: JSON file with test cases (question, answer, contexts, ground_truth). Output: metrics report + threshold checks.
Requires: pip install ragas langchain-openai datasets
Benchmark embedding models on a Vietnamese dataset. Run:
python3 scripts/embedding_benchmark.py --models bge-m3,multilingual-e5 --dataset vi_pairs.json
python3 scripts/embedding_benchmark.py --models all --quick # Use built-in test pairsInput: JSON file with query-positive-negative pairs. Output: accuracy + latency comparison.
Requires: pip install sentence-transformers numpy torch
Evaluate chunk quality. Run:
python3 scripts/chunk_optimizer.py --input chunks.jsonl --output report.jsonInput: JSONL file, each line is {"text": "...", "metadata": {...}}. Output: quality report with scores.
Test framework for RAG accuracy. Run:
python3 scripts/accuracy_test.py --test-file tests.json --results-dir ./resultsInput: JSON file with test cases (question, expected_answer, expected_source). Output: metrics report.
references/chunking-patterns.md — Python code examples for chunking strategiesreferences/retrieval-patterns.md — Code examples for hybrid search, reranking, multi-queryreferences/embedding-models.md — Detailed embedding model comparison (OpenAI, Cohere, BGE-M3, PhoBERT...)references/vector-db-comparison.md — Vector DB comparison + HNSW tuning guidereferences/advanced-rag.md — Late Chunking, RAPTOR, GraphRAG with code examplesreferences/testing-frameworks.md — RAGAS, LLM-as-Judge, Adversarial testingreferences/vietnam-nlp.md — Vietnamese NLP: diacritics, abbreviations, NER, domain termsreferences/orchestrator-patterns.md — Multi-model orchestrator: prompt templates, rule-based pre-classifier, cost comparison, fallback chain, monitoring© LeoYeAI, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 13 other files (scripts, references) in skills/rag-accuracy-optimizer of LeoYeAI/openclaw-master-skills.
Open the folder on GitHubat commit e5199b5
RAG Accuracy Optimizer next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| RAG Accuracy Optimizer this skillLeoYeAI/openclaw-master-skills | 2.2k | — | ~5.5k | Automated safety check: Pass | MIT | |
| Aliyun Opensearch Searchcinience/alicloud-skills | 397 | — | ~1.1k | Automated safety check: Pass | MIT | |
| Tanyuan Searchinfometa/workbuddyskills | 344 | — | ~1.2k | Automated safety check: Pass | None | |
| Snowflake Cortex AIMindrally/skills | 268 | — | ~2.3k | Automated safety check: Pass | Apache-2.0 | |
| Postgrestimescale/pg-aiguide | 1.9k | — | ~941 | Automated safety check: Pass | Apache-2.0 | |
| DBoracle/skills | 873 | — | ~1.4k | Automated safety check: Pass | UPL-1.0 |
cinience/alicloud-skills
A skill your agent uses when working with OpenSearch vector search edition via the Python SDK (ha3engine) to push documents and run HA/SQL searches.
infometa/workbuddyskills
腾讯探元文博检索工具集(Agentic RAG)。封装两个 HTTP API 为 Node.js 脚本,由 Agent 依据问题特征选择工具并构造 query: - search-relics(文物/世界遗产数据库 NL→SQL):适合结构化事实的详情、列表、统计与排行查询 -…
Mindrally/skills
Reference for Snowflake Cortex AI Functions (AICOMPLETE, AICLASSIFY, AIEXTRACT, AIFILTER, etc.) and Cortex Search for building RAG applications entirely inside Snowflake.
timescale/pg-aiguide
A skill your agent uses for any PostgreSQL database work — table design, indexing, data types, constraints, extensions (pgvector, PostGIS, TimescaleDB), search, and migrations.
oracle/skills
Oracle Database guidance for SQL, PL/SQL, SQLcl, ORDS, Oracle Vector SDK, administration, app development, performance, security, migrations, and agent-safe database workflows.
oracle/skills
Oracle Enterprise AI guidance for building, deploying, securing, estimating cost for, and integrating AI models, agents, RAG, Responses API workflows, custom or imported models, fine-tuning, model…
LeoYeAI/openclaw-master-skills
Manages pipelines on a DevOps quality and efficiency platform through its OpenAPI: list workspaces and templates, create, update, run and cancel pipelines, and read run records.
LeoYeAI/openclaw-master-skills
Patches OpenClaw's Feishu extension so an edited document triggers an isolated agent session that reads the doc and replies inline, turning it into a live chat space.
LeoYeAI/openclaw-master-skills
Multi-context memory management system for OpenClaw agents with group-isolated storage, global shared memory, workspace organization, and group-specific skills isolation.
LeoYeAI/openclaw-master-skills
Runs a brand's AI-search visibility work end to end: diagnosing how AI platforms represent it, repositioning it, producing AI-optimized content and monitoring ongoing mentions.
LeoYeAI/openclaw-master-skills
Installs and authenticates the gws CLI, then automates Gmail, Drive, Sheets, Calendar, Docs, Chat and Tasks with ready-made recipes, persona bundles and security audits.
LeoYeAI/openclaw-master-skills
Runs four advisor roles, a fitness coach, nutritionist, data analyst and TCM practitioner, to build a health profile and track workouts, diet and wellness over time.
Works with
Categories
Optimize accuracy for RAG (Retrieval-Augmented Generation) systems. RAG Accuracy Optimizer is an agent skill from LeoYeAI/openclaw-master-skills. Optimize accuracy for RAG (Retrieval-Augmented Generation) systems.
RAG Accuracy Optimizer fits situations like: improving a RAG pipeline; choosing the right chunking strategy; optimizing retrieval accuracy (hybrid search; evaluating chunk quality.
Run `npx skills add LeoYeAI/openclaw-master-skills --skill rag-accuracy-optimizer -a claude-code`. Or copy the skill folder (skills/rag-accuracy-optimizer in LeoYeAI/openclaw-master-skills) into .claude/skills/rag-accuracy-optimizer in your project. Claude Code loads it when a task matches its description.
Run `npx skills add LeoYeAI/openclaw-master-skills --skill rag-accuracy-optimizer -a codex`. Or copy the skill folder (skills/rag-accuracy-optimizer in LeoYeAI/openclaw-master-skills) into .agents/skills/rag-accuracy-optimizer in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add LeoYeAI/openclaw-master-skills --skill rag-accuracy-optimizer -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/rag-accuracy-optimizer, .gemini/skills/rag-accuracy-optimizer, .github/skills/rag-accuracy-optimizer and .opencode/skills/rag-accuracy-optimizer in your project.
Going by SKILL.md and its folder, RAG Accuracy Optimizer needs Python for the scripts in its folder and the command-line tools its instructions call (python3, pip and just). Our summary lists: Python 3.
SKILL.md contains no URLs. Its commands use pip, which can reach the network depending on how they are called. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.
RAG Accuracy Optimizer is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 5.5k tokens (SKILL.md is roughly 22k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 29k tokens, read only when the agent opens those files.
Skills that share tags, products or a category with RAG Accuracy Optimizer: Aliyun Opensearch Search (cinience/alicloud-skills, 397 stars), Tanyuan Search (infometa/workbuddyskills, 344 stars), Snowflake Cortex AI (Mindrally/skills, 268 stars) and Postgres (timescale/pg-aiguide, 1.9k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
LeoYeAI (a GitHub user) maintains it in LeoYeAI/openclaw-master-skills, which has 2,159 GitHub stars. The repository holds 972 skills in this directory. The repository was last updated on July 20, 2026.
Source: LeoYeAI/openclaw-master-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.