rag-optimizer

Optimize RAG pipelines with chunking, hybrid search, RRF scoring, and RAGAS evaluation.

Updated Mar 8, 2026
One-click install
npx skills add https://github.com/JFrangel/agents --skill rag-optimizer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rag-optimizer
Source: https://github.com/JFrangel/agents/tree/main/skills/chunk-scoring
Command: npx skills add https://github.com/JFrangel/agents --skill rag-optimizer

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and assets (resource) components.

What problem does it solve?

Streamlines complex Retrieval-Augmented Generation (RAG) pipelines by optimizing chunking, embeddings, indexing, scoring (including Reciprocal Rank Fusion), and reranking, reducing latency while improving recall and answer fidelity.

Core Features & Use Cases

  • Chunking optimization: Strategic segmentation of documents for dense and sparse retrieval.
  • Hybrid search orchestration: Dense + sparse search with RRF for robust ranking.
  • RAGAS evaluation: Metrics and feedback loops for continual improvement.
  • Agentic routing: Dynamic query routing across multiple sub-skills and data sources.
  • Report generation: Automated improvement reports and handoff to tech-writer.
  • Use Case: Tune a legal corpus for precise case-law retrieval with high recall and relevance.

Quick Start

Use this Skill to optimize a RAG pipeline by configuring chunking strategy, embedding models, and hybrid search with RRF reranking.

Frequently Asked Questions about rag-optimizer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I optimize chunking and embeddings for a RAG pipeline?

To optimize RAG pipelines, you tune semantic chunking strategies and select embedding models to improve retrieval recall. This Skill orchestrates segmentation and indexing across large corpora to reduce latency and increase document answer fidelity.

What is Reciprocal Rank Fusion and how does it improve semantic search?

Reciprocal Rank Fusion (RRF) combines dense and sparse search results into a single ranked list. Applying RRF in semantic search provides robust ranking across multiple retrieval methods, improving relevance over standalone vector or keyword queries.

How do I evaluate RAG retrieval quality using RAGAS metrics?

You evaluate RAG retrieval quality by applying RAGAS metrics through automated feedback loops. This generates evaluation reports to measure answer fidelity and enable continual RAG pipeline tuning.

Can I use dynamic query routing with multiple vector databases for large corpora?

Yes, dynamic query routing supports multiple vector databases across large corpora. This enables agentic routing to direct queries to appropriate sub-skills, optimizing retrieval-heavy workflows.

What is the best way to combine dense and sparse search for document retrieval?

The best way to combine dense and sparse search is through hybrid search orchestration. This applies Reciprocal Rank Fusion and reranking to merge semantic and keyword retrieval, boosting precision and recall for large corpora.