diudiu-tech/delivery-harness
AI harness reference implementation for on-demand delivery workflows
What it solves
This project provides a reference implementation for an AI-powered operations platform tailored for on-demand delivery services. It addresses the challenge of automating the analysis of abnormal orders and suggesting compensation for customers while ensuring that critical business logic (like actual payout amounts) remains deterministic and controlled by a rule engine rather than the AI model.
How it works
The system uses a set of fixed, synchronous workflows that integrate several components:
- AI Integration: Uses an OpenAI-compatible client to connect to models (e.g., via Ollama) to generate advisory analysis.
- Deterministic Tools: Employs synthetic business tools for order data, ETA, and station capacity to provide grounded facts to the model.
- Knowledge Retrieval: Implements a lightweight, in-memory lexical retrieval system to fetch relevant rules and cases based on query-term overlap.
- Guardrails & Evaluation: Includes a scaffolding for running evaluation cases, recording traces, and applying human-review guardrails to ensure AI outputs are advisory and verified.
- Rule Engine: A dedicated engine that owns the final compensation amount calculation to prevent the AI from hallucinating financial payouts.
Who it’s for
It is primarily an educational MVP designed for engineers and architects looking to build AI harnesses for operational workflows where reliability, traceability, and human-in-the-loop oversight are more important than autonomous agentic behavior.
Highlights
- Deterministic Baseline: Splits orders into specific legs (dispatch, to-shop, etc.) to create a baseline for the model to beat.
- Rule-Based Compensation: Ensures the model suggests compensation but the rule engine decides the actual amount.
- Observability: Built-in request tracing, per-step durations, and feedback storage for monitoring AI performance.
- Evaluation Framework: In-memory evaluation runs with scorers to detect regressions in model output.
- Degraded Mode: Workflows can complete in a
DEGRADEDstate if optional dependencies fail, keeping deterministic results available.
Related
- Project
- Project
- Project
- Project
- Project