search
Search
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 specific datasets.
Request Parameters
- search_type (SearchType): Type of search to perform
- datasets (Optional[List[str]]): List of dataset names to search within
- dataset_ids (Optional[List[UUID]]): List of dataset UUIDs to search within
- query (str): The search query string
- system_prompt Optional[str]: System prompt to be used for Completion type searches in Cognee
- node_name Optional[list[str]]: Filter results to specific node_sets defined in the add pipeline (for targeted search).
- top_k (Optional[int]): Maximum number of results to return (default: 10)
- only_context bool: Set to true to only return context Cognee will be sending to LLM in Completion type searches. This will be returned instead of LLM calls for completion type searches.
Response
Returns a list of search results containing relevant nodes from the graph.
Error Codes
- 409 Conflict: Error during search operation
- 403 Forbidden: User doesn’t have permission to search datasets (returns empty list)
Notes
- Datasets sent by name will only map to datasets owned by the request sender
- To search datasets not owned by the request sender, dataset UUID is needed
- If permission is denied, returns empty list instead of error
POST
Search
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.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Available options:
SUMMARIES, CHUNKS, RAG_COMPLETION, TRIPLET_COMPLETION, GRAPH_COMPLETION, GRAPH_COMPLETION_DECOMPOSITION, GRAPH_SUMMARY_COMPLETION, CYPHER, NATURAL_LANGUAGE, GRAPH_COMPLETION_COT, GRAPH_COMPLETION_CONTEXT_EXTENSION, FEELING_LUCKY, TEMPORAL, CODING_RULES, CHUNKS_LEXICAL, AGENTIC_COMPLETION Example:
[]systemPrompt
string | null
default:Answer the question using the provided context. Be as brief as possible.
Example:
[]Previous
Give Datasets Permission To PrincipalGrant 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 appropriate permissions to grant access to the specified datasets.
## Path Parameters
- **principal_id** (UUID): The UUID of the principal (user or role) to grant permission to
## Request Parameters
- **permission_name** (str): The name of the permission to grant (e.g., "read", "write", "delete")
- **dataset_ids** (List[UUID]): List of dataset UUIDs to grant permission on
## Response
Returns a success message indicating permission was assigned.
## Error Codes
- **400 Bad Request**: Invalid request parameters
- **403 Forbidden**: User doesn't have permission to grant access
- **500 Internal Server Error**: Error granting permission
Next
Search