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

# Add knowledge base

> Ingest a named knowledge base of document chunks. Chunks are embedded and indexed for semantic search and recall.



## OpenAPI

````yaml POST /v1/knowledge
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:
    post:
      tags:
        - Knowledge
      summary: Add knowledge base
      description: >-
        Ingest a named knowledge base of document chunks. Chunks are embedded
        and indexed for semantic search and recall.
      operationId: add_knowledge
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddKnowledgeRequest'
            example:
              user_id: alice
              name: Company Handbook
              chunks:
                - content: All employees must complete onboarding within 30 days.
                - content: Remote work is allowed up to 3 days per week.
      responses:
        '200':
          description: Knowledge base created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AddKnowledgeResponse'
              example:
                kb_id: kb_3f7a1c2d9e4b
                chunks_stored: 2
components:
  schemas:
    AddKnowledgeRequest:
      type: object
      required:
        - user_id
        - name
        - chunks
      properties:
        user_id:
          type: string
          description: User identifier.
        name:
          type: string
          description: Human-readable name for the knowledge base.
        chunks:
          type: array
          items:
            $ref: '#/components/schemas/KnowledgeChunkInput'
          description: List of document chunks to ingest.
        agent_id:
          type: string
          nullable: true
        app_id:
          type: string
          nullable: true
        workspace_id:
          type: string
          nullable: true
    AddKnowledgeResponse:
      type: object
      properties:
        kb_id:
          type: string
          description: The ID of the created knowledge base.
        chunks_stored:
          type: integer
          description: Number of chunks ingested.
    KnowledgeChunkInput:
      type: object
      required:
        - content
      properties:
        content:
          type: string
          description: The text content of this chunk.
        metadata:
          type: object
          description: Optional metadata (e.g. source, page number).
          additionalProperties: true

````