Inspiration

As a software engineer on a development team of only two people, I worked extensively alongside coding agents to build a fully functional internal ERP system for our company. That experience taught me that nearly every business process eventually points back to data. ERP data grows continuously, changes rapidly, and becomes increasingly difficult for humans to inspect record by record. I can place any interface I want over that data, but the underlying records still need to be understood, tested, corrected, and optimized at an atomic level. That led to a question: what if an AI agent could reason directly over ERP data without being given unrestricted authority over it? AERPO began as a controlled experiment using synthetic business data inside a realistic database schema. The goal was not simply to make an agent autonomous. It was to discover how much useful autonomy I could provide while keeping every meaningful action observable, constrained by protocol, and accountable to a human reviewer.

What It Does

Autonomous Enterprise ERP Optimizer, or AERPO, is a human-in-the-loop system that reviews ERP ledger records and identifies potential risks, duplicates, missing evidence, and correction opportunities. For every ledger it reviews, the agent must:

  • Generate a ledger-specific hypothesis.
  • Define a test that could disprove its own conclusion.
  • Identify the evidence needed to make a reliable decision.
  • Report a confidence score.
  • Propose only an explicitly permitted action. The agent cannot freely modify the database. Corrections are created as proposals that humans can inspect, edit, approve, reject, and apply through a constrained workflow. Human decisions also carry protocol meaning. Approval permits finalization, rejection marks a ledger as a duplicate candidate without deleting it, and an evidence request sends the agent back into an evidence-gathering loop. Every step is recorded in live telemetry, allowing users to observe what the agent considered, how confident it was, what could invalidate its conclusion, and which action it attempted to take.

How I Built It

AERPO uses a Next.js and TypeScript interface deployed through Vercel, with Supabase providing PostgreSQL storage and real-time database events. The optimization service is written in Python and runs as a Vercel Python function. It sends structured ledger context to an NVIDIA Nemotron model through Nebius, then validates the result using strict Pydantic response contracts. The system combines several layers of control:

  • Application-level agent protocols
  • Strict structured-output validation
  • Database action allowlists
  • Human approval requirements
  • PostgreSQL constraints and idempotency protections
  • Read-only prompt and evidence workflows
  • Real-time telemetry and workflow updates
  • Controlled correction proposals separated from execution The frontend includes an executive scorecard, ledger review queue, approval workflow, correction editor, global ledger detail modal, agent conversation history, and live logic telemetry.

Challenges I Ran Into

One of the largest challenges was learning that valid JSON is not necessarily a valid decision. The agent occasionally returned the wrong data shape, used placeholder text from the response contract, referenced the wrong ledger, proposed a correction that did not change anything, or attempted to create a proposal that already existed. Instead of hiding those failures, I turned them into protocol boundaries. The system now detects schema drift, ledger ID mismatches, duplicate pending corrections, same-value updates, unsupported database fields, and generic telemetry. The agent receives one constrained opportunity to correct its response. If it still fails, the action is blocked and recorded as a protocol violation. I also had to coordinate real-time updates across human decisions, agent responses, correction proposals, and finalized ledgers. Deployment introduced another challenge because Vercel’s Python functions and the local Next.js development server use different routing behavior. Each of these problems helped us move from a convincing demonstration to a system with enforceable operational boundaries.

Accomplishments That I Am Proud Of

I am especially proud that AERPO does more than generate recommendations. It demonstrates a complete, observable decision lifecycle. A user can create a ledger, initiate an agent review, inspect the agent’s reasoning, ask follow-up questions, request evidence, review a proposed correction, edit that proposal, approve or reject it, and apply an approved change without giving the agent unrestricted database access. The agent also responds honestly when the available data cannot support an answer. Rather than inventing certainty, it can return Unknown, identify missing evidence, or block its own action when confidence and protocol requirements are not satisfied. Most importantly, the system treats protocol violations as useful information. They become visible telemetry that helps us improve both the agent and the boundaries surrounding it.

What I Learned

I learned that reliable agentic software is not created by writing one perfect prompt. It is created by building layers of verification around an imperfect reasoning system. Protocols are not merely instructions given to the model. They are enforceable contracts distributed across model prompts, application validation, database constraints, human decisions, and execution permissions. I also learned that uncertainty is valuable. An agent that explains what it does not know, identifies the evidence it needs, and defines how its own hypothesis could be disproven is more useful than one that always produces a confident answer. The most effective architecture was not AI replacing human judgment. It was AI performing continuous analysis while humans retained authority over consequential changes.

What’s Next for Autonomous Enterprise ERP Optimizer (AERPO)

The next major step is a document evidence workflow. Users will be able to attach invoices, purchase orders, quotes, contracts, and approval records directly to a ledger. AERPO will extract relevant information, compare it against the ledger, cite the supporting document, and rerun its hypothesis and falsification protocol using the new evidence. Future development will also include:

  • Expanded correction types beyond ledger status
  • Domain-specific financial and procurement protocols
  • Historical decision replay and agent evaluations
  • Better document extraction and evidence citations
  • Configurable risk thresholds by department
  • Protocol versioning and audit history
  • Multi-tenant access controls for production environments
  • Learning from previously approved and rejected proposals The long-term vision is an ERP environment where AI can reason continuously over changing enterprise data, while protocols ensure that autonomy remains inspectable, reversible, and accountable.

Built With

Share this project:

Updates

Submission history