Skip to main content

Build index

Read documents (files or folders) and texts, split them into passages and write a knowledge index, with embeddings when a model connection is given.

Command in the Knowledge Q&A toolkit · id ooa.knowledge/build_index · 13 inputs, 3 outputs

Inputs​

InputTypeRequiredDefaultWhat it is
FilesListNoFiles and folders to read (folders with their sub-folders).
TextsListNoTexts to add, each a dictionary with source and text (for example from the PDF or OCR toolkit).
Index fileFileNoThe index file, e.g. knowledge/policies.json (.json.gz keeps it smaller).
ConnectionStringNoA saved model connection for embeddings, e.g. one for text-embedding-3-small; without one the index is searched by words only.
ProviderStringNoEmbedding provider, when not using a saved connection.
ModelStringNoEmbedding model (the deployment for Azure OpenAI).
API keyCredentialNoAPI key or access token from the vault (not needed for some self-hosted endpoints). For AWS Bedrock and AWS SageMaker: the AWS secret access key (or ACCESS_KEY_ID:SECRET). For Google Vertex AI: a service-account JSON key or an access token.
Endpoint addressStringNoEndpoint; required for Azure OpenAI, Vertex AI (https://REGION-aiplatform.googleapis.com/v1/projects/PROJECT/locations/REGION) and self-hosted models (for a TGI server, e.g. http://tgi-host:8080/v1).
Chunk sizeNumberNo1000Passage length in characters.
OverlapNumberNo150Characters each passage shares with the one before, so no sentence is cut off from its context.
Hide personal dataBooleanNofalseMask emails, phone and card numbers before they are sent for embedding (search by those then works by words only).
Knowledge baseStringNoA knowledge base kept in One CommandCenter (AI > Knowledge bases), by name; in Studio without One CommandCenter, knowledge-bases/<name>.json.gz in the work folder.
UrlsListNoWeb pages to read (https:// addresses of intranet or public pages; HTML, text or PDF).

Outputs​

OutputTypeWhat it is
passagesNumberHow many passages the index holds.
documentsNumberHow many documents were read.
skippedListFiles that could not be read, with the reason.