CREATE TABLE ANATEL_MANUAL_CHUNKS_RAW (
    CHUNK_ID         VARCHAR2(128)      NOT NULL,
    CHUNK_PROFILE    VARCHAR2(64)       NOT NULL,
    DOC_NAME         VARCHAR2(255)      NOT NULL,
    PAGE_START       NUMBER(10)         NOT NULL,
    PAGE_END         NUMBER(10)         NOT NULL,
    SECTION_PATH     CLOB,
    CONTENT          CLOB               NOT NULL,
    CONTENT_HASH     VARCHAR2(64)       NOT NULL,
    MODALITY         VARCHAR2(32)       NOT NULL,
    PARSER_BACKEND   VARCHAR2(32)       NOT NULL,
    TOKEN_COUNT      NUMBER(10)         NOT NULL,
    SOURCE_KIND      VARCHAR2(64)       NOT NULL,
    CREATED_AT       TIMESTAMP WITH TIME ZONE,
    METADATA         CLOB,
    EMBEDDING_INPUT  CLOB,

    CONSTRAINT PK_ANATEL_MANUAL_CHUNKS_RAW
        PRIMARY KEY (CHUNK_ID),

    CONSTRAINT CK_ANATEL_MANUAL_CHUNKS_RAW_METADATA_JSON
        CHECK (METADATA IS JSON)
);

CREATE TABLE ANATEL_MANUAL_CHUNKS_COHERE_3 (
    CHUNK_ID         VARCHAR2(128)          NOT NULL,
    CHUNK_PROFILE    VARCHAR2(64)           NOT NULL,
    DOC_NAME         VARCHAR2(255)          NOT NULL,
    PAGE_START       NUMBER(10)             NOT NULL,
    PAGE_END         NUMBER(10)             NOT NULL,
    SECTION_PATH     CLOB,
    CONTENT          CLOB                   NOT NULL,
    CONTENT_HASH     VARCHAR2(64)           NOT NULL,
    MODALITY         VARCHAR2(32)           NOT NULL,
    PARSER_BACKEND   VARCHAR2(32)           NOT NULL,
    TOKEN_COUNT      NUMBER(10)             NOT NULL,
    SOURCE_KIND      VARCHAR2(64)           NOT NULL,
    CREATED_AT       TIMESTAMP WITH TIME ZONE,
    METADATA         CLOB,
    EMBEDDING_INPUT  CLOB,
    EMBEDDING_TEXT   CLOB                   NOT NULL,
    EMBEDDING        VECTOR(1024, FLOAT32)  NOT NULL,

    CONSTRAINT PK_AMC_COHERE_3
        PRIMARY KEY (CHUNK_ID),

    CONSTRAINT FK_AMC_COHERE_3_RAW
        FOREIGN KEY (CHUNK_ID)
        REFERENCES ANATEL_MANUAL_CHUNKS_RAW (CHUNK_ID),

    CONSTRAINT CK_AMC_COHERE_3_METADATA_JSON
        CHECK (METADATA IS JSON)
);

CREATE TABLE ANATEL_MANUAL_CHUNKS_COHERE_4 (
    CHUNK_ID         VARCHAR2(128)          NOT NULL,
    CHUNK_PROFILE    VARCHAR2(64)           NOT NULL,
    DOC_NAME         VARCHAR2(255)          NOT NULL,
    PAGE_START       NUMBER(10)             NOT NULL,
    PAGE_END         NUMBER(10)             NOT NULL,
    SECTION_PATH     CLOB,
    CONTENT          CLOB                   NOT NULL,
    CONTENT_HASH     VARCHAR2(64)           NOT NULL,
    MODALITY         VARCHAR2(32)           NOT NULL,
    PARSER_BACKEND   VARCHAR2(32)           NOT NULL,
    TOKEN_COUNT      NUMBER(10)             NOT NULL,
    SOURCE_KIND      VARCHAR2(64)           NOT NULL,
    CREATED_AT       TIMESTAMP WITH TIME ZONE,
    METADATA         CLOB,
    EMBEDDING_INPUT  CLOB,
    EMBEDDING_TEXT   CLOB                   NOT NULL,
    EMBEDDING        VECTOR(1536, FLOAT32)  NOT NULL,

    CONSTRAINT PK_AMC_COHERE_4
        PRIMARY KEY (CHUNK_ID),

    CONSTRAINT FK_AMC_COHERE_4_RAW
        FOREIGN KEY (CHUNK_ID)
        REFERENCES ANATEL_MANUAL_CHUNKS_RAW (CHUNK_ID),

    CONSTRAINT CK_AMC_COHERE_4_METADATA_JSON
        CHECK (METADATA IS JSON)
);