Inspiration

Administrative intake often begins with incomplete messages, scattered documents, and unclear facts. Professionals must organize that information, identify what is missing, contact the applicant, and document every decision.

AI can help with this work, but it should not invent facts, apply hidden rules, or make final administrative decisions.

That inspired Expediente Cero: a human-centered workspace that uses AI to prepare synthetic administrative cases for professional review while keeping rule-based validation and final decisions outside the model.

What it does

Expediente Cero supports three synthetic administrative procedures:

  • self-employment registration;
  • employee hiring;
  • grant requests.

A reviewer can create or open a case and move it through a controlled workflow:

  1. GPT-5.6 turns the source message into typed, structured facts.
  2. Independent application rules check required fields, dates, documents, and inconsistencies.
  3. GPT-5.6 drafts a follow-up message based on verified missing information.
  4. A human reviewer can edit that message and approve or reject the case.
  5. Every important action is stored in an audit timeline.

The application supports Spanish and Galician. It uses only synthetic test data and does not submit applications, determine eligibility, or replace professional advice.

How we built it

The backend is built with Python and FastAPI, using typed schemas throughout the API and domain layers. SQLAlchemy, Alembic, and SQLite provide persistence, migrations, versioned outputs, and audit events.

GPT-5.6 is integrated through the OpenAI Responses API with Structured Outputs. The model handles bounded tasks such as extracting facts and drafting follow-up messages.

Deterministic Python services validate the structured results independently. Model output, rule-based findings, and human decisions are stored as separate records so their responsibilities remain clear.

The reviewer interface is built with Next.js, React, and TypeScript. It provides a case queue, structured analysis views, validation findings, editable follow-up drafts, human decision controls, and a complete event timeline.

The API and web application are deployed on Render, while GitHub Actions runs automated quality checks.

How we used Codex

Codex supported the project throughout Build Week. It helped refine the architecture, implement the FastAPI backend and reviewer interface, create database migrations, write regression and integration tests, diagnose deployment problems, and document the final verification.

Codex accelerated implementation and review, but product scope, safety boundaries, architecture, and final engineering decisions remained human-controlled.

Challenges we faced

The main challenge was separating three kinds of responsibility:

  • facts produced by the model;
  • findings produced by deterministic rules;
  • decisions made by a human reviewer.

We also had to prevent missing information from being silently guessed. Structured Outputs, strict schemas, independent validation, and regression tests helped keep unknown values explicit.

Another challenge was preserving traceability. Generated text cannot simply be overwritten, so human edits are stored as new versions while the original model output remains unchanged.

Multilingual behavior added further complexity. Spanish and Galician outputs needed to preserve meaning and source evidence without creating false contradictions during translation or extraction.

Deployment also revealed practical issues involving environment configuration, database state, frontend-to-API communication, and production verification. We resolved these through automated checks and post-deployment testing with three canonical synthetic cases.

What we learned

We learned that reliable AI workflows need more than a strong model. They also need narrow responsibilities, typed contracts, deterministic controls, immutable history, and clear human authority.

Structured Outputs made model responses easier to validate and integrate, but application code still had to verify business requirements independently.

Human review shouldn't be added as the final label. It must be enforced by the workflow, the data model, the permissions and the interface.

What's next

The next stage would add secure authentication, role-based access, PostgreSQL, encrypted document storage, configurable procedure rules, accessibility testing, and deeper observability.

The architecture could then support other document-heavy workflows where AI prepares evidence while qualified professionals remain responsible for every final decision.

Built With

Share this project:

Updates