agentskit.js
RAG

RAG

Plug-and-play retrieval. Chunk, embed, search, rerank, loaders.

Want a working RAG agent rather than wiring the pipeline yourself? The Registry ships document-Q&A starters you can install and point at your data.

#Core pipeline

  • createRAG({ embed, store }) β€” one-liner ingest + retrieve + search. Defaults: chunkSize 512, chunkOverlap 50.
  • chunkText(text, { chunkSize, chunkOverlap, split? }) β€” standalone splitter. split is an optional (text: string) => string[].

#Reranking + hybrid

  • createRerankedRetriever(base, { candidatePool?, topK?, rerank? }) β€” plug in voyageReranker, jinaReranker, or the built-in bm25Rerank.
  • createHybridRetriever β€” vector + BM25 blend with weighted normalization.
  • Recipe: RAG reranking.

#Document loaders

  • loadUrl (raw response text), loadGitHubFile, loadGitHubTree, loadNotionPage, loadConfluencePage, loadGoogleDriveFile, loadPdf (BYO parser). All return InputDocument[].
  • Recipe: Document loaders.

Loader and reranker guides are available through the document loaders recipe and RAG reranking recipe.

Explore nearby

✎ Edit this page on GitHubΒ·Found a problem? Open an issue β†’Β·How to contribute β†’

On this page

Ask the docs
Ask anything about AgentsKit. Answers come from the docs corpus and cite their sources.