Skip to main content

KnowledgeDocumentDetailRead

A knowledge document in the RAG store that an agent's chatbot can retrieve from. It is ingested from text or a file (markdown, pdf, csv, xlsx, …) into retrievable units. The Detail form additionally includes the materialized units.

idIdrequired

RAG document id.

product_id object

Main app product id that owns this knowledge document.

anyOf
integer
agent_idAgent Idrequired

Agent id whose chatbot can retrieve this knowledge.

directory_idDirectory Idrequired

Owning knowledge directory id. Every persisted knowledge document belongs to exactly one directory.

group_name object

Legacy group name mirror. Normally kept equal to the owning directory name for compatibility.

anyOf
string
titleTitlerequired

Human-readable document title, usually derived from filename or prompt name.

source_typeKnowledgeDocumentSourceTyperequired

Original source format before text extraction.

Possible values: [text, markdown, csv, xls, pdf, xlsx]

retrieval_modeKnowledgeDocumentRetrievalModerequired

How this document is materialized into retrievable units.

Possible values: [whole_document, section_under_heading, top_n_chunks, top_n_rows]

statusKnowledgeDocumentStatusrequired

Ingestion lifecycle status for this document.

Possible values: [pending, ready, failed]

source_path object

Canonical S3 path to the original source artifact.

anyOf
string
source_hash object

Hash of the effective ingested source used to detect changes.

anyOf
string
extracted_text object

Canonical extracted text derived from the original source.

anyOf
string
structure_json objectrequired

Derived structural metadata such as section counts, row counts, or page counts.

property name*any

Derived structural metadata such as section counts, row counts, or page counts.

metadata_json objectrequired

Flexible document metadata for lineage, migration, and future retrieval hints.

property name*any

Flexible document metadata for lineage, migration, and future retrieval hints.

created_atdate-timerequired

When this document row was created in the RAG database.

updated_atdate-timerequired

When this document was last re-ingested or updated.

unit_countUnit Count

Number of currently materialized retrievable units for this document.

Default value: 0
units object[]

Fully materialized retrievable units belonging to this document.

  • Array [
  • idIdrequired

    RAG unit id.

    document_idDocument Idrequired

    Parent knowledge document id.

    unit_typeKnowledgeUnitTyperequired

    How this unit was materialized: document, section, chunk, or row.

    Possible values: [document, section, chunk, row]

    title object

    Unit title used as semantic context, for example a section heading or document title.

    anyOf
    string
    heading_path object

    Full heading breadcrumb for section-like units, if available.

    anyOf
    string
    contentContentrequired

    Primary text payload returned to the chatbot when this unit is selected.

    search_textSearch Textrequired

    Normalized retrieval text used for lexical matching and as the basis for embeddings.

    ordinalOrdinalrequired

    Stable order of the unit inside its document.

    row_index object

    Original row number for row-based units, if applicable.

    anyOf
    integer
    metadata_json objectrequired

    Flexible per-unit metadata such as sheet name, headers, values, or section title.

    property name*any

    Flexible per-unit metadata such as sheet name, headers, values, or section title.

    created_atdate-timerequired

    When this unit was created in the RAG database.

  • ]
  • KnowledgeDocumentDetailRead
    {
    "id": 0,
    "product_id": 0,
    "agent_id": 0,
    "directory_id": 0,
    "group_name": "string",
    "title": "string",
    "source_type": "text",
    "retrieval_mode": "whole_document",
    "status": "pending",
    "source_path": "string",
    "source_hash": "string",
    "extracted_text": "string",
    "structure_json": {},
    "metadata_json": {},
    "created_at": "2024-07-29T15:51:28.071Z",
    "updated_at": "2024-07-29T15:51:28.071Z",
    "unit_count": 0,
    "units": [
    {
    "id": 0,
    "document_id": 0,
    "unit_type": "document",
    "title": "string",
    "heading_path": "string",
    "content": "string",
    "search_text": "string",
    "ordinal": 0,
    "row_index": 0,
    "metadata_json": {},
    "created_at": "2024-07-29T15:51:28.071Z"
    }
    ]
    }