Adds structured information to the knowledge graph. Use for storing facts AI can reference. Add to Knowledge Graph block

Overview

The Add to Knowledge Graph block ingests files into a Writer Knowledge Graph, making the information available for AI-powered search, retrieval, and question answering. You can use this block to build enterprise AI applications that need to reference company documents, policies, or structured data.
The Add to Knowledge Graph block only works for Knowledge Graphs that support file uploads. You can’t add files to Knowledge Graphs that support data connectors, like Google Drive or Notion, or URLs.
Supported file types: You can upload PDF, TXT, DOC/DOCX, PPT/PPTX, EML, HTML, SRT, CSV, or XLS/XLSX files to a Knowledge Graph.

How it works

  1. File selection: Choose the files to ingest into the Knowledge Graph.
  2. Graph specification: Select the target Knowledge Graph for ingestion.
  3. Processing: The block processes and indexes the file content.
  4. Integration: Files become available for AI-powered queries and retrieval.
The block handles the complete process of uploading files to Writer and adding them to the Knowledge Graph, including file validation, content extraction, and indexing. You don’t need to upload the files separately or provide file IDs. Once processed, the information becomes searchable through Knowledge Graph queries.

Examples

Ingest company policies

The following example shows how to add documents to a Knowledge Graph. In this example, the user uploads one or more documents via the File Input interface block, which sets the @{files} state variable to the user’s uploaded files. Blueprint flow:
  1. UI Trigger → User initiates document ingestion with a button click. The File Input interface block set the @{files} state variable to the user’s uploaded file.
  2. Add to Knowledge Graph → Ingest and add the files from the @{files} state variable to the Knowledge Graph.
  3. Set state → Store whether the files were successfully ingested so the UI can display feedback to the user.
Add to Knowledge Graph block configuration:
  • Graph Id: Support KB
  • Files: @{files}
Add to Knowledge Graph example

Fields

NameTypeControlDefaultDescriptionOptionsValidation
Graph IdGraph Id--The id for an existing knowledge graph. It has a UUID format.-Format: uuid
FilesObject-[]A list of files to be uploaded and added to the knowledge graph. You can use files uploaded via the File input component or specify dictionaries with data, type and name.--

End states

Below are the possible end states of the block call.
NameFieldTypeDescription
Success-successIf the execution was successful.
Error-errorIf the function raises an Exception.
The Add to Knowledge Graph block does not return any output.