Skip to main content
At the heart of Kodexa is the concept of a Document. A document represents the content, metadata and features associated with any type of information. Rather than storing the information as text, we store it in KDDB (Kodexa Document Database) format — a SQLite-based structure containing a hierarchical tree of content nodes, metadata, tags, features, and extracted data.

Document Structure

A Kodexa Document consists of these core components:
  • Content Node Tree: A hierarchical tree of nodes representing the document’s structure (pages, paragraphs, lines, words, tables, cells, etc.)
  • Metadata: Flexible key-value pairs for document-level information
  • Source Metadata: Information about the document’s origin (filename, MIME type, checksum)
  • Native Documents: Embedded binary files (the original PDF, images, etc.)
  • Data Objects & Attributes: Structured extracted data organized by Data Definition
  • Tags: Annotations on content nodes linking them to extracted data
  • Audit Trail: Change history tracking

Creating Documents

Documents can be created using the SDK in Python or TypeScript:

Accessing Original Source Content

Kodexa documents can embed the original source files (PDFs, images, Word documents) as native documents within the KDDB. This allows you to access the raw file data at any point during processing. You can use the get_source utility to retrieve the first embedded native document as bytes:
Alternatively, you can access native documents directly through the accessor:
This capability is particularly useful for tasks like OCR processing or extracting content directly from the original file format at any stage of the processing pipeline.

Saving Documents

Documents are saved in KDDB format (SQLite) for efficient storage and retrieval:

Next Steps