> ## 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.

# Recall

> 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
Field names are shown camelCased in the schema (e.g. searchType, datasetIds,
topK); both camelCase and snake_case are accepted.

- **search_type** (Optional[SearchType]): Type of search to perform
  (default: GRAPH_COMPLETION). Pass null to enable automatic query routing.
- **datasets** (Optional[List[str]]): Dataset names to search within
- **dataset_ids** (Optional[List[UUID]]): Dataset UUIDs to search within;
  take precedence over dataset names when both are provided
- **query** (str): The search query string
- **system_prompt** (Optional[str]): System prompt for completion searches
- **node_name** (Optional[List[str]]): Filter to specific node sets
- **top_k** (Optional[int]): Maximum results (default: 15)
- **only_context** (bool): Return only the LLM context
- **verbose** (bool): Verbose output
- **include_references** (bool): Include source/provenance references in
  completion results (default: true)
- **session_id** (Optional[str]): Session whose cached QA and trace entries
  should be searched
- **scope** (Optional[str | List[str]]): Memory sources to include: "graph",
  "session", "trace", "session_context", "all", "auto", or a list of these
  (default: "auto" — session first when session_id is set, else graph)

## Error Codes
- **402/403/404/409/422**: Cognee errors (payment required, permission
  denied, missing user, session-dataset conflict, prerequisites not met) return their own
  status code and message via the global error handler
- **409 Conflict**: Unexpected non-Cognee error during recall



## OpenAPI

````yaml /cognee_openapi_spec.json post /api/v1/recall
openapi: 3.1.0
info:
  title: Cognee API
  description: Cognee API with Bearer token and Cookie auth
  version: 1.0.0
servers:
  - url: https://api.cognee.ai
    description: Production server (full functionality)
  - url: http://localhost:8000
    description: Local development server (requires local setup)
security:
  - BearerAuth: []
  - ApiKeyAuth: []
tags:
  - name: activity
    description: ''
  - name: add
    description: Data ingestion endpoints for adding text, files, and structured data.
  - name: agent connections
    description: ''
  - name: agent management
    description: ''
  - name: auth
    description: >-
      Authentication endpoints for user registration, login, and token
      management.
  - name: checks
    description: ''
  - name: cognify
    description: >-
      Knowledge processing endpoints to transform raw data into knowledge
      graphs.
  - name: configuration
    description: ''
  - name: datasets
    description: Dataset management endpoints for listing, creating, and deleting datasets.
  - name: delete
    description: Data deletion endpoints (deprecated — use datasets endpoints instead).
  - name: forget
    description: ''
  - name: health
    description: ''
  - name: improve
    description: ''
  - name: integrations
    description: ''
  - name: llm
    description: ''
  - name: memify
    description: ''
  - name: ontologies
    description: ''
  - name: permissions
    description: Permission management for multi-user access control.
  - name: recall
    description: ''
  - name: remember
    description: ''
  - name: responses
    description: Response generation endpoints using the knowledge graph.
  - name: schema
    description: ''
  - name: search
    description: Search endpoints for querying the knowledge graph.
  - name: sessions
    description: ''
  - name: settings
    description: Configuration endpoints for managing Cognee settings.
  - name: skills
    description: ''
  - name: slack
    description: ''
  - name: sync
    description: ''
  - name: update
    description: ''
  - name: users
    description: User management endpoints.
  - name: visualize
    description: Graph visualization endpoints.
paths:
  /api/v1/recall:
    post:
      tags:
        - recall
      summary: Recall
      description: >-
        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

        Field names are shown camelCased in the schema (e.g. searchType,
        datasetIds,

        topK); both camelCase and snake_case are accepted.


        - **search_type** (Optional[SearchType]): Type of search to perform
          (default: GRAPH_COMPLETION). Pass null to enable automatic query routing.
        - **datasets** (Optional[List[str]]): Dataset names to search within

        - **dataset_ids** (Optional[List[UUID]]): Dataset UUIDs to search
        within;
          take precedence over dataset names when both are provided
        - **query** (str): The search query string

        - **system_prompt** (Optional[str]): System prompt for completion
        searches

        - **node_name** (Optional[List[str]]): Filter to specific node sets

        - **top_k** (Optional[int]): Maximum results (default: 15)

        - **only_context** (bool): Return only the LLM context

        - **verbose** (bool): Verbose output

        - **include_references** (bool): Include source/provenance references in
          completion results (default: true)
        - **session_id** (Optional[str]): Session whose cached QA and trace
        entries
          should be searched
        - **scope** (Optional[str | List[str]]): Memory sources to include:
        "graph",
          "session", "trace", "session_context", "all", "auto", or a list of these
          (default: "auto" — session first when session_id is set, else graph)

        ## Error Codes

        - **402/403/404/409/422**: Cognee errors (payment required, permission
          denied, missing user, session-dataset conflict, prerequisites not met) return their own
          status code and message via the global error handler
        - **409 Conflict**: Unexpected non-Cognee error during recall
      operationId: recall_api_v1_recall_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RecallPayloadDTO'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                items:
                  oneOf:
                    - $ref: '#/components/schemas/ResponseQAEntry'
                    - $ref: '#/components/schemas/ResponseAgentTraceEntry'
                    - $ref: '#/components/schemas/ResponseSessionContextEntry'
                    - $ref: '#/components/schemas/ResponseGraphEntry'
                  discriminator:
                    propertyName: source
                    mapping:
                      session:
                        $ref: '#/components/schemas/ResponseQAEntry'
                      trace:
                        $ref: '#/components/schemas/ResponseAgentTraceEntry'
                      session_context:
                        $ref: '#/components/schemas/ResponseSessionContextEntry'
                      graph:
                        $ref: '#/components/schemas/ResponseGraphEntry'
                type: array
                title: Response Recall Api V1 Recall Post
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - BearerAuth: []
        - ApiKeyAuth: []
components:
  schemas:
    RecallPayloadDTO:
      properties:
        searchType:
          anyOf:
            - $ref: '#/components/schemas/SearchType'
            - type: 'null'
          description: >-
            Search strategy, e.g. GRAPH_COMPLETION, RAG_COMPLETION, CHUNKS,
            SUMMARIES. Pass null to let cognee auto-route the query to the best
            strategy.
          default: GRAPH_COMPLETION
        datasets:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Datasets
          description: >-
            Dataset names to search within. Omit (null) to search all datasets
            you have read access to.
          examples:
            - - default_dataset
        datasetIds:
          anyOf:
            - items:
                type: string
                format: uuid
              type: array
            - type: 'null'
          title: Datasetids
          description: >-
            Dataset UUIDs to search within; takes precedence over 'datasets'
            names when both are provided. Leave empty to resolve by name.
          examples:
            - null
        query:
          type: string
          title: Query
          description: The question to answer. Required; there is no default query.
          examples:
            - What is in the document?
        systemPrompt:
          anyOf:
            - type: string
            - type: 'null'
          title: Systemprompt
          default: >-
            Answer the question using the provided context. Be as brief as
            possible.
        nodeName:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Nodename
          description: >-
            Restrict results to these node sets (the node_set values passed to
            /v1/add or /v1/remember). Omit to search all nodes.
          examples:
            - null
        topK:
          anyOf:
            - type: integer
            - type: 'null'
          title: Topk
          default: 15
        onlyContext:
          type: boolean
          title: Onlycontext
          default: false
        verbose:
          type: boolean
          title: Verbose
          default: false
        includeReferences:
          type: boolean
          title: Includereferences
          description: Include source/provenance references in completion results.
          default: false
        sessionId:
          anyOf:
            - type: string
            - type: 'null'
          title: Sessionid
          description: >-
            Session whose cached QA and trace entries should be searched. With
            search_type null and no datasets, session hits short-circuit the
            graph search.
          examples:
            - null
        scope:
          anyOf:
            - items:
                type: string
              type: array
            - type: string
            - type: 'null'
          title: Scope
          description: >-
            Which memory sources to include: 'graph', 'session', 'trace',
            'session_context', 'all', 'auto', or a list of these. Defaults to
            'auto' (session first when session_id is set, else graph).
          examples:
            - null
        contextProfile:
          type: string
          title: Contextprofile
          description: >-
            Profile to render for the 'session_context' scope: 'qa'
            (conversational) or 'agent' (tool/workflow). Ignored by other
            scopes.
          default: qa
      type: object
      required:
        - query
      title: RecallPayloadDTO
    ResponseQAEntry:
      properties:
        time:
          type: string
          title: Time
        question:
          type: string
          title: Question
        context:
          type: string
          title: Context
        answer:
          type: string
          title: Answer
        qa_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Qa Id
        feedback_text:
          anyOf:
            - type: string
            - type: 'null'
          title: Feedback Text
        feedback_score:
          anyOf:
            - type: integer
            - type: 'null'
          title: Feedback Score
        used_graph_element_ids:
          anyOf:
            - additionalProperties:
                items:
                  type: string
                type: array
              type: object
            - type: 'null'
          title: Used Graph Element Ids
        memify_metadata:
          anyOf:
            - additionalProperties:
                type: boolean
              type: object
            - type: 'null'
          title: Memify Metadata
        used_session_context_ids:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Used Session Context Ids
        source:
          type: string
          const: session
          title: Source
      type: object
      required:
        - time
        - question
        - context
        - answer
        - source
      title: ResponseQAEntry
    ResponseAgentTraceEntry:
      properties:
        trace_id:
          type: string
          title: Trace Id
        origin_function:
          type: string
          title: Origin Function
        status:
          type: string
          title: Status
        memory_query:
          type: string
          title: Memory Query
          default: ''
        memory_context:
          type: string
          title: Memory Context
          default: ''
        method_params:
          additionalProperties: true
          type: object
          title: Method Params
        method_return_value:
          title: Method Return Value
        error_message:
          type: string
          title: Error Message
          default: ''
        session_feedback:
          type: string
          title: Session Feedback
          default: ''
        source:
          type: string
          const: trace
          title: Source
      type: object
      required:
        - trace_id
        - origin_function
        - status
        - source
      title: ResponseAgentTraceEntry
    ResponseSessionContextEntry:
      properties:
        source:
          type: string
          const: session_context
          title: Source
        content:
          type: string
          title: Content
        context_profile:
          type: string
          title: Context Profile
      type: object
      required:
        - source
        - content
        - context_profile
      title: ResponseSessionContextEntry
    ResponseGraphEntry:
      properties:
        kind:
          $ref: '#/components/schemas/SearchResultKind'
        search_type:
          $ref: '#/components/schemas/SearchType'
        text:
          type: string
          title: Text
        score:
          anyOf:
            - type: number
            - type: 'null'
          title: Score
        dataset_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Dataset Id
        dataset_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Dataset Name
        metadata:
          additionalProperties: true
          type: object
          title: Metadata
          default: {}
        raw:
          additionalProperties: true
          type: object
          title: Raw
          default: {}
        structured:
          anyOf:
            - {}
            - type: 'null'
          title: Structured
        source:
          type: string
          const: graph
          title: Source
      type: object
      required:
        - kind
        - search_type
        - text
        - source
      title: ResponseGraphEntry
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    SearchType:
      type: string
      enum:
        - SUMMARIES
        - CHUNKS
        - RAG_COMPLETION
        - HYBRID_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
        - CODE
      title: SearchType
    SearchResultKind:
      type: string
      enum:
        - graph_completion
        - rag_completion
        - triplet_completion
        - cypher
        - chunk
        - summary
        - coding_rule
        - code
        - natural_language
        - temporal
        - structured
        - unknown
      title: SearchResultKind
      description: |-
        Semantic kind of a search result item.

        More precise than ``search_type`` alone — tells the caller which
        normalization shape was applied. LLM completion types all collapse
        to ``*_COMPLETION`` kinds; non-LLM retrievers produce structural
        kinds (``CHUNK``, ``SUMMARY``, ``CYPHER`` row).
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key

````