Agent skill

RAG Pipeline

by brightdata in brightdata/skills

Build a RAG (retrieval-augmented generation) pipeline or a custom search engine on top of Bright Data's Discover API — using intent-ranked web results + parsed page content as the…

MITAuto-check passedAI & LLM Engineering

Install RAG Pipeline

skills CLI
$ npx skills add brightdata/skills --skill rag-pipeline -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install brightdata/skills rag-pipeline --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/brightdata/skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/rag-pipeline .claude/skills/rag-pipeline && rm -rf skills-src

Use ~/.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/

Facts

Skill name
rag-pipeline
GitHub stars
264
Token cost
~1.9k tokens
SKILL.md length
640 words
Files
2 (incl. references)
Skills in repo
14
Repo updated
First seen
Licence
MIT

At a glance

Build a RAG (retrieval-augmented generation) pipeline or a custom search engine on top of Bright Data's Discover API — using intent-ranked web results + parsed page content as the…

  • Works in 5 steps: Retrieval returns non-empty, on-topic… → No block-page / empty content made it… → Citations resolve — every [n] the LLM… → …
  • The user wants to build a RAG pipeline
  • SKILL.md covers Two architectures — choose first, Live retrieval (web-grounded…, Ingestion (build a vector… and Design rules, plus 4 more sections
  • Needs BRIGHTDATA_API_TOKEN

What it does

RAG Pipeline is an agent skill from brightdata/skills. Build a RAG (retrieval-augmented generation) pipeline or a custom search engine on top of Bright Data's Discover API — using intent-ranked web results + parsed page content as the retrieval/ingestion layer for an LLM or vector store. Use when the user wants to "build a RAG pipeline", "add web search to my LLM/agent", "ground my model in live web data", "build a search engine over the web", "ingest web content into a vector DB / knowledge base", or "give my chatbot retrieval". Covers both live retrieval (Discover…

Its SKILL.md is about 1.9k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including reference files (for example `references/code.md`).

It sits in AI & LLM Engineering, covering Retrieval-augmented generation, Web search and Vector databases. It works with Bright Data. The licence is MIT.

When your agent uses it

  • The user wants to build a RAG pipeline
  • Add web search to my LLM/agent
  • Ground my model in live web data
  • Build a search engine over the web

Example prompts

  • “build a RAG pipeline”
  • “add web search to my LLM/agent”
  • “ground my model in live web data”
  • “/rag-pipeline”

Requirements

  • Python 3
  • A credential in BRIGHTDATA_API_TOKEN

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Retrieval returns non-empty, on-topic chunks for a known test query (eyeball top-k links).
  2. No block-page / empty content made it into the index — spot-check stored chunks.
  3. Citations resolve — every [n] the LLM emits maps to a real source link in the retrieved set.
  4. Freshness is honored — if the app promises current data, confirm live retrieval (or a recent re-ingest), not a stale index.
  5. Grounding check — answers are supported by retrieved content, not the model's prior; test with a question whose answer only exists in a…

What it can do on your machine

Read from SKILL.md and the folder at commit 81f51af. It shows what the files ask for, not the result of running them.

  • Tool permissions

    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.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are javascript).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • BRIGHTDATA_API_TOKEN

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

RAG Pipeline loads about 1.9k tokens when it runs, and up to ~4.4k if it reads all its reference files. Until then it costs about 195 tokens; SKILL.md has 640 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~195
When it runs · the whole SKILL.md, loaded when a task matches
~1.9k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~4.4k

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.

Safety

Auto-check passed

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); files beside SKILL.md are not scanned.

SKILL.md

The full file from brightdata/skills at commit 81f51af, republished under its MIT licence (© brightdata). 640 words, ~1,850 tokens.

Download SKILL.mdSave it as .claude/skills/rag-pipeline/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
rag-pipeline
description
Build a RAG (retrieval-augmented generation) pipeline or a custom search engine on top of Bright Data's Discover API — using intent-ranked web results + parsed page content as the retrieval/ingestion layer for an LLM or vector store. Use when the user wants to "build a RAG pipeline", "add web search to my LLM/agent", "ground my model in live web data", "build a search engine over the web", "ingest web content into a vector DB / knowledge base", or "give my chatbot retrieval". Covers both live retrieval (Discover at query time as a web-grounded retriever) and ingestion (Discover → chunk → embed → vector store → retrieve). Built on the `discover-api` skill. For a one-off written report use `live-research`; for raw markdown of specific known URLs use `scrape`.
metadata.author
Bright Data
metadata.version
1.0

Bright Data — RAG / Search-Engine Pipeline

Use Discover as the retrieval layer for an LLM app or a custom search engine. Discover already returns intent-ranked, relevance-scored results with parsed page content, so it does the "search + fetch + clean" stage of RAG for you. This is a code/architecture skill built on the discover-api skill — read that for API mechanics (trigger/poll, modes, params, limits).

Pick the right neighbor: a written brief → live-research; markdown of specific URLs you already have → scrape; structured platform records → data-feeds.

Two architectures — choose first

Does the corpus change every query, or is it a stable knowledge base?

  ├── Per-query, always-fresh ("ground each answer in live web data")
  │     → LIVE RETRIEVAL: Discover(include_content) at query time → top-k → LLM
  │       Pros: always current, no storage. Cons: per-query latency + cost.
  │
  └── Reused across many queries ("build a knowledge base / search engine")
        → INGESTION: Discover(include_content) → chunk → embed → vector store
          then at query time: embed query → vector search → (rerank) → LLM
          Pros: fast queries, cacheable. Cons: can go stale (re-ingest on a schedule).

Many systems do both: an ingested base for breadth + a live Discover call for freshness, merged before the LLM.

Live retrieval (web-grounded answers)

Pattern: on each user question, run Discover with a sharp intent, take the top-k by relevance_score, and pass their content as context to the LLM. The LLM cites the links.

javascript
import { bdclient } from '@brightdata/sdk';
const client = new bdclient(); // BRIGHTDATA_API_TOKEN

async function retrieve(question, k = 6) {
  const res = await client.discover(question, {
    intent: `authoritative sources that directly answer: ${question}`,
    includeContent: true,
    numResults: Math.min(k * 2, 20),  // over-fetch, then trim
  });
  // NOTE: the JS SDK returns a WRAPPER object, not a bare array:
  //   { success, data: [ {link,title,description,relevance_score,content?} ], totalResults, cost, taskId, ... }
  // The result rows are in `.data` (CLI/REST use `.results` instead — see discover-api).
  if (!res.success) throw new Error(`discover failed: ${res.error ?? 'unknown'}`);
  return (res.data ?? [])
    .filter(r => r.content && !/just a moment|captcha|access denied|not found/i.test(r.content) && r.content.length > 200)
    .sort((a, b) => b.relevance_score - a.relevance_score)
    .slice(0, k);
}
// → build a prompt from sources[].content, ask the LLM to answer WITH [n] citations to sources[].link

Full prompt-assembly + citation pattern: references/code.md.

Ingestion (build a vector knowledge base / search engine)

Pattern: discover broadly (high volume — zeroRanking via REST is ideal here), chunk each page's content, embed the chunks, upsert into a vector store with the source URL as metadata. At query time: embed the query, vector-search, optionally rerank, then feed to the LLM.

Stages: discover → dedup → chunk → embed → upsert (ingest), then embed query → search → rerank → generate (serve). Provider-agnostic code for both stages, including chunking and metadata, is in references/code.md.

For bulk corpus building, prefer the raw REST "mode":"zeroRanking" flow (max raw results, no ranking) from the discover-api skill — but note it ignores num_results and does not support include_content, so you fetch content separately (Discover standard/deep with content, or the scrape skill).

Design rules

  • Store provenance. Every chunk keeps its source link (and ideally title + relevance_score). RAG without citations is unverifiable.
  • Chunk for the model, not the page. ~500–1500 tokens with overlap; split on headings/paragraphs, not mid-sentence.
  • Validate content before embedding. Skip block pages and empty bodies (oversized PDFs return null content). Embedding garbage poisons retrieval.
  • Over-fetch then trim by relevance_score. Discover's score is a strong prior for top-k selection before (or instead of) a reranker.
  • Re-ingest on a schedule if freshness matters — web content drifts. The ingested base goes stale; live retrieval doesn't.
  • Cap and dedup. num_results ≤ 20 per call; dedup by normalized URL across calls so one article via three aggregators isn't triple-weighted.
  • Keep the embedder/vector store pluggable. Discover is the retrieval source; the embedding model and vector DB are your choice — don't hardwire one.
Show full SKILL.md (243 more words)Show less

Verification gate

  1. Retrieval returns non-empty, on-topic chunks for a known test query (eyeball top-k links).
  2. No block-page / empty content made it into the index — spot-check stored chunks.
  3. Citations resolve — every [n] the LLM emits maps to a real source link in the retrieved set.
  4. Freshness is honored — if the app promises current data, confirm live retrieval (or a recent re-ingest), not a stale index.
  5. Grounding check — answers are supported by retrieved content, not the model's prior; test with a question whose answer only exists in a retrieved page.

Red flags

  • Building an ingestion pipeline when the user needs fresh answers (use live retrieval), or hammering Discover live when a cached index would do.
  • Embedding content without filtering block pages / nulls.
  • Dropping source URLs — you can't cite or refresh what you didn't store.
  • Treating num_results as unlimited (cap 20) or expecting include_content under zeroRanking.
  • Letting the LLM answer from training data — enforce "answer only from provided sources; if absent, say so."
  • One giant chunk per page (kills retrieval precision) or mid-sentence splits.

References

  • references/code.md — runnable JS + Python for both architectures: live retrieval with prompt+citation assembly, and the full ingestion pipeline (discover → dedup → chunk → embed → upsert → query), with a provider-agnostic embedder/vector-store interface.
  • discover-api — the retrieval API (trigger/poll, modes, include_content, limits). Read first.
  • live-research — one-off synthesized report instead of a standing system.
  • scrape — fetch markdown for specific URLs you already have.
  • js-sdk-best-practices / python-sdk-best-practices — client.discover() option details and batch patterns.

© brightdata, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (references) in skills/rag-pipeline of brightdata/skills.

  • SKILL.md
  • references/code.md

Open the folder on GitHubat commit 81f51af

Compare with similar skills

RAG Pipeline 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.

RAG Pipeline compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
RAG Pipeline this skillbrightdata/skills264—~1.9kAutomated safety check: PassMIT
Langchain4j RAG Implementation Patternsgiuseppe-trisciuoglio/developer-kit3551 repos~3.3kAutomated safety check: NotesMIT
Context Retrievalseb1n/awesome-ai-agent-skills206—~2.1kAutomated safety check: PassMIT
Tavily Search API Integrationandrewyng/context-hub14k—~1.1kAutomated safety check: PassMIT
Sap AI Coresecondsky/sap-skills462—~3.3kAutomated safety check: PassGPL-3.0
AWS Cloudformation Bedrockgiuseppe-trisciuoglio/developer-kit355—~3.2kAutomated safety check: NotesMIT

Similar skills

  • Langchain4j RAG Implementation Patterns

    giuseppe-trisciuoglio/developer-kit

    Provides Retrieval-Augmented Generation (RAG) implementation patterns with LangChain4j for Java.

    355 GitHub starsUsed in 1 repo~3.3k tokens
    AI & LLM EngineeringAuto-check: notes
  • Context Retrieval

    seb1n/awesome-ai-agent-skills

    Retrieve relevant information from a knowledge base using semantic, keyword, or hybrid search to ground a query.

    206 GitHub stars~2.1k tokensUpdated 1 mo ago
    AI & LLM EngineeringAuto-check passed
  • Tavily Search API Integration

    andrewyng/context-hub

    Guides building Tavily integrations for web search, URL extraction, site crawling and AI-assisted research in Python or JavaScript agent and RAG projects.

    14k GitHub stars~1.1k tokensUpdated 4 mo ago
    AI & LLM EngineeringAuto-check passed
  • Sap AI Core

    secondsky/sap-skills

    Guides development with SAP AI Core and SAP AI Launchpad for enterprise AI/ML workloads on SAP BTP.

    462 GitHub stars~3.3k tokensUpdated 2 days ago
    AI & LLM EngineeringAuto-check passed
  • AWS Cloudformation Bedrock

    giuseppe-trisciuoglio/developer-kit

    Provides AWS CloudFormation patterns for Amazon Bedrock resources including agents, knowledge bases, data sources, guardrails, prompts, flows, and inference profiles.

    355 GitHub stars~3.2k tokensUpdated 27 days ago
    AI & LLM EngineeringAuto-check: notes
  • Brightdata Local Search

    davila7/claude-code-templates

    Set up and run local web searches using Bright Data SERP API with the unfancy-search pipeline (query expansion, SERP retrieval, RRF reranking).

    32k GitHub stars~1.2k tokensUpdated today
    Productivity & AutomationAuto-check: notes

More from brightdata/skills

All 14 skills in this repo
  • Design Mirror

    brightdata/skills

    Replicate the visual style of any website and apply it to your existing codebase.

    264 GitHub starsUsed in 1 repo~2.1k tokens
    Auto-check passed
  • Brightdata Proxy

    brightdata/skills

    Generate working code that routes HTTP requests through Bright Data proxy networks (Datacenter, ISP, Residential, Mobile) and help users decide which network and IP pool type to use (shared pool…

    264 GitHub stars~5.1k tokensUpdated today
    Auto-check passed
  • Bright Data MCP

    brightdata/skills

    Bright Data MCP handles ALL web data operations. An agent skill from brightdata/skills.

    264 GitHub starsUsed in 1 repo~3.7k tokens
    Auto-check passed
  • Live Research

    brightdata/skills

    Produce a deep, multi-source, cited research brief on a topic from live web data using Bright Data's Discover API (intent-ranked web search + parsed page content).

    264 GitHub stars~1.8k tokensUpdated today
    Auto-check passed
  • Brightdata SDK JS

    brightdata/skills

    Web data extraction and discovery using the Bright Data JavaScript/TypeScript SDK (@brightdata/sdk).

    264 GitHub stars~3k tokensUpdated today
    Auto-check passed
  • Data Feeds

    brightdata/skills

    Extract structured data from 40+ supported platforms (Amazon, LinkedIn, Instagram, TikTok, Facebook, YouTube, Reddit, and more) via the Bright Data CLI (bdata pipelines).

    264 GitHub stars~2.2k tokensUpdated today
    Auto-check passed

Works with

Questions about RAG Pipeline

What does RAG Pipeline do?

Build a RAG (retrieval-augmented generation) pipeline or a custom search engine on top of Bright Data's Discover API — using intent-ranked web results + parsed page content as the…. RAG Pipeline is an agent skill from brightdata/skills. Build a RAG (retrieval-augmented generation) pipeline or a custom search engine on top of Bright Data's Discover API — using intent-ranked web results + parsed page content as the retrieval/ingestion layer for an LLM or vector store.

When should I use RAG Pipeline?

RAG Pipeline fits situations like: the user wants to build a RAG pipeline; add web search to my LLM/agent; ground my model in live web data; build a search engine over the web.

How do I install RAG Pipeline in Claude Code?

Run `npx skills add brightdata/skills --skill rag-pipeline -a claude-code`. Or copy the skill folder (skills/rag-pipeline in brightdata/skills) into .claude/skills/rag-pipeline in your project. Claude Code loads it when a task matches its description.

How do I install RAG Pipeline in Codex?

Run `npx skills add brightdata/skills --skill rag-pipeline -a codex`. Or copy the skill folder (skills/rag-pipeline in brightdata/skills) into .agents/skills/rag-pipeline in your project. Codex loads it when a task matches its description.

Can I use RAG Pipeline in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add brightdata/skills --skill rag-pipeline -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-pipeline, .gemini/skills/rag-pipeline, .github/skills/rag-pipeline and .opencode/skills/rag-pipeline in your project.

What does RAG Pipeline need to run?

Going by SKILL.md and its folder, RAG Pipeline needs credentials named BRIGHTDATA_API_TOKEN. Our summary lists: Python 3; A credential in BRIGHTDATA_API_TOKEN.

Does RAG Pipeline access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is RAG Pipeline safe to install?

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. Review the folder before installing.

What licence does RAG Pipeline use?

RAG Pipeline is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does RAG Pipeline use?

About 1.9k tokens (SKILL.md is roughly 7.4k 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 2.6k tokens, read only when the agent opens those files.

What are the alternatives to RAG Pipeline?

Skills that share tags, products or a category with RAG Pipeline: Langchain4j RAG Implementation Patterns (giuseppe-trisciuoglio/developer-kit, 355 stars), Context Retrieval (seb1n/awesome-ai-agent-skills, 206 stars), Tavily Search API Integration (andrewyng/context-hub, 14k stars) and Sap AI Core (secondsky/sap-skills, 462 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains RAG Pipeline?

brightdata (a GitHub organization) maintains it in brightdata/skills, which has 264 GitHub stars. The repository holds 14 skills in this directory. The repository was last updated on October 7, 2026.

Source: brightdata/skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.