Skip to main content
These endpoints transform raw data into structured knowledge graphs and remove data from them.

Cognify

POST /api/v1/cognify — Transform datasets into structured knowledge graphs. Takes uploaded data and runs entity extraction, relationship detection, and embedding generation. This is the same pipeline described in Cognify.
On Cloud the request runs in the background by default (run_in_background defaults to true): it returns at once with a pipeline_run_id, and you track progress with the dataset status endpoint, or watch the dataset on Datasets. Set run_in_background=false in the JSON body to block until graph building finishes. chunks_per_batch defaults to 5000 and data_per_batch to 100. A custom graph_model is not accepted on Cloud: sending one returns 400 Custom graph_model schemas are not supported by Cloud. To steer extraction, pass custom_prompt or an ontology_key from uploaded ontologies.
Cognify turns your data into DataPoints: typed records such as documents, chunks, entities, entity types and summaries, each stored as a graph node with its embedding. They are what search and recall retrieve over, not only what the Graph page draws; its Records level shows the chunks, documents and summaries behind the entities. See DataPoints.
If you used remember to ingest data, cognify was already executed automatically. You only need to call cognify separately when using the add endpoint.

Error responses

POST /api/v1/cognify returns 402 Payment Required with body {"error": "Token budget exhausted", "detail": "..."} when the configured LLM provider or LiteLLM proxy reports token-budget exhaustion. This response is terminal — Cognee does not retry budget-exhaustion errors, so clients should not reattempt the request automatically. Handle 402 by surfacing a top-up / billing flow rather than retrying.

Forget

POST /api/v1/forget — Remove data from the knowledge graph. Deletes content from the graph, vector store, and associated metadata. See Forget for the underlying operation. Identify the target with the dataset field (the dataset name) — not dataset_name. There is no data field; to remove a single item, pass its data_id together with a dataset.

Request body

Field names are shown camelCased in the schema; snake_case aliases (data_id, dataset_id, memory_only) are accepted too.

Forget behavior

  • dataset (or datasetId) alone → delete the entire dataset and its graph/vector data.
  • dataset + dataId → delete a single item, leaving the dataset intact.
  • dataset + memoryOnly: true → clear the dataset’s memory but keep the raw files, so you can re-run cognify.
  • everything: true → wipe everything you own.

Error responses

The single quotes around the -d body in these examples are a Unix shell convention. cmd.exe and PowerShell do not strip them, so the body is sent with literal quotes and the request fails to parse.Windows cmd.exe — wrap the body in double quotes and escape the inner double quotes with \:
PowerShell — escaping is fragile; passing the JSON from a file with -d "@body.json" avoids it entirely (this also works on macOS/Linux):