Anass Benouhoud
← Work / Agentic AI
Case study · Agentic AI

Intelligent customs assistant.

Classement douanier, mené par une équipe d’agents supervisée.

A system of agents that classifies goods in the customs tariff: a supervisor that frames the work, an assistant that does it, guardrails that check it, and a person who validates.

My roleArchitecture and design of the agents and the knowledge graph
DomainTransit and customs, transferable to any regulated profession
StackLangGraph · GraphRAG · PostgreSQL · Next.js
ProductsheetCharact-eristicsCandidateheadingsOfficialtextsCode
01 — THE CHALLENGE

One product, thousands of possible headings.

Classifying an item means assigning it a 10-digit customs code. That code sets the duties, the VAT, the required documents and the controls. A mistake is expensive.

The work is hard to automate: information is scattered across invoices, technical sheets and certificates, the rules have exceptions, and a confident wrong answer is worse than no answer.

02 — THE APPROACH

Four design principles.

1A supervisor that never classifiesThe SuperAgent plays the declarant: it gathers the data and asks the right questions, but classification is the assistant’s job.
2Evidence checked by codeEvery cited extract is verified word for word. Without evidence, the answer becomes a question for a person.
3A tariff that is read, never guessedNo code is cited unless a tool found it in the customs tariff.
4A person has the last wordEvery proposal arrives with its evidence file; the user accepts, rejects or reopens it.
03 — THE ARCHITECTURE

34 components, six layers, one thread.

InterfaceAPI and preparationProcessing engineSuperAgent (supervisor)Assistant (main agent)Specialised sub-agentToolGuardrailMemory and stateData sourceResult and validation
Mini Map
Click a component
Click a component to see what it does.
ControlA tracking interface, a work queue and an orchestrator: they move each item forward, resume after a failure and keep the full history.
IntelligenceA SuperAgent, a customs assistant and specialised sub-agents: sheet extraction, web search, chapter analysis.
TrustGuardrails, memory per client and official sources: the system keeps what was validated and invents nothing.
04 — HOW IT RUNS

From the invoice line to the validated code.

1
SelectionThe user chooses the lines to classify.
2
GroupingSimilar items are grouped, and a person adjusts the groups.
3
PickupA process takes the item, with no duplicate and no loss.
4
Product sheetExtraction, web search and chapter analysis.
5
SupervisionOn every turn, the SuperAgent assesses the situation.
6
DecisionAn answer with evidence, or a question for a person.
7
ClassificationThe assistant walks the tariff tree and keeps a code.
8
Evidence fileOfficial sheet, origin, consistency with the declared code.
9
ValidationA person decides; the memory is enriched.
05 — WHAT IT SHOWS

Agents that are reliable because they are framed.

LangGraphGraphRAGPostgreSQLNext.jsAgents and sub-agentsMemoryGuardrails

An agent may propose. Only the evidence, the code and a person decide.

The same architecture transfers to other professions where a decision must be justified: compliance, contracts, finance, public procurement.

CONTACT

A similar need?

An agentic AI project, a framing exercise or an architecture to set down: describe it in a few lines.

Discuss a mission →