How It Works
You provide:- Your documents, uploaded with the corpus file upload endpoint.
- Example queries for each document: up to 10 per document, each up to 400 characters.
When to Use an Advanced Source
Advanced sources work best when:- Your content is FAQ-style: each document is one answer, and the example queries are the questions.
- You’ve already optimized your chunking, for example with LlamaIndex or LangChain.
- You need precise control over what gets returned for specific queries, such as returning one product’s record when the caller asks about that product.
- Your documents are focused and self-contained, not large multi-topic files.
Creating an Advanced Source
1
Request an upload URL
documentId and a presignedUrl:2
Upload the file content
application/json) documents are returned exactly as uploaded. PDFs are converted to text.3
Create the advanced source
Call Create Corpus Source with the document IDs and the example queries for each:
Example Query Requirements
Each example query must:- be 1–400 characters long;
- contain actual content (no empty or whitespace-only queries);
- contain no null bytes;
- be distinct from the other queries for the same document.
Limits
- 10 example queries per document
- 400 characters per query
- 200 documents per source (the same as other source types)
- 10 MB per document (the same as file uploads)
- No null bytes in uploaded documents