Knowledge base
Search curated medical knowledge and your own documents.
Search Council knowledge directly, or add your own documents so grounded answers can cite them.
Search
/v1/kb/searchReturns the passages that best match a query, as citation objects. Requires the kb:search scope.
| Parameter | Description |
|---|---|
| querystringRequired | What to search for, up to 8,000 characters. |
| sourcesarray of stringsRequired | Knowledge scopes to search, for example public_kb. The key must allow each one. |
| top_kinteger | Results to return, from 1 to 50. Default 10. |
| source_typesarray of strings | Only return results from these source types. |
| min_scorenumber | Minimum similarity from 0 to 1. Default 0.3. |
Upload a document
/v1/kb/documentsAdds a document and queues it for processing. Send JSON with text, or multipart form data with a
file. Requires the kb:documents:write scope.
| Parameter | Description |
|---|---|
| titlestring | Document title, up to 500 characters. Required for JSON; multipart uploads default to the file name. |
| textstring | Document text, up to 2,000,000 characters. Required for JSON uploads. |
| filefile | Multipart uploads only: the document itself, instead of text. |
| descriptionstring | Up to 2,000 characters. |
| source_typestring | One of cdc, guideline, html, journal, manual, markdown, openfda, pmc, txt. Default manual. |
| visibilitystring | private, customer, or public. Default private. |
| tagsarray of strings | Labels to store with the document. Multipart uploads accept a comma separated list. |
| canonical_urlstring | Where the document lives, for your records. |
Files may be .pdf, .docx, .pptx, .txt, .md, .markdown, .html, .htm, up to 25 MB. The content must match its type: PDF and Office files are checked by
signature, and text formats must be UTF 8. The response returns document_id,
version_id, job_id, and a status of queued.
Check processing
/v1/kb/jobs/{job_id}Reports how far processing has come. Requires the kb:documents:read scope, and only the key that uploaded
the document can read its job.
