Rag Accuracy OptimizerBLOCK
🧠 Curated collection of 1209+ best OpenClaw skills — weekly updated by MyClaw.ai
Overview
🧠 Curated collection of 1209+ best OpenClaw skills — weekly updated by MyClaw.ai
4f3b4a2a472eOBSERVED · 2026-10-08Install
Commands as the repository documents them. They are shown, not run.
pip install graphrag
pip install ragas langchain-openai datasets
pip install underthesea
pip install vncorenlp
Host compatibility
What the documentation claims. We have not run a compatibility test.
| Host | Status | Notes |
|---|---|---|
| cursor | mentioned | |
| openclaw | mentioned |
What it tells the agent
The instruction file, verbatim from the audited commit — this is the text the model reads, and the surface the audit's instruction layer examines. Quoted here so you can judge it without cloning anything.
---
name: rag-accuracy-optimizer
description: >
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 metadata schemas for
domain-specific data (insurance, finance, healthcare, e-commerce).
---
# RAG Accuracy Optimizer
A skill for optimizing end-to-end accuracy in RAG systems.
## Workflow Overview
```
Data Design → Chunking → Indexing → Retrieval → Generation → Testing → Monitoring
```
Each step impacts accuracy. Optimize each step in order.
---
## 1. Structured Data Design
### SQL vs Vector DB — When to Use What?
| 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**.
### Schema Design Patterns by Domain
**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.description
```
**Finance:**
```
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 + period
```
**Healthcare:**
```
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.recommendation
```
**E-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 description
```
### Metadata Tagging Strategy
Each chunk/document needs at minimum:
```python
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:**
- Always include `source` for traceability and citation
- `entity_id` enables pre-filtering before search → reduces noise
- `chunk_index` + `total_chunks` enables fetching surrounding context
- Domain-specific fields (clause_number, ticker, drug_id) vary by use case
### Normalization vs Denormalization
| | 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.
---
## 2. Chunking Strategies
> Detailed code examples: read `references/chunking-patterns.md`
### Choosing the Right Strategy
```
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
```
### Chunk Size Guidelines
| 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 |
### Semantic Chunking
Split by meaning (section, topic) instead of fixed size:
```python
# Split by markdown headings
# Split by paragraph breaks (\n\n)
# Split by topic change (using NLP or LLM detection)
```
### Overlap Strategy
- **10-20% overlap** between adjacent chunks
- Ensures information at boundaries is not lost
- Chunk N ends with 1-2 opening sentences of chunk N+1
### Hierarchical Chunking (Parent-Child)
```
Document (summary)
└── Section (heading + key points)
└── Paragraph (details)
```
- Search at paragraph level (most detailed)
- When matched, pull parent section for additional context
- Keep `parent_id` in metadata
### Domain-Specific Chunking
- **Insurance:** 1 chunk = 1 clause
- **Finance:** 1 chunk = 1 report section, metadata = ticker + period
- **Healthcare:** 1 chunk = 1 guideline/recommendation
- **E-commerce:** 1 chunk = 1 review or 1 product description
- **Legal:** 1 chunk = 1 article/clause/section
### Metadata Enrichment Per Chunk
Each chunk should be enriched with:
- **Summary:** 1-2 sentence content summary (LLM-generated)
- **Keywords:** Key terTrust audit
BLOCKgrade D · trust 69/100 Do not install this without reading the findings. The audit found something that could harm you or your machine.
| Layer | What it checks | Result |
|---|---|---|
| L0 | Provenance & inventory | PASS |
| L1 | Static analysis of the code | WARN |
| L2 | Instruction surface (what it tells the agent) | FAIL |
| L3 | Class-specific surface | PASS |
| L4 | Behavioural (sandbox) | SKIPPED |
What the source does
- Filesystem
- none-observed
- Network
- none-observed
- Shell
- none-observed
- Dependencies
- pinned
- Secrets in source
- none-found
Findings (7)
| **unsafe** | Violation content, injection, jailbreak | "Ignore instructions..." | Block — No LLM |
- "unsafe": Harmful content, prompt injection, jailbreak attempts, off-topic abuse
<key>k5Ey9KFlkqpj+SDkUw+5ED9lTA3En/qUi0zdrydUCH3kMWTE3Eh65NXnFCaxlY2omY2JHnlEoK7Li7oOEvM7eG5VPdcO/sFlMfoCRdnLYdepJ+uLzYwOWR8W4yQVve/clxVFTVRL4DFleKInGdpAxIbHZT2yi4ADAMENls1N1XSLojRuqXePXDeAT/4Mv4TTx0s
r"ignore\s+(all\s+)?(previous\s+)?instructions",
r"jailbreak",
r"bypass\s+(safety|filter|restriction)",
"explanation": "Must refuse, don't leak system prompt"
Gates applied: instruction_override, no_behavioural_pass.
4f3b4a2a472efull audit observations/trust-audit/skill/leoyeai__rag-accuracy-optimizer.json · Report an issue / request a re-scanAudit history
Every audit this skill has had.
| Date | Source | Verdict | Grade | Score | Change |
|---|---|---|---|---|---|
| 2026-10-08 | 4f3b4a2a472e | BLOCK | D | 69 | first audit |
Questions
What does the Rag Accuracy Optimizer skill do?
🧠 Curated collection of 1209+ best OpenClaw skills — weekly updated by MyClaw.ai
Is Rag Accuracy Optimizer safe to install?
No — not without reading the findings first. The audit graded it D (69/100) and found 2 critical or high issues in the source. Each one is listed on this page with the file and line it is on.
What can Rag Accuracy Optimizer access on my machine?
The audit observed no filesystem, network or shell use at all in its source.
Which assistants does Rag Accuracy Optimizer work with?
Its documentation mentions cursor and openclaw. That is what the text claims, not a compatibility test we ran.
How current is this page?
The grade is for one exact copy of the source (4f3b4a2a472e), read on 2026-10-08. The repository is watched, and a new audit runs when it changes — this is the first audit.