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.

Query parameters

run_type"estimate" or "run"Optional

Whether to return an estimate of the creation cost or to actually extract the document.

Allowed values: estimaterun
run_with_orchestrationbooleanOptional

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

Request

This endpoint expects an optional object.
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 4

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.

Response

Successful Response

Errors

Built with