Skip to main content

Overview

Sourcey already emits the files this retriever needs. Use SourceyRetriever to retrieve from a published Sourcey docs site. It reads search-index.json, uses llms-full.txt when present, and returns Document objects with canonical page URLs in metadata.source.

Integration details

Setup

Installation

No API key is required.

Instantiation

siteUrl should point at the root of a published Sourcey docs build.

Usage

Use within a chain

Install a chat model package. This example uses OpenAI:

Sourcey site requirements

For clean retrieval, the published Sourcey site should:
  • publish search-index.json
  • publish llms-full.txt
  • set siteUrl in sourcey.config.ts so returned citations are canonical
If llms-full.txt is not available, SourceyRetriever falls back to extracting text from the matched HTML page.

More