Skip to content

Cartex

Cartex is a sub-item enrichment pipeline for construction document takeoffs.

It receives structured extraction results from Cato-v2 — tables, text notes, and image context extracted from architectural PDF pages — and enriches each schedule row with data pulled from auxiliary tables, general notes, legend diagrams, dimension cards, and multi-label resolution.

How it works

  1. Extract — Cato-v2 renders a PDF page to an image and sends it to Gemini vision AI, producing an ExtractionResult containing tables and contextual information.
  2. Enrich — Cartex routes the extraction result through specialist strategies that run concurrently, then merges their outputs into a single list[EnrichedRow].

The enriched rows map directly to the columns of a user-defined takeoff template (windows, doors, curtain walls, etc.).

Quick start

1. Set up local environment

Create a virtual environment, install dependencies, and expose the cartex command in your shell.

python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
chmod +x ./cartex
export PATH="$PWD:$PATH"

2. Run Cartex commands

Launch the UI, run multi-document batch jobs, or open the documentation site.

cartex ui
cartex batch --jobs misc/jobs.sample.json --workers 4
cartex docs

3. Use Cartex as a Python API

Call run(...) directly when integrating Cartex into a Python workflow.

from main import run
from src.models import UserTableSchema
from src.templates import TemplateType

schema = UserTableSchema(
    template=TemplateType.STANDARD_TAKEOFF,
    columns=["Product", "Operability", "Width", "Height",
             "Quantity", "Location", "Material",
             "Rough Opening Measurements", "Special Notes"],
)
result = run("path/to/document.pdf", page_numbers=[0], schema=schema)

For multi-document regression runs, use the batch runner guidance in Using Cartex.

Documentation