The Smart Logistics Problem
Restocking a depot necessitates computing over stock on hand, demand history, supplier lead times and case sizes. It tells what to buy, and from which supplier — all to ensure it arrives before the shelves are empty.
The computing part is easy — the rules that constrain it are not. A rule such as “order from Nordic 30 days before Christmas” is difficult to support in a conventional planning system. As a result, most logistical software doesn’t support such high-level rules.
The variety of rules
Here are three rules that can arise in managing a depot:
Each rule above requires a different software feature. Look at the Christmas rule:
Nordic shuts down for two weeks over Christmas — don’t order from them if it won’t arrive first.
To support that, the software needs a blackout database table and update the algorithm to take holiday shutdown into consideration.
The next one asks for something else entirely:
Never propose more than 300 units of one product in a single order — receiving can only take two pallets of one item at a time.
That is really a constraint about pallets, so supporting it in general means units per pallet for every product and a view of what else lands in the bay that morning.
The third narrows which alerts the system should raise, and only for one category:
Warn about packaging only when it is under 3 days of cover.
Supporting the variety of rules in depot management means a feature for each kind of rule, and no traditional planning system survives the resulting feature explosion.
That is the smart logistics problem: how to support the variety of high-level planning rules in logistical software.
The agentic solution
Store the rules directly as sentences, one per row.
The agent applies the rules by checking the database. It issues warnings where a rule is broken, and plans draft orders for the depot manager.
The planning and the checks are performed by running a program created by LLM in Jo. Before that program is allowed to run, Harpe checks it against a short list of things it is permitted to do: read the stock, read the rules, propose a draft order. Buying, approving and sending are not included in the list, so a program that tries one of them is rejected during the check.
The program only issues warnings and draft orders, and nothing else. In the end, the manager is the one who decides.
What it guarantees
The agent cannot buy anything. Buying, approving and sending are not in the list.
Security risk is under control. Even under prompt injection attacks, the worst can happen is a problematic draft order that the manager can refuse.
A new rule does not need any development effort. It is a sentence, typed by the person whose rule it is, and it takes effect on the next run.
The alternatives
Give the agent a set of tools instead. A depot holds tens of thousands of products, and each one needs a calculation. Sending the data to the model saturates the context window, burns tokens and runs up the bill, and the answers get worse as it fills.
Let agent write Python code, run it in a container. A container decides which files and sockets a process gets, while the rule that matters — the unattended agent may not order anything — is about business logic. Inside the container, the generated Python program still has permission to delete every row in the database.
The Agentic Planner
The prototype is a complete app — a depot database, a web UI, and two agents built with Harpe on Jo.
The home page shows an overview of the stock:

The checks page allows adding a rule as a sentence:

Drafts wait on the orders page. Accept places the order, Reject drops it, and nothing an agent can call moves a draft out of that state.

The two agents have a page of their own, with the history of what they have run:

They are not given the same authority, because they do not run at the same time. The watcher runs unattended, and the only thing it can do is produce warnings. The planner has to be triggered by hand, and it may only create draft orders for the manager to approve.
Run it
The application is a complete project. Clone it:
git clone https://github.com/typescope/smart-logistics.git my-depot
cd my-depot
pip install -r requirements.txt
cp .env.example .env
Set ANTHROPIC_API_KEY or OPENAI_API_KEY. OpenRouter works too, but needs
both OPENROUTER_API_KEY and MODEL, because it has no default model id.
jo start
Open http://127.0.0.1:8766. The first run creates
data/logistics.db with a depot that is already in trouble.
WATCH_INTERVAL_MINUTES=0 keeps the schedule off, and Check now runs the
watcher by hand.
The app has no login. It refuses to bind anywhere but loopback unless
ALLOW_UNSAFE_REMOTE=true is set, which is unsafe on an untrusted network.