For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Get API Key
GuidesAPI Reference
GuidesAPI Reference
  • Getting Started
    • Introduction
    • Getting Started
    • Authentication
    • Rate Limits
    • Error Handling
  • Concepts
    • Projects & Documents
    • Document Processing
    • Knowledge & Search
    • Compliance Checking
    • Environments & Keys
    • Streaming & Async
  • How-To Guides
    • Manage Projects
    • Upload & Manage Documents
    • Query Your Knowledge Base
    • Run Compliance Checks
    • View Your Organization
Get API Key
LogoLogo
On this page
  • The big picture
  • Projects
  • Creating a project
  • Key properties
  • Documents
  • Supported file types
  • Document lifecycle
  • Chunks — what the AI actually reads
  • How they connect
  • Common patterns
  • One project per job site
  • Shared organization documents
  • Multiple projects for different purposes
Concepts

Projects & Documents

How Pyramid AI organizes your data
Was this page helpful?
Edit this page
Previous

Document Processing

The three-step upload flow and what happens behind the scenes

Next
Built with

The big picture

Everything in Pyramid AI starts with two building blocks: projects and documents.

Organization (your company)
└── Project (a job site, a tender, a department)
└── Document (a PDF, Word doc, or web page)
└── Chunks (searchable pieces the AI reads)

Think of it like a filing system:

  • Your organization is the office
  • Projects are the filing cabinets — one per job, tender, or topic
  • Documents are the files inside each cabinet
  • Chunks are the individual pages the AI actually reads when answering questions

Projects

A project is a container that groups related documents together. When you ask a question or run a compliance check, you always specify which project to search — the AI only looks at documents in that project.

Why projects matter:

  • A question about “fire safety requirements” will give different answers depending on whether you’re searching a Hong Kong construction project or a Saudi residential project
  • Projects keep knowledge isolated so answers are always relevant to the right context

Creating a project

$curl -X POST https://api.pyramid-ai.com/api/v2/projects \
> -H "Authorization: Bearer pai_live_YOUR_KEY" \
> -H "Content-Type: application/json" \
> -d '{
> "name": "Marina Bay Tower",
> "description": "Safety and compliance docs for the Marina Bay project"
> }'

Key properties

FieldDescription
idUnique identifier (UUID) — used in all other API calls
nameHuman-readable project name
descriptionOptional context about what this project contains
document_countNumber of documents uploaded to this project
created_atWhen the project was created

Deleting a project requires removing all its documents first. This prevents accidental data loss.

Documents

A document is any file you upload to a project. Once uploaded and processed, the AI can search through it to answer questions, verify compliance, and power chat conversations.

Supported file types

TypeExtensions
PDF.pdf
Microsoft Word.doc, .docx
Plain text.txt
Web contentScraped via platform (not API yet)

Document lifecycle

Every document goes through a series of states from upload to ready:

Reserve upload slot ──> Upload file bytes ──> Trigger processing
│
┌──────────┴──────────┐
▼ ▼
ready failed
(searchable) (check error_message)
StatusWhat it means
awaiting_uploadUpload slot reserved, waiting for file bytes
processingAI is extracting text, splitting into chunks, and indexing
completed / readyDocument is fully processed and searchable
failedSomething went wrong — check error_message for details

Documents are only searchable after reaching completed status. Queries against a project with documents still processing will not include those documents in results.

Chunks — what the AI actually reads

When a document is processed, Pyramid splits it into chunks — small, overlapping sections of text (typically a few paragraphs each). This is how the AI finds relevant information quickly without reading the entire document every time.

When you get a response from the Agent or Check APIs, the sources array tells you exactly which chunks were used — including the document name and the specific section.

You don’t manage chunks directly. They’re created automatically during processing and cleaned up when a document is deleted.

How they connect

Here’s how a typical flow works, from project creation to getting answers:

1

Create a project

POST /api/v2/projects — gives you a project_id

2

Upload documents

POST /api/v2/documents → upload file → POST /api/v2/documents/process

3

Wait for processing

GET /api/v2/documents/{id} — poll until status is completed

4

Query or check

Use the project_id with Agent (/agent/query, /chat) or Check (/check/verify, /check/runs) endpoints

Common patterns

One project per job site

Most construction clients create one project per physical site or contract. All handbooks, method statements, and safety documents for that site go into one project.

Shared organization documents

Some documents (like company-wide safety policies) apply to every project. Upload these to each relevant project, or use the platform UI to manage organization-level documents.

Multiple projects for different purposes

A compliance team might create separate projects for different standards:

  • “HK Building Regulations” — all Hong Kong construction codes
  • “Marina Bay Tower” — site-specific documents
  • “Company Safety Policy” — internal standards

Then run compliance checks against the appropriate project depending on what they’re verifying.