Recall
POST /api/v1/recall β Retrieve information from the knowledge graph.
Auto-routes the query to the best retrieval strategy. This is the primary search endpoint.
include_references boolean (default true). When enabled, completion-style answers get a deterministic Evidence: block appended to the answer text, citing the source chunks or graph context. The response schema is unchanged. Set include_references to false to restore the exact prior answer text.
GET /api/v1/recall β Retrieve recall history for the authenticated user.
Recall and search history
Recall records the questions it answers. APOST /api/v1/recall that runs graph retrieval writes its question and answer into the same history that POST /api/v1/search uses, so recall traffic β including questions from agents and the Search UI, which both call recall β appears in both GET /api/v1/recall and GET /api/v1/search.
What a recall records:
- The search type that ran. If you omit
search_type, recall auto-routes the question, and the history row stores the type the router chose, such asGRAPH_COMPLETION. - One question-and-answer entry per dataset that answered. A recall spanning several datasets records a separate pair for each, attributed to that dataset, rather than one combined entry. Recalls whose results carry no dataset β which is what happens when access control is disabled β are recorded without dataset attribution.
- Unanswered questions too. A recall that matched nothing still records one entry, unattributed, with empty answer text.
COGNEE_LOG_SEARCH_HISTORY to false to stop recording history altogether.
Recall prerequisites
Recall reads from an existing knowledge graph β it does not create one. Before recall (or search) returns anything, the dataset must already be ingested and processed:POST /api/v1/remember, orPOST /api/v1/addfollowed byPOST /api/v1/cognify.
Errors raised inside Cognee reach the caller with their own status code and a single
detail field of the form "<message> [<ErrorName>]" β see Error Handling.Structured output with response_schema
The request body accepts an optional response_schema object: a JSON Schema describing the shape you want the completion to conform to, typically produced client-side with MyModel.model_json_schema(). The server rebuilds a Pydantic model from it and validates the completion against that model, so each result carries the validated payload in its structured field. Only completion-style search types support it.
recall(response_model=...) runs against a remote server, the client forwards response_model.model_json_schema() as response_schema.
Supported schema subset
The server accepts only the structural subset that Pydantic itself emits:
Two budgets guard the service against abusive schemas: nesting may not exceed 10 levels, and the schema may not declare more than 200 properties in total.
Search
POST /api/v1/search β Search for nodes in the graph database.
Provides direct control over the retrieval strategy. Accepts a search_type parameter to select a specific search mode.
include_references boolean (default true), which behaves the same as on POST /api/v1/recall: it appends an Evidence: block to completion-style answer text. Set it to false to disable.
GET /api/v1/search β Retrieve search history for the authenticated user.
Searches are recorded per dataset. A POST /api/v1/search spanning several datasets records one question-and-answer entry for each dataset that answered, rather than a single combined entry, so history grows in proportion to the datasets a search touches. See Recall and search history for the full recording rules, which are shared by both endpoints.
Visualize
GET /api/v1/visualize β Generate an HTML visualization of a datasetβs knowledge graph.
Requires a dataset_id query parameter (UUID). Returns a self-contained HTML page with an interactive graph.
POST /api/v1/visualize/multi β Generate a combined visualization from multiple usersβ datasets.
recall is recommended for most use cases. Use search when you need to specify a particular retrieval strategy.