rag-design
Production-grade RAG (Retrieval-Augmented Generation) system design patterns from OpenClaw. Use when implementing semantic search, vector retrieval, memory systems, or knowledge bases. Covers hybrid search (vector + keyword), embedding providers, MMR re-ranking, temporal decay, and enterprise features.
npx skills add majiayu000/claude-skill-registry --skill rag-design --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# RAG Design Patterns Production-grade RAG implementation patterns extracted from OpenClaw's memory system. ## Core Architecture ### Hybrid Search Strategy Combine vector and keyword search for optimal retrieval: ```typescript // Parallel execution const [vectorResults, keywordResults] = await Promise.all([ vectorSearch(query, { limit: 50 }), keywordSearch(query, { limit: 50 }) ]); // Weighted merge const merged = mergeResults({ vector: vectorResults, keyword: keywordResults, vectorWeight: 0.7, // Semantic relevance textWeight: 0.3 // Keyword matching }); ``` ### Storage Layer Use SQLite with extensions for production deployments: - **Vector table**: `sqlite-vec` extension for embeddings - **FTS table**: SQLite FTS5 for full-text search - **Cache table**: Store computed embeddings to avoid recomputation ```sql -- Vector storage CREATE VIRTUAL TABLE chunks_vec USING vec0( embedding FLOAT[768] ); -- Full-text search CREATE VIRTUAL TABLE chunks_fts USING fts5( content, path, source ); -- Embedding cache CREATE TABLE embedding_cache ( content_hash TEXT PRIMARY KEY, embedding BLOB, provider TEXT, model TEXT ); ``` ## Embedding Providers Support multiple providers with fallback: ```types
- Core Architecture
- Hybrid Search Strategy
- Storage Layer
- Embedding Providers
- Advanced Retrieval
- MMR Re-ranking
- Temporal Decay
- Query Enhancement
- Query Expansion
- Enterprise Features
- Batch Processing
- Incremental Indexing
- Error Recovery
- Agent Integration
What does the rag-design skill do?
Production-grade RAG (Retrieval-Augmented Generation) system design patterns from OpenClaw. Use when implementing semantic search, vector retrieval, memory systems, or knowledge bases. Covers hybrid search (vector + keyword), embedding providers, MMR re-ranking, temporal decay, and enterprise features.
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill rag-design --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
