search
Get Search History
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 of search history items containing:
- id: Unique identifier for the search
- text: The search query text
- user: User who performed the search
- created_at: When the search was performed
Error Codes
- 500 Internal Server Error: Error retrieving search history
GET
Get Search History
Previous
SearchSearch 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 (default: GRAPH_COMPLETION). Use AGENTIC_COMPLETION to enable skills, tools and max_iter.
- **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: 15)
- **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.
- **verbose** (bool): Return detailed result information including the graph representation when available (default: false)
- **skills** (Optional[List[str]]): Skill names to load into the agentic retriever (AGENTIC_COMPLETION only)
- **tools** (Optional[List[str]]): Tool whitelist for AGENTIC_COMPLETION searches
- **max_iter** (Optional[int]): Max agentic iterations, must be >= 1 (AGENTIC_COMPLETION only)
- **include_references** (bool): Attach source references to completion-type results (default: false)
## Response
Returns a list of search results containing relevant nodes from the graph.
## Error Codes
- **403 Forbidden**: User lacks permission on the requested datasets (error body)
- **422 Unprocessable Content**: Search prerequisites not met (run add + cognify first), or skills/tools sent without search_type=AGENTIC_COMPLETION, or max_iter < 1
- **500 Internal Server Error**: Unexpected error during search
## 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 dataset_ids is provided, the datasets name list is ignored
Next
Get Search History