RAG pipeline
Crawl a knowledge base into clean Markdown and feed it into a retrieval-augmented generation pipeline.
POST
RAG pipeline
Turn a documentation site, help center, or blog archive into chunked, embeddable text for a RAG
pipeline — without writing a crawler or an HTML parser.
Each line of
Use case
- Build or refresh a vector store from a docs site, knowledge base, or public wiki
- Keep an internal assistant’s context current by re-running the crawl on a schedule
- Skip boilerplate (nav, footers, ads) so embeddings aren’t diluted with layout noise
Step 1: Crawl the site into Markdown
Crawl discovers every linked page from a starting URL and scrapes each one — requestmarkdown output so every page comes back ready to chunk, with navigation and
footers already stripped (only_main_content default).
Step 2: Poll until the crawl completes
Python
Step 3: Chunk each page for embedding
When the crawl completes,s3PresignedUrls has one download link per output format you requested.
The markdown link is a ZIP archive with one .md file per crawled page, plus a manifest.json
that maps each file back to its source URL. This script downloads it, splits every page into
overlapping chunks, and writes them to documents.jsonl.
Python
documents.jsonl has the chunk text and the source URL. Pass the text to your
embedding model, then store the vector with source and chunk in your vector store so answers
can cite the page they came from.
Request highlights
Tips
- Re-run the crawl on a schedule (daily or weekly) and re-embed only pages whose content hash changed, instead of rebuilding the whole index every time.
- Use
webhookon the crawl request instead of polling if your pipeline runs as a background worker — see Delivery. - Keep
tagset per knowledge source so you can trace crawl cost and history per source in Request history.