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

# Recall memory context

> Traverse the memory graph via BFS to find the most relevant context for a natural-language query. Returns a formatted string ready to inject into your LLM prompt.



## OpenAPI

````yaml POST /v1/memory/recall
openapi: 3.1.0
info:
  title: MemWire API
  description: >-
    Persistent AI memory infrastructure — store, recall, and search memories for
    your AI agents.
  version: 1.0.0
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
servers:
  - url: http://localhost:8000
    description: Local development server
security: []
paths:
  /v1/memory/recall:
    post:
      tags:
        - Memory
      summary: Recall memory context
      description: >-
        Traverse the memory graph via BFS to find the most relevant context for
        a natural-language query. Returns a formatted string ready to inject
        into your LLM prompt.
      operationId: recall_memory
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RecallRequest'
            example:
              user_id: alice
              app_id: my_app
              workspace_id: team_1
              query: How should I format my answers?
              top_k: 5
      responses:
        '200':
          description: Recalled context and matching paths
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RecallResponse'
              example:
                context: alice prefers dark mode and short answers.
                paths: 2
                knowledge: []
components:
  schemas:
    RecallRequest:
      type: object
      required:
        - user_id
        - query
      properties:
        user_id:
          type: string
          description: User to recall memory for.
        query:
          type: string
          description: Natural-language query to find relevant memories.
        app_id:
          type: string
          nullable: true
        workspace_id:
          type: string
          nullable: true
        agent_id:
          type: string
          nullable: true
        top_k:
          type: integer
          default: 5
          description: Maximum number of paths to return.
    RecallResponse:
      type: object
      properties:
        context:
          type: string
          description: Formatted context string ready to inject into an LLM prompt.
        paths:
          type: integer
          description: Number of supporting memory paths found.
        knowledge:
          type: array
          items:
            type: string
          description: Matching knowledge base chunks, if any.

````