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

> Search knowledge base chunks by semantic similarity using hybrid dense+sparse retrieval.



## OpenAPI

````yaml POST /v1/knowledge/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/knowledge/search:
    post:
      tags:
        - Knowledge
      summary: Search knowledge
      description: >-
        Search knowledge base chunks by semantic similarity using hybrid
        dense+sparse retrieval.
      operationId: search_knowledge
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/KnowledgeSearchRequest'
            example:
              user_id: alice
              query: remote work policy
              top_k: 5
      responses:
        '200':
          description: Matching knowledge chunks
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KnowledgeSearchResponse'
              example:
                chunks:
                  - chunk_id: kb_3f7a1c2d9e4b_chunk_1
                    kb_id: kb_3f7a1c2d9e4b
                    content: Remote work is allowed up to 3 days per week.
                    score: 0.92
components:
  schemas:
    KnowledgeSearchRequest:
      type: object
      required:
        - user_id
        - query
      properties:
        user_id:
          type: string
        query:
          type: string
          description: Natural-language search query.
        agent_id:
          type: string
          nullable: true
        app_id:
          type: string
          nullable: true
        workspace_id:
          type: string
          nullable: true
        top_k:
          type: integer
          default: 5
          description: Number of chunks to return.
    KnowledgeSearchResponse:
      type: object
      properties:
        chunks:
          type: array
          items:
            $ref: '#/components/schemas/KnowledgeChunkResult'
    KnowledgeChunkResult:
      type: object
      properties:
        chunk_id:
          type: string
        kb_id:
          type: string
        content:
          type: string
        score:
          type: number
          format: float
          description: Similarity score between 0 and 1.

````