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

# Index Db Nl

> Explore a DB schema, generate SQL from natural language, and index results into RAG.



## OpenAPI

````yaml /api-reference/openapi.json post /api/rag/index-db-nl
openapi: 3.1.0
info:
  title: apowerb API
  description: REST API of the apowerb agentic framework (open-source edition).
  version: 0.1.2
  license:
    name: MIT
    url: https://github.com/apowerb/apowerb/blob/main/LICENSE
servers:
  - url: https://api.example.com
    description: Your apowerb instance
  - url: http://localhost:8000
    description: Local stack
security: []
paths:
  /api/rag/index-db-nl:
    post:
      tags:
        - rag
      summary: Index Db Nl
      description: >-
        Explore a DB schema, generate SQL from natural language, and index
        results into RAG.
      operationId: index_db_nl_api_rag_index_db_nl_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/IndexDbNlRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    IndexDbNlRequest:
      properties:
        agent_id:
          type: string
          title: Agent Id
        session_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Session Id
        nl_description:
          type: string
          title: Nl Description
        name:
          type: string
          title: Name
        credentials:
          anyOf:
            - $ref: '#/components/schemas/DbCredentials'
            - type: 'null'
        tool_config_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Tool Config Id
        save_connector:
          type: boolean
          title: Save Connector
          default: false
        connector_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Connector Name
      type: object
      required:
        - agent_id
        - nl_description
        - name
      title: IndexDbNlRequest
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    DbCredentials:
      properties:
        host:
          type: string
          title: Host
        port:
          type: integer
          title: Port
          default: 5432
        database:
          type: string
          title: Database
        user:
          type: string
          title: User
        password:
          type: string
          title: Password
        schema_name:
          type: string
          title: Schema Name
          default: public
      type: object
      required:
        - host
        - database
        - user
        - password
      title: DbCredentials
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````

## Related topics

- [RAG](/guides/rag.md)
- [Index Db](/api-reference/rag/index-db.md)
- [Tools](/concepts/tools.md)
- [Index Files](/api-reference/rag/index-files.md)
- [Index S3](/api-reference/rag/index-s3.md)
