Developer

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.

POST/v1/kb/search

Returns the passages that best match a query, as citation objects. Requires the kb:search scope.

Search parameters
ParameterDescription
querystringRequiredWhat to search for, up to 8,000 characters.
sourcesarray of stringsRequiredKnowledge scopes to search, for example public_kb. The key must allow each one.
top_kintegerResults to return, from 1 to 50. Default 10.
source_typesarray of stringsOnly return results from these source types.
min_scorenumberMinimum similarity from 0 to 1. Default 0.3.

Upload a document

POST/v1/kb/documents

Adds a document and queues it for processing. Send JSON with text, or multipart form data with a file. Requires the kb:documents:write scope.

Do not send protected health information yet.A Business Associate Agreement (BAA) with Health Council must be signed before any protected health information reaches the API. Use synthetic or deidentified data until then.
Upload parameters
ParameterDescription
titlestringDocument title, up to 500 characters. Required for JSON; multipart uploads default to the file name.
textstringDocument text, up to 2,000,000 characters. Required for JSON uploads.
filefileMultipart uploads only: the document itself, instead of text.
descriptionstringUp to 2,000 characters.
source_typestringOne of cdc, guideline, html, journal, manual, markdown, openfda, pmc, txt. Default manual.
visibilitystringprivate, customer, or public. Default private.
tagsarray of stringsLabels to store with the document. Multipart uploads accept a comma separated list.
canonical_urlstringWhere 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

GET/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.