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

# Search memories

> Semantic similarity search over stored memories using hybrid dense + sparse retrieval. Optionally filter by category.



## OpenAPI

````yaml POST /v1/memory/search
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/search:
    post:
      tags:
        - Memory
      summary: Search memories
      description: >-
        Semantic similarity search over stored memories using hybrid dense +
        sparse retrieval. Optionally filter by category.
      operationId: search_memory
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SearchRequest'
            example:
              user_id: alice
              query: dark mode
              top_k: 10
      responses:
        '200':
          description: List of matching memories with similarity scores
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchResponse'
              example:
                results:
                  - memory_id: mem_3f7a1c2d9e4b
                    content: I prefer dark mode and short answers.
                    category: preference
                    score: 0.94
components:
  schemas:
    SearchRequest:
      type: object
      required:
        - user_id
        - query
      properties:
        user_id:
          type: string
        query:
          type: string
          description: Semantic search query.
        app_id:
          type: string
          nullable: true
        workspace_id:
          type: string
          nullable: true
        agent_id:
          type: string
          nullable: true
        top_k:
          type: integer
          default: 10
          description: Number of results to return.
        category:
          type: string
          nullable: true
          description: >-
            Filter by memory category: preference, fact, instruction, event, or
            entity.
          enum:
            - preference
            - fact
            - instruction
            - event
            - entity
    SearchResponse:
      type: object
      properties:
        results:
          type: array
          items:
            $ref: '#/components/schemas/SearchResult'
    SearchResult:
      type: object
      properties:
        memory_id:
          type: string
        content:
          type: string
        category:
          type: string
          nullable: true
        score:
          type: number
          format: float
          description: Similarity score between 0 and 1.

````