Ask Collection
collection.askAnswer questions by finding relevant information in a document collection and providing a cited answer.
Instructions
Answer a question using RAG over a document collection. Retrieves relevant chunks then synthesizes a cited answer with source attribution. Use when you need a direct answer grounded in your collection documents. For raw matching chunks (without synthesis), use collection.search instead. For single-document Q&A, use url.qa instead. PREREQUISITE: Collection must be populated via collection.add_document and indexed before results appear. Returns: { answer: string, sources: [{ bundle_id, chunk_id }], retrieval: [{ bundle_id, chunk_id, text, score }] } Example prompts:
"What are the key terms of the service agreement in my collection?"
"Based on my due diligence docs, what are the main risks?"
"Answer this question using all documents in the Q4 Contracts collection."
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| question | Yes | Natural language question to answer from collection documents. Example: "What are the key terms of the service agreement?" | |
| max_chunks | No | Max chunks to retrieve for context (default 8). Increase for broad questions, decrease for precision. Example: 12 | |
| collection_id | Yes | Collection ID (col_...) returned by collection.create. Example: "col_550e8400-e29b-41d4-a716-446655440000" |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| answer | Yes | ||
| sources | Yes | ||
| retrieval | Yes |