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

# Create triples

> Create one or more triples. Entities are automatically created/disambiguated based on subject and object names.



## OpenAPI

````yaml api-reference/openapi.json post /api/triples
openapi: 3.1.0
info:
  title: Neode API
  description: >-
    A knowledge graph API for storing, querying, and generating triples. Use
    Neode as a triples store for your LLM applications - store facts, query
    knowledge, and generate new triples from any context.
  version: 1.0.0
  contact:
    name: Neode
servers:
  - url: https://www.neode.ai
    description: Production server
  - url: http://localhost:5173
    description: Local development
security:
  - BearerAuth: []
tags:
  - name: Search
    description: Semantic search across your knowledge graph
  - name: Triples
    description: Store and query knowledge as subject-predicate-object triples
  - name: Entities
    description: Manage entities (subjects and objects) with automatic disambiguation
  - name: Graphs
    description: Organize triples into graphs
  - name: Generation
    description: AI-powered triple generation from natural language
  - name: Indexes
    description: Organize entities into indexes
paths:
  /api/triples:
    post:
      tags:
        - Triples
      summary: Create triples
      description: >-
        Create one or more triples. Entities are automatically
        created/disambiguated based on subject and object names.
      operationId: createTriples
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TripleBatchCreate'
            examples:
              single:
                summary: Single triple
                value:
                  triples:
                    - subject: Elon Musk
                      predicate: founded
                      object: SpaceX
                      object_type: entity
                      confidence: 0.95
                      source: https://wikipedia.org/wiki/SpaceX
                  index_id: 550e8400-e29b-41d4-a716-446655440000
              batch:
                summary: Multiple triples
                value:
                  triples:
                    - subject: Tesla
                      predicate: headquarters_in
                      object: Austin, Texas
                      object_type: entity
                      confidence: 0.9
                    - subject: Tesla
                      predicate: founded_year
                      object: '2003'
                      object_type: literal
                      confidence: 0.95
                  index_id: 550e8400-e29b-41d4-a716-446655440000
      responses:
        '200':
          description: Successfully created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateTriplesResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  schemas:
    TripleBatchCreate:
      type: object
      required:
        - triples
        - index_id
      properties:
        triples:
          type: array
          items:
            $ref: '#/components/schemas/TripleCreate'
        graph_id:
          type: string
          format: uuid
          description: Default graph for all triples
        index_id:
          type: string
          format: uuid
          description: Index for entity disambiguation (required)
        source:
          type: string
          description: Default source for all triples
    CreateTriplesResponse:
      type: object
      description: Response from creating triples
      properties:
        success:
          type: boolean
        message:
          type: string
        data:
          type: array
          items:
            $ref: '#/components/schemas/Triple'
        inserted_count:
          type: integer
    TripleCreate:
      type: object
      required:
        - subject
        - predicate
        - object
      properties:
        subject:
          type: string
        predicate:
          type: string
        object:
          type: string
        object_type:
          type: string
          enum:
            - literal
            - entity
          default: literal
        confidence:
          type: number
          minimum: 0
          maximum: 1
        source:
          type: string
          format: uri
        graph_id:
          type: string
          format: uuid
        index_id:
          type: string
          format: uuid
    Triple:
      type: object
      description: A knowledge triple representing a fact as subject-predicate-object
      required:
        - subject
        - predicate
        - object
        - object_type
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier
        subject:
          type: string
          description: The subject entity (e.g., 'Elon Musk', 'Tesla')
        predicate:
          type: string
          description: The relationship type (e.g., 'founded', 'located_in', 'born_on')
        object:
          type: string
          description: The object value or entity (e.g., 'SpaceX', '2003', 'Austin, Texas')
        object_type:
          type: string
          enum:
            - literal
            - entity
          description: >-
            'literal' for values (dates, numbers, text), 'entity' for references
            to other entities
        confidence:
          type: number
          minimum: 0
          maximum: 1
          description: Confidence score (0-1) indicating reliability
        source:
          type: string
          format: uri
          description: Source URL or reference for this fact
        graph_id:
          type: string
          format: uuid
          description: Graph this triple belongs to
        index_id:
          type: string
          format: uuid
          description: Index for entity disambiguation
        subject_entity_id:
          type: string
          format: uuid
          description: Auto-resolved entity ID for subject
        object_entity_id:
          type: string
          format: uuid
          description: Auto-resolved entity ID for object (when object_type is 'entity')
        created_at:
          type: string
          format: date-time
    Error:
      type: object
      properties:
        success:
          type: boolean
          example: false
        error:
          type: string
        details:
          type: string
  responses:
    BadRequest:
      description: Bad request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    InternalError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: API key for authentication

````