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

# Train Neo4J Text

> Start a knowledge graph training task using raw text input.



## OpenAPI

````yaml post /v4/knowledge_graph/neo4j/text/
openapi: 3.0.3
info:
  title: Lyzr Knowledge Graph Text Training API
  version: 1.0.0
  description: >-
    API endpoint to start a training task for Neo4j knowledge graph using raw
    text input.
servers:
  - url: https://rag-prod.studio.lyzr.ai
security: []
paths:
  /v4/knowledge_graph/neo4j/text/:
    post:
      summary: Train Neo4J Text
      description: Start a knowledge graph training task using raw text input.
      operationId: trainNeo4jText
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Neo4jTextTrainingRequest'
            example:
              rag_id: 654c602a46c3b6d4e28741b0
              text: The main product is Gemini. It is an AI model.
              schema_prompt: Focus only on products and models as nodes.
      responses:
        '200':
          description: Successful Response (Training task started).
          content:
            application/json:
              schema:
                type: string
                example: Task successfully started.
        '422':
          description: Validation Error (e.g., missing 'rag_id' or 'text' fields).
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: array
                    items:
                      $ref: '#/components/schemas/ValidationError'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    Neo4jTextTrainingRequest:
      type: object
      required:
        - rag_id
        - text
      properties:
        rag_id:
          type: string
          description: >-
            The ID of the RAG system to train the knowledge graph for (e.g., a
            24-character hex string).
          example: 654c602a46c3b6d4e28741b0
        text:
          type: string
          description: >-
            The raw text content to be processed and used for knowledge graph
            generation.
          example: >-
            Albert Einstein was born in Germany. He developed the theory of
            relativity.
        schema_prompt:
          type: string
          description: >-
            Allowed nodes and relationships for the knowledge graph (optional
            prompt for the LLM).
          nullable: true
        extra_info:
          type: object
          description: >-
            Additional information or configuration for the task, provided as a
            JSON object.
          example: {}
          nullable: true
    ValidationError:
      type: object
      properties:
        loc:
          type: array
          items:
            oneOf:
              - type: string
              - type: integer
        msg:
          type: string
        type:
          type: string
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````