Developer guides

Connect your AI to reviewed Wiki evidence

Retrieve reviewed reference passages over HTTP, then use them with your chosen AI model. Your authorized application server handles access, retrieval and citations; the Wiki supplies evidence independently of the answer provider.

From question to cited answer

  1. Authorize access

    Use the current eligible Wiki administrator’s short-lived access token. Access requires an active session, enabled administrator registry and approved organization membership. Verified MFA requires AAL2. Select an authorized organization with X-Organization-ID when needed.

  2. Retrieve evidence

    Call the reference retrieval endpoint from your server. Wiki searches authorized, published sources whose review is current. Keep tokens out of browsers, prompts and logs; legacy awk_ integration keys are disabled.

  3. Ground your answer

    Validate tool arguments and pass excerpts to your model as untrusted evidence, never instructions. Preserve citations and licensing. If evidence is insufficient, show that state. Similarity scores do not measure clinical certainty.

Retrieve reference passages

These examples require your own authorized session flow. Obtain and refresh the administrator token there; it is not a permanent application key. Send general knowledge questions without patient identifiers or copied patient records.

POSThttps://wiki.aimedis.com/api/v1/retrieve

TypeScript · application server

export async function retrieveWikiEvidence(
  wikiAdminAccessToken: string,
  query: string,
) {
  const response = await fetch(
    "https://wiki.aimedis.com/api/v1/retrieve",
    {
      method: "POST",
      headers: {
        Authorization: `Bearer ${wikiAdminAccessToken}`,
        "Content-Type": "application/json",
      },
      body: JSON.stringify({
        query,
        corpus: "reference",
        limit: 6,
      }),
      signal: AbortSignal.timeout(120_000),
      redirect: "error",
      cache: "no-store",
    },
  );
  if (!response.ok) {
    throw new Error(`HTTP ${response.status}`);
  }
  return response.json();
}

cURL · terminal

curl --fail-with-body --max-time 120 \
  --request POST 'https://wiki.aimedis.com/api/v1/retrieve' \
  --header 'Authorization: Bearer <WIKI_ADMIN_ACCESS_TOKEN>' \
  --header 'Content-Type: application/json' \
  --data '{"query":"Evidence appraisal methods","corpus":"reference","limit":6}'

Examples only: replace the token placeholder or pass the current session token to the function. No request runs on this page.

Request contract

FieldContract
AuthorizationRequired short-lived administrator Bearer token; knowledge:read permission applies.
queryNonempty string, up to 4,000 characters.
corpusUse reference for this integration. Patient access has separate tenant, subject and processing requirements.
limitInteger from 1 to 20; default 6.

Retrieval allows 30 requests per minute per tenant and actor, within the shared 120-per-minute API budget. Responses are not cacheable. Wiki needs configured Voyage retrieval; your own answer model needs no Wiki answer-provider key.

Keep the evidence and its provenance

The response contains hits, insufficientEvidence and mode: voyage-vector. Each hit provides the following fields; optional locators appear only when available.

id · sourceId
Passage and source identifiers for traceable citations.
title · content
Source title and retrieved excerpt.
version · license
Source version and recorded content license.
score · corpus
Retrieval similarity and the reference corpus.
sourceUrl? · page? · startSeconds?
Optional source URL, page or audio/video timestamp.

Handle empty evidence and failures

An empty hits array is a valid insufficient-evidence result. REST errors contain error and sometimes requestId; preserve X-Request-ID for support without logging tokens or source content.

400 / 413
Correct invalid input or oversized requests before retrying.
401 / 403
Refresh an eligible session or resolve access and MFA requirements; respect denial.
429
Back off with jitter and reduce concurrency.
500 / 503
Handle dependency or server failure explicitly; use bounded retries for retrieval.

Other integration paths

Limited MCP bridge

POST /api/v1/mcp

The administrator-authenticated, stateless JSON-RPC bridge supports initialize, notifications/initialized, tools/list and tools/call. Its knowledge_search and source_get tools exclude patient records. OAuth discovery and SSE transport are not supplied; connector compatibility needs validation.

Let Wiki generate the answer

POST /api/v1/ask

The optional ask endpoint returns an answer with citations using a configured Wiki provider. Use retrieve when your application supplies the model. The TypeScript SDK is repository source, not a published npm package.

OpenAPI · administrator authentication required

The authenticated schema describes the administrator API; the separate Care Pro reference contract is not included.

Arrange approved access and verify the integration with fictional fixtures before enabling your workflow.

Request integration access