Guides

Knowledge & Context Integration

Give your application reference material before it generates an answer. Use public sources for shared context. Use a Khizana collection for documents that you control.

Choose a source

NeedAPI
Web pages and social contentMaktaba
News editions, headlines, and articlesAkhbar
Places, geographic features, and routesAtlas
Search your own document collectionKhizana

Public-source retrieval uses the documented endpoint for each source. This guide does not define a separate universal knowledge-base endpoint.

Ground an answer

  1. Search the appropriate source API with the user's query.
  2. Select the relevant results. Keep their source references.
  3. Add the selected text to your chat completion request as reference material.
  4. Ask the model to cite those references. Check citations before you show the answer.

Treat retrieved text as source material. Keep it separate from the instructions that control your application.

Private documents

Create a collection in Khizana. Read the Khizana API guide for search-key access, document formats, widgets, and assistant integration. A path that contains /api/public/knowledge/ still requires the collection's configured access checks. It does not make all collections public.

Access and usage

Read authentication and billing before integration. Reading this documentation does not require sign-in. Calling an API or opening a private workspace can require an account, API key, and available credits.