Compile
Compilation is the process that transforms uploaded source texts — documents, transcripts, conversation threads — into the psychological primitives that define a face’s persona. The compiled output is stored in the graph and retrieved at inference time.Document types
Documents
A document is any source text that describes or characterizes the face from the outside: an interview, biography, essay, article, journal entry, or PDF. Documents are compiled into structured components that express the persona in a minimal formal language.Threads
A thread is a conversation transcript — a direct record of how the face expresses itself. Threads are compiled differently, capturing speech patterns, response style, and interaction habits.Compiling a document
Compile a document with a single call to/make. It returns 202 immediately and handles extraction + sync in the background:
Polling for progress
PollGET /v1/compile/documents/DOC_ID every 2-3 seconds to track progress:
Status transitions
| Status | Meaning |
|---|---|
null | Document created but not yet compiled (or reset) |
"preparing" | Extracting knowledge from text chunks |
"syncing" | Writing extracted knowledge to the graph |
"synced" | Compilation complete — stop polling |
"paused" | Compilation paused by user — progress preserved, call /make to resume |
"stalled" | Temporary API failure — progress saved, call /make again to resume from where it left off |
"failed" | Unrecoverable error — stop polling |
/make resumes from the last completed chunk, not from scratch.
Progress fields
| Field | Description |
|---|---|
prepare_status | Current status (see above) |
chunks_total | Total chunks the document was split into |
chunks_completed | Chunks processed so far |
current_counts | Running count of extracted components: {epsilon, beta, delta, alpha} |
Controlling compilation
| Action | Endpoint | Effect |
|---|---|---|
| Pause | POST /compile/threads/{id}/pause | Stop after current chunk. Progress preserved. Resume with /make. |
| Reset | POST /compile/threads/{id}/reset | Wipe all extraction progress. Source data preserved. Fresh /make. |
| Delete | DELETE /compile/threads/{id} | Remove thread entirely. |
/compile/documents/{id}/pause and /reset).
Lightweight polling
For polling during compilation, use?status_only=true to get a lightweight response (~170 bytes) without messages or content:
Listing documents
Deleting a document
Uploading threads
A thread is a multi-speaker conversation transcript. Upload a text file withSpeaker Name: message format:
type=thread and face_speaker to specify which speaker is the face:
face_speaker parameter maps that speaker to role=user (the face’s voice). All other speakers become role=assistant. If omitted, the first speaker is assumed to be the face.
Once uploaded, compile the thread with /make (fire-and-forget — chunked extraction + sync in one step):
/make again to resume from the last completed chunk.
Audio/video threads
Audio and video files uploaded withtype=thread are transcribed automatically with speaker diarization. The upload returns 202 immediately — transcription runs in the background.
Poll GET /v1/compile/threads/THREAD_ID until prepare_status changes from "transcribing" to null (ready to review). Speakers are labeled automatically (Speaker A, Speaker B, etc.). Use face_speaker=A to map the correct speaker.
.txt) are processed synchronously and return 200 with the full transcript immediately.
Interview threads
An interview thread is a live conversation where an AI interviewer asks questions to build the face’s persona in real time. Threads are created and advanced via the compile threads API:Interviewer billing source
Interview threads use an LLM to generate interviewer questions. How this is paid for depends on your plan and can be controlled per-request:| Source | Who pays | When used |
|---|---|---|
oauth | Your ChatGPT subscription (free) | Connect plan with linked OpenAI account |
compile | Monthly compile token quota | Connect plan with remaining quota |
credits | API credit balance | Any plan with positive balance |
oauth → compile → credits — and uses the first one available.
Explicit override: Pass interviewer_billing_source in the request body to force a specific source:
interviewer_billing_source (which path was used) and tokens_charged (compile tokens consumed for this message), so the UI can update usage in real time.
If no payment source is available, the endpoint returns 402 with a structured error indicating whether the user needs to connect their OpenAI account, add credits, or both.
Compile quota
Each plan includes a monthly compile quota measured in tokens:| Plan | Quota | Reset |
|---|---|---|
| Free | Pay-per-token | — |
| Connect | 100,000 tokens | Every 30 days |
Overflow billing
When you exceed your plan quota, compilation continues but additional tokens are billed to your credit balance at the standard rate for the underlying model. This prevents compile jobs from silently failing when you hit your quota ceiling. If your credit balance is also exhausted, compilation stops and returns402.