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.
By default the request blocks until graph building finishes. Set run_in_background=true in the JSON body to return immediately and track progress with the dataset status endpoint.
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):