Extract entities and relationships

Extracts entities and relationships from a document. The entities and relationships extraction process involves:

  1. Parsing documents into semantic chunks
  2. Extracting entities and relationships using LLMs

Path parameters

idstringRequired

The ID of the document to extract entities and relationships from.

Headers

AuthorizationstringRequired

Bearer authentication of the form Bearer <token>, where token is your auth token.

X-API-KeystringRequired

Query parameters

run_with_orchestrationbooleanOptional

Whether to run the entities and relationships extraction process with orchestration.

Request

Settings for the entities and relationships extraction process.

clustering_modestringOptionalDefaults to local

Whether to use remote clustering for graph creation.

graph_extractionstringOptionalDefaults to graph_extraction

The prompt to use for knowledge graph extraction.

graph_entity_description_promptstringOptionalDefaults to graph_entity_description

The prompt to use for entity description generation.

entity_typeslist of stringsOptional

The types of entities to extract.

relation_typeslist of stringsOptional

The types of relations to extract.

chunk_merge_countintegerOptionalDefaults to 2

The number of extractions to merge into a single graph extraction.

max_knowledge_relationshipsintegerOptionalDefaults to 100

The maximum number of knowledge relationships to extract from each chunk.

max_description_input_lengthintegerOptionalDefaults to 65536

The maximum length of the description for a node in the graph.

generation_configobjectOptional

Configuration for text generation during graph enrichment.

automatic_deduplicationbooleanOptionalDefaults to false

Whether to automatically deduplicate entities.

Response

Successful Response

resultsobject

Errors