Extract entities and relationships

POST

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

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.

graphrag_relationships_extraction_few_shotstringOptionalDefaults to graphrag_relationships_extraction_few_shot

The prompt to use for knowledge graph extraction.

graphrag_entity_description_promptstringOptionalDefaults to graphrag_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 KG 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

Errors

Built with