// DOCUMENTATION

Aegis Refine docs

Aegis is an autonomous dataset refinery. It turns messy, unstructured data into clean ShareGPT / ChatML datasets — governed by the custom Aegis-14B model on NVIDIA DGX Spark, with a human gate on every external spend and a signed audit certificate for every job.

FastAPI · Python PostgreSQL Stripe Aegis-14B · DGX Spark Ed25519 certificates

Quickstart

1
Point Aegis at your data
Give Aegis an https URL to your raw source — Discord logs, PDFs, scraped HTML, or raw JSON — and describe the dataset you want out.
2
Pay the flat fee
$20 via Stripe Checkout starts the job. A verified checkout.session.completed webhook creates the Job record and triggers Aegis-14B triage.
3
Approve any proposed spend
If the agent needs a paid external step (OCR, enrichment), it proposes a SpendTicket. You approve or reject it from the Ops console — nothing outbound runs without that gate.
4
Download dataset + certificate
Get clean JSONL plus a signed audit certificate proving exactly what happened — every action, actor, and authorization.
Start a job ↗

The Aegis loop

Every meaningful action passes through the Aegis-14B governance loop. Aegis-14B runs locally on DGX Spark and scores each job before anything outbound can run — the loop is not infrastructure, it is the product.

triage score route propose human_gate aar

The human_gate step is the one place a person is required. Everything before it is autonomous scoring; everything after it is the signed record.

Data models

Core MVP entities. These map directly to the PostgreSQL schema and to the JSON the API returns.

Jobthe unit of work
iduuidprimary key
user_iduuidowner
statusenumtriage · refining · awaiting_gate · complete · halted
complexity_scorefloat0–1 from the Aegis-14B score node
estimated_costdecimalflat fee + projected spend
input/output_pathstringsource URL and delivered JSONL
SpendTicketthe gate
iduuidprimary key
job_iduuidparent job
amountdecimalproposed external spend
descriptionstringreason / rationale
statusenumproposed · approved · rejected · executed
stripe_pi_idstringset once executed (test stub today)
AuditLogimmutable
iduuidprimary key
job_iduuidparent job
actionstringpropose_spend · human_approve · execute …
actorstringsystem / agent / human email
detailsjsonbredacted, whitelisted event payload
AuditCertificatethe deliverable
iduuidprimary key
job_iduuidparent job
json_pathstringsigned JSON certificate (AAR)
pdf_pathstringrendered PDF
signaturestringEd25519 signature

Spend gate policy

No outbound spend executes without passing the gate. The policy is evaluated on every SpendTicket the agent proposes.

# POLICY-DATA-REFINE-01
if ticket.amount <= job.auto_approve_threshold:
    authorize()              # logged, no human needed
else:
    require_human_approval()  # pauses at gate
always:
    audit_log.append(action, actor, details)

Honest status: approving a ticket marks the spend authorized (test). Outbound execution is still a test stub — no real funds move yet. Inbound revenue (the $20 Stripe Checkout) runs in Stripe test mode.

Audit certificate

Every completed job produces a signed certificate — the deliverable customers pay for. It is the full AAR record (subject, principal, task, verdict, checks) and verifies independently against the published did:web key. Available as JSON and PDF.

cert_id        string     # cert_7a2b9c4d81
job_id         string     # JOB-2026-00147
issued_at      datetime
ledger         object     # revenue, spend_authorized (test), approvals
decisions[]    array      # action, actor, amount
dataset        object     # rows, quality, pii_masked
signature      string     # ed25519
View a rendered certificate ↗

API

The endpoints below are live today (same-origin; admin routes need an X-Admin-Key). See API_CONTRACT.md for exact request/response shapes.

POST  /jobs/                  # start order → Stripe Checkout
GET   /jobs/:id               # status + gate state + certificate
POST  /jobs/:id/process       # Aegis-14B triage · quality · spend
POST  /admin/gate/:id/approve # human gate (X-Admin-Key)
POST  /jobs/:id/complete      # issue the signed AAR
GET   /jobs/:id/aar           # signed certificate
GET   /.well-known/did.json   # public key for verification
GET   /activity               # redacted live feed

Public REST PREVIEW

A versioned public REST surface for creating jobs, polling status, and approving spend tickets is coming with Team & Volume plans.

POST   /v1/jobs                # create + pay
GET    /v1/jobs/:id            # status + gate state
POST   /v1/spend_tickets/:id/approve
GET    /v1/jobs/:id/certificate