PromptBase
PromptBase SelectGet Select
Close icon
General
Home
Marketplace
Create
Hire
Login
Chat
Sell
Explore

Skill Details

Runtime
(claude-5-5-opus)
Example user message
[userMessage]: Design a RAG system for our support chatbot. / We have ~1,200 help-center articles (HTML, 2-3 pages each), 40,000 resolved Zendesk tickets from the last 3 years, and a 300-page API reference PDF. Customers ask through a chat widget on our app. Real questions from last week: "what does error E4012 mean", "how do I move my workspace to the EU region", "is SSO included in the Team plan", "why did my webhook stop firing after the 2.3 update". Help articles change every week, the API reference with each release. We run Postgres on AWS and ticket data must not leave the EU.
Example agent response
# RAG design - Support chatbot over help, tickets, API - 2026-11-17 Brief: pasted message | Corpus: ~11.7M tokens (1,200 articles x 2.5 pages x 500 = 1.5M; 40,000 tickets x 250 = 10M; 300 pages x 500 = 150k) ## Verdict Retrieval - at ~11.7M tokens the corpus is roughly 75 times the long-context ceiling, and articles change weekly. None of the example questions is a count or ranking over tickets, so no structured path is designed. ## Questions it must answer | Type | Share (estimated) | Example from the brief | What it needs | |---|---|---|---| | Paraphrase | 35% | "how do I move my workspace to the EU region" | Dense retrieval over article sections | | Exact lookup | 20% | "what does error E4012 mean" | Lexical index that keeps E4012 whole | | Recency-bound | 15% | "why did my webhook stop firing after the 2.3 update" | Version metadata; superseded content marked | | Out of scope | 15% | (invented) "why was I charged twice this month" | Abstain and hand off to an agent | | Numeric or tabular | 10% | "is SSO included in the Team plan" | Plan table chunked with its header row | | Comparison or multi-hop | 5% | (invented) "Team vs Business: which has audit logs" | Wide retrieval across sources, then rerank | Whole-document: 0% - chat customers do not ask for an article to be summarised. ## Corpus | Document type | Volume | Answer unit -> chunk | Risk | |---|---|---|---| | Help-center articles | ~1,200 HTML, ~1.5M tokens | One section under its H2/H3; a plan table kept whole | Weekly edits leave stale chunks | | Zendesk tickets | 40,000, ~10M tokens | One thread, reduced to problem + resolution | PII; EU-only; fixes outdated by releases; near-duplicates | | API reference PDF | 300 pages, ~150k tokens | One endpoint section; one error-code row with its header | PDF table extraction - first risk; replaced each release | ## Pipeline decisions | Stage | Decision | Serves | Fails when | Measured by | |---|---|---|---|---| | Parsing | HTML split by heading tree; PDF through a layout-aware parser that keeps tables | Exact lookup, tabular | Error rows lose their header | Recall@5 on tabular and exact rows | | Chunking | Answer unit per type as above; tickets redacted, summarised, near-duplicates collapsed | Paraphrase, recency-bound | A procedure is split mid-steps | Recall@5 on paraphrase rows | | Context line | Title + heading path, plus product version for API and tickets, prepended before embedding | Paraphrase, recency-bound | "Step 3" chunks with no subject | Recall@5 with vs without | | Embedding | Dense model served in an EU region (e.g. Bedrock in an EU region, or a self-hosted open model); name + version on every vector | Paraphrase | A model swap mixes vector spaces | Paraphrase recall@5 | | Lexical index | Postgres full-text or a BM25 extension; tokenizer keeps E4012 and 2.3 intact | Exact lookup | Codes split into fragments | Exact-lookup recall@5 | | Fusion | Reciprocal rank fusion of lexical and dense lists | Exact lookup, paraphrase | One list drowns the other | Recall@5 vs each list alone | | Reranking | Retrieve 50, cross-encoder rerank, pass 5; EU-hosted | Multi-hop, tabular | Right chunk is below 50 | Recall@5 vs recall@50 | | Metadata and filters | Source, product version, visibility filtered in the SQL query; internal notes never indexed | All types | Internal or other-customer text enters the prompt | Leaked chunks in golden runs = 0 | | Freshness | Weekly article sync by content hash, deleted articles purged; API reference tagged per release, old version marked superseded | Recency-bound | Pre-2.3 page outranks the current one | Recency rows answered from current version | | Generation and citation | Answer only from passed chunks; cite article or API section links; tickets used as evidence, never quoted or linked | All answerable types | A ticket detail reaches another customer | Citation support rate | | Abstention | Reranker score floor plus a no-source rule; hand off to a human agent in Zendesk | Out of scope | Nearest chunk answered anyway | Abstention rate on out-of-scope rows | Cut: whole-document routing - no question type needs it. ## Golden set (seed) | # | Question | Type | Should retrieve | Answerable | |---|---|---|---|---| | 1 | what does error E4012 mean | Exact lookup | API reference error-code row for E4012 | Yes | | 2 | how do I move my workspace to the EU region | Paraphrase | Article on region / data residency, steps section | Yes | | 3 | is SSO included in the Team plan | Numeric or tabular | Plan comparison table, SSO row with header | Yes | | 4 | why did my webhook stop firing after the 2.3 update | Recency-bound | 2.3 webhook change notes + matching resolved tickets | Yes | | 5 | how do I rotate my API key (invented) | Paraphrase | Article on API keys, rotation section | Yes | | 6 | what is the rate limit for webhooks (invented) | Exact lookup | API reference rate-limit table, current version | Yes | | 7 | how do I invite a teammate as admin (invented) | Paraphrase | Article on members and roles | Yes | | 8 | Team vs Business: which has audit logs (invented) | Comparison or multi-hop | Plan table, both plan columns | Yes | | 9 | why was I charged twice this month (invented) | Out of scope | Nothing - account-specific billing | Should abstain | | 10 | is your API down right now (invented) | Out of scope | Nothing - live status | Should abstain | Targets: recall@5 after reranking >= 0.85 overall and >= 0.95 on exact lookups; citation support >= 0.90; abstention >= 0.90 on out-of-scope rows - starting targets, to be tightened once a baseline exists. ## Build order 1. Golden set grown to ~100 rows from last month's chat logs and support staff, plus a baseline: Postgres full-text over help articles only, top 5 - done when recall@5 is reported per question type. 2. Add the API reference with endpoint and error-row chunks and context lines - done when exact-lookup recall@5 >= 0.95. 3. Add EU-hosted dense embeddings and rank fusion - done when paraphrase recall@5 rises >= 10 points with no drop on exact lookups. 4. Add the reranker (50 in, 5 out) - done when overall recall@5 >= 0.85. 5. Add redacted ticket threads with version metadata - done when recency-bound recall@5 rises >= 10 points; removed if it does not. 6. Add cited generation, abstention floor and the weekly sync - done when citation support >= 0.90 and abstention >= 0.90. ## Open questions - **Assumed:** the bot cannot see the customer's own account (plan, webhook delivery logs) - flips: if it can, "why did my webhook stop firing" needs a call to account data, and the verdict becomes Retrieval plus a structured path. - **Assumed:** an EU-hosted embedding, reranking and generation model is available - flips: if not, ticket text cannot enter the pipeline at query time; tickets are mined offline into new articles instead. - **Assumed:** the Postgres instance runs in an AWS EU region - flips: if not, ticket chunks need a separate EU database and the retrieval query spans two stores. - **Assumed:** 2.3 release notes exist in the help center - flips: if not, recency-bound questions rely on tickets alone; add release notes as a fourth document type. - **Assumed:** every help article is public and identical across plans - flips: if some are plan-gated, a per-chunk visibility filter tied to the customer's plan is required. - **Assumed:** the API reference PDF has a text layer - flips: if scanned, OCR plus a manual check of the error-code table comes before step 2. Save this as `RAG-DESIGN.md`?
Claude Skill
Boosted itemBoosted

Rag System Architect

Add to Cart
Instant accessInstant access
Usage rightsCommercial use
Money-back guaranteeMoney‑back
By purchasing this skill, you agree to our terms of service
CLAUDE-5-5-OPUS
Tested icon
Guide icon
Free credits icon
Most RAG projects pick a vector database first and find out what users ask later. This skill works the other way round. Describe your documents and a few real questions, and it returns one design document: whether you need retrieval at all, the question types the system must serve, a decision per pipeline stage tied to the question it exists for, a seed golden set to measure it, and a build order.
...more
Added 4 days ago
Report
Browse Marketplace