> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cognee.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Llms api

# Cognee API Documentation

> REST API and Python API reference documentation for building against Cognee programmatically.

See the full overview at [https://docs.cognee.ai/llms.txt](https://docs.cognee.ai/llms.txt).

## REST API

* [API Reference](https://docs.cognee.ai/api-reference/introduction.md): Complete API documentation for Cognee's knowledge graph platform
* [Login](https://docs.cognee.ai/api-reference/auth/login.md)
* [Logout](https://docs.cognee.ai/api-reference/auth/logout.md)
* [Get Me](https://docs.cognee.ai/api-reference/auth/get-me.md)
* [Register:Register](https://docs.cognee.ai/api-reference/auth/register:register.md)
* [Reset:Forgot Password](https://docs.cognee.ai/api-reference/auth/reset:forgot-password.md)
* [Reset:Reset Password](https://docs.cognee.ai/api-reference/auth/reset:reset-password.md)
* [Verify:Request-Token](https://docs.cognee.ai/api-reference/auth/verify:request-token.md)
* [Verify:Verify](https://docs.cognee.ai/api-reference/auth/verify:verify.md)
* [Get Api Keys For User](https://docs.cognee.ai/api-reference/auth/get-api-keys-for-user.md)
* [Create Api Key For User](https://docs.cognee.ai/api-reference/auth/create-api-key-for-user.md)
* [Delete Api Key For User](https://docs.cognee.ai/api-reference/auth/delete-api-key-for-user.md)
* [Add](https://docs.cognee.ai/api-reference/add/add.md): Add data to a dataset for processing and knowledge graph construction. This endpoint accepts various types of data (files, URLs, GitHub repositories) and adds them to a specified dataset for processing. The data is in...
* [Cognify](https://docs.cognee.ai/api-reference/cognify/cognify.md): Transform datasets into structured knowledge graphs through cognitive processing. This endpoint is the core of Cognee's intelligence layer, responsible for converting raw text, documents, and data added through the ad...
* [Memify](https://docs.cognee.ai/api-reference/memify/memify.md): Enrichment pipeline in Cognee, can work with already built graphs. If no data is provided existing knowledge graph will be used as data, custom data can also be provided instead which can be processed with provided ex...
* [Get Search History](https://docs.cognee.ai/api-reference/search/get-search-history.md): Get search history for the authenticated user. This endpoint retrieves the search history for the authenticated user, returning a list of previously executed searches with their timestamps. ## Response Returns a list...
* [Search](https://docs.cognee.ai/api-reference/search/search.md): Search for nodes in the graph database. This endpoint performs semantic search across the knowledge graph to find relevant nodes based on the provided query. It supports different search types and can be scoped to spe...
* [Give Datasets Permission To Principal](https://docs.cognee.ai/api-reference/permissions/give-datasets-permission-to-principal.md): Grant permission on datasets to a principal (user or role). This endpoint allows granting specific permissions on one or more datasets to a principal (which can be a user or role). The authenticated user must have app...
* [Revoke Datasets Permission From Principal](https://docs.cognee.ai/api-reference/permissions/revoke-datasets-permission-from-principal.md): Revoke permission on datasets from a principal (user or role). ## Path Parameters - **principal\_id** (UUID): The UUID of the principal to revoke permission from ## Request Parameters - **permission\_name** (str): The n...
* [Create Role](https://docs.cognee.ai/api-reference/permissions/create-role.md): Create a new role. This endpoint creates a new role with the specified name. Roles are used to group permissions and can be assigned to users to manage access control more efficiently. The authenticated user becomes t...
* [Delete Role Endpoint](https://docs.cognee.ai/api-reference/permissions/delete-role-endpoint.md): Delete a role and all its associations. Removes all user-role memberships and ACL entries for this role, then deletes the role. The authenticated user must be able to manage users in the tenant. ## Path Parameters - \*...
* [Add User To Role](https://docs.cognee.ai/api-reference/permissions/add-user-to-role.md): Add a user to a role. This endpoint assigns a user to a specific role, granting them all the permissions associated with that role. The authenticated user must be the owner of the role or have appropriate administrati...
* [Remove User From Role Endpoint](https://docs.cognee.ai/api-reference/permissions/remove-user-from-role-endpoint.md): Remove a user from a role. The authenticated user must be able to manage users in the tenant. ## Path Parameters - **user\_id** (UUID): The UUID of the user to remove from the role ## Request Parameters - **role\_id** (...
* [Add User To Tenant](https://docs.cognee.ai/api-reference/permissions/add-user-to-tenant.md): Add a user to a tenant. This endpoint assigns a user to a specific tenant, allowing them to access resources and data associated with that tenant. The authenticated user must be the owner of the tenant or have appropr...
* [Remove User From Tenant Endpoint](https://docs.cognee.ai/api-reference/permissions/remove-user-from-tenant-endpoint.md): Remove a user from a tenant. The tenant owner or any user with \`has\_user\_management\_permission in the tenant (e.g. users in the Admin role) can remove users from the tenant. The tenant owner cannot be removed from the...
* [Create Tenant](https://docs.cognee.ai/api-reference/permissions/create-tenant.md): Create a new tenant. This endpoint creates a new tenant with the specified name. Tenants are used to organize users and resources in multi-tenant environments, providing isolation and access control between different...
* [Select Tenant](https://docs.cognee.ai/api-reference/permissions/select-tenant.md): Select current tenant. This endpoint selects a tenant with the specified UUID. Tenants are used to organize users and resources in multi-tenant environments, providing isolation and access control between different gr...
* [Get Tenant Roles](https://docs.cognee.ai/api-reference/permissions/get-tenant-roles.md)
* [Get Users In Role](https://docs.cognee.ai/api-reference/permissions/get-users-in-role.md)
* [Get User Roles](https://docs.cognee.ai/api-reference/permissions/get-user-roles.md)
* [Get Users In Tenant](https://docs.cognee.ai/api-reference/permissions/get-users-in-tenant.md)
* [Get My Tenants](https://docs.cognee.ai/api-reference/permissions/get-my-tenants.md)
* [Get Datasets](https://docs.cognee.ai/api-reference/datasets/get-datasets.md): Get all datasets accessible to the authenticated user. This endpoint retrieves all datasets that the authenticated user has read permissions for. The datasets are returned with their metadata including ID, name, creat...
* [Create New Dataset](https://docs.cognee.ai/api-reference/datasets/create-new-dataset.md): Create a new dataset or return existing dataset with the same name. This endpoint creates a new dataset with the specified name. If a dataset with the same name already exists for the user, it returns the existing dat...
* [Delete All](https://docs.cognee.ai/api-reference/datasets/delete-all.md): Delete all user's data. This endpoint permanently deletes all datasets that user created and all its associated data. The user must have delete permissions on the dataset to perform this operation. ## Response No cont...
* [Delete Dataset](https://docs.cognee.ai/api-reference/datasets/delete-dataset.md): Delete a dataset by its ID. This endpoint permanently deletes a dataset and all its associated data. The user must have delete permissions on the dataset to perform this operation. ## Path Parameters - **dataset\_id**...
* [Delete Data](https://docs.cognee.ai/api-reference/datasets/delete-data.md): Delete a specific data item from a dataset. This endpoint removes a specific data item from a dataset while keeping the dataset itself intact. The user must have delete permissions on the dataset to perform this opera...
* [Get Dataset Graph](https://docs.cognee.ai/api-reference/datasets/get-dataset-graph.md): Get the knowledge graph visualization for a dataset. This endpoint retrieves the knowledge graph data for a specific dataset, including nodes and edges that represent the relationships between entities in the dataset....
* [Get Dataset Data](https://docs.cognee.ai/api-reference/datasets/get-dataset-data.md): Get all data items in a dataset. This endpoint retrieves all data items (documents, files, etc.) that belong to a specific dataset. Each data item includes metadata such as name, type, creation time, and storage locat...
* [Get Dataset Status](https://docs.cognee.ai/api-reference/datasets/get-dataset-status.md): Get the processing status of datasets. This endpoint retrieves the current processing status of one or more datasets, indicating whether they are being processed, have completed processing, or encountered errors durin...
* [Get Raw Data](https://docs.cognee.ai/api-reference/datasets/get-raw-data.md): Download the raw data file for a specific data item. This endpoint allows users to download the original, unprocessed data file for a specific data item within a dataset. The file is returned as a direct download with...
* [Get Dataset Schema](https://docs.cognee.ai/api-reference/datasets/get-dataset-schema.md): Return the stored graph schema and custom prompt for a dataset.
* [Update Dataset Schema](https://docs.cognee.ai/api-reference/datasets/update-dataset-schema.md): Store or update the graph schema and custom prompt for a dataset.
* [List Ontologies](https://docs.cognee.ai/api-reference/ontologies/list-ontologies.md): List all uploaded ontologies for the authenticated user. ## Response Returns a dictionary mapping ontology keys to their metadata including filename, size, and upload timestamp. ## Error Codes - \*\*500 Internal Server...
* [Upload Ontology](https://docs.cognee.ai/api-reference/ontologies/upload-ontology.md): Upload a single ontology file for later use in cognify operations. ## Request Parameters - **ontology\_key** (str): User-defined identifier for the ontology. - **ontology\_file** (UploadFile): Single OWL format ontology...
* [Delete Ontology](https://docs.cognee.ai/api-reference/ontologies/delete-ontology.md): Delete an uploaded ontology by key. ## Path Parameters - **ontology\_key** (str): The key of the ontology to delete. ## Error Codes - **400 Bad Request**: Ontology key not found - **500 Internal Server Error**: File sy...
* [Get Settings](https://docs.cognee.ai/api-reference/settings/get-settings.md): Get the current system settings. This endpoint retrieves the current configuration settings for the system, including LLM (Large Language Model) configuration and vector database configuration. These settings determin...
* [Save Settings](https://docs.cognee.ai/api-reference/settings/save-settings.md): Save or update system settings. This endpoint allows updating the system configuration settings. You can update either the LLM configuration, vector database configuration, or both. Only provided settings will be upda...
* [Visualize](https://docs.cognee.ai/api-reference/visualize/visualize.md): Generate an HTML visualization of the dataset's knowledge graph. This endpoint creates an interactive HTML visualization of the knowledge graph for a specific dataset. The visualization displays nodes and edges repres...
* [Visualize Multi](https://docs.cognee.ai/api-reference/visualize/visualize-multi.md): Generate a combined HTML visualization of graph data from multiple users' datasets. This endpoint aggregates knowledge graphs from multiple user+dataset pairs into a single interactive visualization, with each user's...
* [Store User Configuration](https://docs.cognee.ai/api-reference/configuration/store-user-configuration.md)
* [Get User Configuration](https://docs.cognee.ai/api-reference/configuration/get-user-configuration.md)
* [Get User All Configuration](https://docs.cognee.ai/api-reference/configuration/get-user-all-configuration.md)
* [Delete](https://docs.cognee.ai/api-reference/delete/delete.md): Delete data by its ID from the specified dataset. Args: data\_id: The UUID of the data to delete dataset\_id: The UUID of the dataset containing the data mode: "soft" (default) or "hard" - hard mode also deletes degree-...
* [Update](https://docs.cognee.ai/api-reference/update/update.md): Update data in a dataset. This endpoint updates existing documents in a specified dataset by providing the data\_id of the existing document to update and the new document with the changes as the data. The document is...
* [Create Response](https://docs.cognee.ai/api-reference/responses/create-response.md): OpenAI-compatible responses endpoint with function calling support. This endpoint provides OpenAI-compatible API responses with integrated function calling capabilities for Cognee operations. ## Request Parameters - \*...
* [Generate Custom Prompt](https://docs.cognee.ai/api-reference/llm/generate-custom-prompt.md): Generate a custom extraction prompt from a provided graph model schema JSON.
* [Infer Schema](https://docs.cognee.ai/api-reference/llm/infer-schema.md): Analyze sample text and/or uploaded files, and propose a JSON Schema describing the entity types and relationships present. The returned schema can be passed directly to `/v1/llm/custom-prompt or /v1/cognify`.
* [Sync To Cloud](https://docs.cognee.ai/api-reference/sync/sync-to-cloud.md): Sync local data to Cognee Cloud. This endpoint triggers synchronization of local Cognee data to your cloud instance. It uploads your local datasets, knowledge graphs, and processed data to the cloud for backup, sharin...
* [Get Sync Status Overview](https://docs.cognee.ai/api-reference/sync/get-sync-status-overview.md): Check if there are any running sync operations for the current user. This endpoint provides a simple check to see if the user has any active sync operations without needing to know specific run IDs. ## Response Return...
* [Users:Current User](https://docs.cognee.ai/api-reference/users/users:current-user.md)
* [Users:Patch Current User](https://docs.cognee.ai/api-reference/users/users:patch-current-user.md)
* [Users:User](https://docs.cognee.ai/api-reference/users/users:user.md)
* [Users:Patch User](https://docs.cognee.ai/api-reference/users/users:patch-user.md)
* [Users:Delete User](https://docs.cognee.ai/api-reference/users/users:delete-user.md)
* [Get User Id](https://docs.cognee.ai/api-reference/users/get-user-id.md)
* [Get Connection Check Endpoint](https://docs.cognee.ai/api-reference/checks/get-connection-check-endpoint.md)
* [Health Check](https://docs.cognee.ai/api-reference/health/health-check.md): Health check endpoint for liveness/readiness probes.
* [Detailed Health Check](https://docs.cognee.ai/api-reference/health/detailed-health-check.md): Comprehensive health status with component details.
* [List Agents Endpoint](https://docs.cognee.ai/api-reference/agent-management/list-agents-endpoint.md)
* [Create Agent Endpoint](https://docs.cognee.ai/api-reference/agent-management/create-agent-endpoint.md)
* [List Agents Connections](https://docs.cognee.ai/api-reference/agent-connections/list-agents-connections.md)
* [Get My Connection Detail](https://docs.cognee.ai/api-reference/agent-connections/get-my-connection-detail.md)
* [Get Connection Detail](https://docs.cognee.ai/api-reference/agent-connections/get-connection-detail.md)
* [Register Agent Endpoint](https://docs.cognee.ai/api-reference/agent-connections/register-agent-endpoint.md)
* [Unregister Agent Endpoint](https://docs.cognee.ai/api-reference/agent-connections/unregister-agent-endpoint.md)
* [Get Agent Endpoint](https://docs.cognee.ai/api-reference/agent-management/get-agent-endpoint.md)
* [Delete Agent Endpoint](https://docs.cognee.ai/api-reference/agent-management/delete-agent-endpoint.md)
* [Get Pipeline Runs](https://docs.cognee.ai/api-reference/activity/get-pipeline-runs.md): Return recent pipeline runs with dataset owner info for agent attribution.
* [Get Spans](https://docs.cognee.ai/api-reference/activity/get-spans.md): Return in-memory OTEL spans from the CogneeSpanExporter buffer.
* [Get Tenant Users](https://docs.cognee.ai/api-reference/activity/get-tenant-users.md): Return users in the current tenant (includes agents as API key users).
* [Get Agents](https://docs.cognee.ai/api-reference/activity/get-agents.md): Return registered agents (users with @cognee.agent emails).
* [Export Dataset Markdown](https://docs.cognee.ai/api-reference/activity/export-dataset-markdown.md): Export a dataset's knowledge graph as a Markdown memory report.
* [List Sessions](https://docs.cognee.ai/api-reference/sessions/list-sessions.md): Paginated list of sessions. Response envelope:: \{ "sessions": \[...], "total": , # rows matching filters before pagination "limit": , "offset": , "has\_more": , }
* [Get Stats](https://docs.cognee.ai/api-reference/sessions/get-stats.md): Aggregate counters for the dashboard stat cards + status bar.
* [Cost By Model](https://docs.cognee.ai/api-reference/sessions/cost-by-model.md): Cost + token totals grouped by the model that produced them. Aggregates \`session\_model\_usage rows (one per session × model), so a session that used multiple models splits its cost correctly. Filters on session\_records...
* [Get Session Detail](https://docs.cognee.ai/api-reference/sessions/get-session-detail.md)
* [Remember](https://docs.cognee.ai/api-reference/remember/remember.md): Ingest data and build the knowledge graph in a single call. This endpoint combines the add and cognify steps. Data is ingested first, then automatically processed into a structured knowledge graph. ## Request Paramete...
* [Remember Entry](https://docs.cognee.ai/api-reference/remember/remember-entry.md): Store a typed memory entry in the session cache. Accepts a discriminated union of \`QAEntry, TraceEntry, FeedbackEntry, or SkillRunEntry and dispatches to the matching remember path. Session-backed entries require sess...
* [Get Recall History](https://docs.cognee.ai/api-reference/recall/get-recall-history.md): Get search/recall history for the authenticated user.
* [Recall](https://docs.cognee.ai/api-reference/recall/recall.md): Recall information from the knowledge graph. This is a memory-oriented alias for the search endpoint. All search types and options from v1 are supported. ## Request Parameters - **search\_type** (SearchType): Type of s...
* [Improve](https://docs.cognee.ai/api-reference/improve/improve.md): Enrich and improve the knowledge graph. This is a memory-oriented alias for the memify endpoint. It runs enrichment tasks on an existing knowledge graph. ## Request Parameters - **extraction\_tasks** (Optional\[List\[str...
* [Forget Endpoint](https://docs.cognee.ai/api-reference/forget/forget-endpoint.md): Remove data from the knowledge graph. - Set everything: true to delete all user data. - Set dataset or dataset\_id alone to delete an entire dataset. - Set dataset/dataset\_id + data\_id to delete a single item. - Set da...
* [Root](https://docs.cognee.ai/api-reference/health/root.md): Root endpoint that returns a welcome message.

## Python API

* [Python API Reference](https://docs.cognee.ai/python-api.md): Complete Python API reference for the cognee package
* [remember()](https://docs.cognee.ai/python-api/remember.md): Store permanent or session memory with the v1.0 ingestion API
* [recall()](https://docs.cognee.ai/python-api/recall.md): Query memory with the v1.0 retrieval API
* [improve()](https://docs.cognee.ai/python-api/improve.md): Enrich an existing graph and bridge session memory with the v1.0 API
* [forget()](https://docs.cognee.ai/python-api/forget.md): Remove data with the unified v1.0 deletion API
* [add()](https://docs.cognee.ai/python-api/add.md): Ingest data into the Cognee knowledge base
* [cognify()](https://docs.cognee.ai/python-api/cognify.md): Transform raw data into a structured knowledge graph
* [search()](https://docs.cognee.ai/python-api/search.md): Query the knowledge graph
* [memify()](https://docs.cognee.ai/python-api/memify.md): Enrich an existing knowledge graph with custom tasks
* [datasets](https://docs.cognee.ai/python-api/datasets.md): Dataset management: list, create, and delete datasets
* [update()](https://docs.cognee.ai/python-api/update.md): Update existing data in the knowledge base
* [delete()](https://docs.cognee.ai/python-api/delete.md): Delete data from the knowledge base (deprecated)
* [prune](https://docs.cognee.ai/python-api/prune.md): Clean up data and system resources
* [run\_startup\_migrations](https://docs.cognee.ai/python-api/run-migrations.md): Apply pending relational and vector database schema migrations
* [config](https://docs.cognee.ai/python-api/config.md): Configure LLM providers, databases, chunking, and more
* [SearchType](https://docs.cognee.ai/python-api/search-type.md): All available search modes
* [run\_custom\_pipeline()](https://docs.cognee.ai/python-api/custom-pipeline.md): Execute a custom task pipeline
* [Data Models](https://docs.cognee.ai/python-api/data-models.md): Key types used across the cognee API
