Shipment Tracking
Persona
Role: Logistics platform developer at a freight brokerage managing 500+ shipments per month.
The operations team tracks shipments through carrier portals, updates customers via manual email, and records delivery confirmations in spreadsheets. There is no unified view of where shipments are, which ones are delayed, or whether deliveries were confirmed. The company needs a centralized shipment tracking platform.
Business Problem
Customers call asking "where is my shipment?" and operations staff must log into individual carrier portals to find the answer. Delayed shipments are discovered only when customers complain, because there is no proactive monitoring. Delivery confirmations are not systematically recorded, leading to billing disputes over whether goods were actually received. This scenario builds a shipment tracking workflow that captures the full lifecycle from origin to delivery, records tracking events at each milestone, and logs delivery confirmations with recipient signatures.
Four-Step Application
This scenario works best as a four-step, human-in-the-loop application. The existing object model already gives this scenario a strong delivery backbone through Shipment, TrackingEvent, and Delivery.
- Mission metric focus: better on-time performance, lower exception costs, and higher operator productivity.
- Human + AI pattern: Each step combines structured workflow data with chat assistance, background generation, document understanding, and accessible interaction patterns when they improve the experience.
Step 1. Capture demand and context
- Goal: Make it easy for the user to start the Shipment Tracking journey with complete, trusted context.
- Required data: Shipment context such as origin, destination, carrier, and status.
- AI support: Use chat to guide intake, generate clearer prompts, create accessible summaries, and assist with voice or vision-led capture when a form alone is not the best experience. EAI can support structured intake, chat workflows, and document-centred capture today; richer native multimodal capture may still need workflow extensions or connected services.
- Business impact: Improve completion rate, reduce first-touch effort, and raise customer or staff confidence in the UX from the very first interaction.
- EAI delivery: Model the intake as tenant-isolated object types and resources, then use actions, chat workflows, and document indexing or classification to keep the initial record complete and usable.
Step 2. Prepare the decision
- Goal: Turn the captured context into the next best action for Shipment Tracking without forcing the human reviewer to assemble the case manually.
- Required data: Shipment state and history; TrackingEvent fields such as location, status, timestamp, and description.
- AI support: Run background summarisation, extraction, classification, recommendation drafting, and answer generation so a reviewer sees a prepared case instead of raw fragments. EAI delivers the structured records and AI workflow hooks for this today; specialised scoring engines, external rules, or advanced reasoning controls may still need integration work.
- Business impact: Reduce cycle time, improve quality and consistency, and protect the mission-critical metric before the case moves into execution.
- EAI delivery: Link records across the scenario, persist decision state as resources, and use workflow actions plus chat assistance to keep humans in control while AI prepares the work.
Step 3. Execute and collaborate
- Goal: Coordinate the actual work, handoffs, approvals, and user updates needed to deliver the service or outcome.
- Required data: TrackingEvent execution state; Delivery fields such as recipient, signature, timestamp, and notes.
- AI support: Draft replies, produce work packets, monitor exceptions in the background, and surface the next action for each operator. EAI can orchestrate tenant-isolated records, actions, chats, and document workflows today; deeper system-to-system automation may require additional connectors or workflow capability.
- Business impact: Increase operator productivity, reduce rework across handoffs, and improve service consistency across the application journey.
- EAI delivery: Use linked object types, actions, resource updates, and workflow-triggered AI assistance so the team can execute in one model instead of splitting work across disconnected tools.
Step 4. Resolve, explain, and improve
- Goal: Close the loop with a clear outcome, an understandable explanation, and feedback that improves the next case.
- Required data: final status, outcome, audit history, and follow-up signals across Shipment, TrackingEvent, and Delivery.
- AI support: Generate outcome summaries, customer-friendly answers, compliance-ready notes, management insights, and accessible follow-up content. EAI can store outcome records and support answer generation today, while richer proactive agents, advanced analytics, or channel-specific accessibility features may need additional product capability.
- Business impact: Increase trust, quality, and measurable business value through better on-time performance, lower exception costs, and higher operator productivity.
- EAI delivery: Keep the full audit trail in structured resources, use AI workflows to explain outcomes, and feed the resulting signals into future product, service, and operational improvement work.
EAI Platform Support By Step
EAI provides the safe service boundary for Shipment Tracking through Object Types, tenant-scoped resources, document processing, chat workflows, and CLI verification. For this scenario, the main records are Shipment, TrackingEvent, and Delivery.
| Process step | What EAI provides | Calling pattern |
|---|---|---|
| Step 1. Capture demand and context | Tenant-scoped intake resources for Shipment context such as origin, destination, carrier, and status. Object Type validation, starter forms, optional document intake, and chat-guided capture keep the first record complete. | Define fields in src/eai.config/object-types.ts, run eai types validate and eai types seed, create initial Shipment records with useResources('Shipment') or eai resources create Shipment, and keep browser calls behind /api/eai/.... |
| Step 2. Prepare the decision | Linked resource queries over Shipment state and history; TrackingEvent fields such as location, status, timestamp, and description. Search, schema checks, document classification or RAG indexing, and chat summaries turn raw context into a prepared decision. | Use useResources('Shipment') list/query/search patterns, verify shape with eai resources schema, use useDocuments().upload/classify/ragIndex, eai docs upload, eai docs classify, and eai docs index where supporting material exists, and send decision-support prompts through useChat(workflowId, 'chat') or eai chat send. |
| Step 3. Execute and collaborate | Resource updates and actions for TrackingEvent execution state; Delivery fields such as recipient, signature, timestamp, and notes. Status changes, assignments, notes, generated work packets, and chat support keep humans in control during execution. | Model actions in the Object Type code, call client.resources.executeAction(type, id, action) or the app hook equivalent, update records through the app service layer, and verify with eai resources get/list/query. |
| Step 4. Resolve, explain, and improve | Outcome resources for final status, outcome, audit history, and follow-up signals across Shipment, TrackingEvent, and Delivery. Audit-friendly links, indexed final documents, reporting snapshots, and answer generation make the result explainable and reusable. | Persist outcomes as resources, index final material with eai docs index or useDocuments().ragIndex, send explanation prompts with useChat or eai chat stream, and use eai resources aggregate/search for reporting checks. |
Prompt, Code, And Service Pattern Mapping
The Object Type code example on this page is the implementation contract for the EAI platform services. eai-gofer should read that code as the source of truth for which resource, document, and chat calls belong in the app.
Use this prompt shape when asking eai-gofer or another coding agent to implement the scenario:
Use the EAI App Template. Model Shipment Tracking with Object Types for Shipment, TrackingEvent, Delivery. Use useResources for records and actions, useDocuments for uploads/classification/RAG where documents appear, useChat for workflow assistance, and verify with eai types/resources/docs/chat commands. Use eai publicapi only when no named command covers the required platform call.
| Scenario artifact | How it maps to EAI service calls |
|---|---|
| Four-step process | Step 1 becomes resource creation, Step 2 becomes resource query/search plus optional document or chat preparation, Step 3 becomes resource update/action calls, and Step 4 becomes outcome persistence plus explanation/reporting calls. |
| Object Type definitions | eai types validate, eai types seed, and eai resources schema make the model available and checkable before UI work starts. |
| Properties and indexes | Fields become useResources payloads, filters, list views, and eai resources create/list/query/search checks. Indexed fields should support lookup and triage, not duplicate canonical records. |
| Links between Object Types | Relationships become linked-resource UI, timeline context, and audit trails that app code loads through resource queries rather than separate bespoke stores. |
| Actions and status fields | Workflow buttons and operator transitions call resource action/update helpers, then verify state with eai resources get/list/query. |
| Document and chat prompts | Prompts should call the platform documents and chat patterns: useDocuments().upload/classify/ragIndex, eai docs upload, eai docs classify, and eai docs index for documents, and useChat, eai chat send, or eai chat stream for conversational assistance. |
Object Types
| Name | Key Properties | Links | Actions |
|---|---|---|---|
| Shipment | origin (text), destination (text), carrier (text), status (select: booked, in-transit, out-for-delivery, delivered, exception), estimatedDelivery (date) | one-to-many → TrackingEvent, one-to-many → Delivery | dispatchShipment |
| TrackingEvent | location (text), status (text), timestamp (date), description (text) | many-to-one → Shipment | -- |
| Delivery | recipient (text), signature (text), timestamp (date), notes (text) | many-to-one → Shipment | -- |
CLI Workflow
-
Scaffold the project
eai init shipment-tracking -
Authenticate and pull environment
eai logineai env pull --include-secretsIf you are an external developer, see [Configuration](/docs/configuration) for login and local environment setup. -
Define your Object Types
Create the Shipment, TrackingEvent, and Delivery types in
src/eai.config/object-types.ts(see code example below). -
Validate the type definitions
eai types validateTenant: shipment-tracking✔ Shipment — 5 props, 2 links, 1 action✔ TrackingEvent — 4 props, 1 link, 0 actions✔ Delivery — 4 props, 1 link, 0 actions✔ All Object Types are valid -
Seed types to the platform
eai types seed -
Create sample resources
eai resources create Shipment --data '{"origin": "Los Angeles, CA", "destination": "Chicago, IL", "carrier": "FastFreight Logistics", "status": "booked", "estimatedDelivery": "2025-08-05"}' -
Start local development
eai dev
Code Example
// src/eai.config/object-types.ts
export const objectTypes = {
'shipment-tracking': [
{
name: 'Shipment',
displayName: 'Shipment',
description: 'A freight shipment moving from origin to destination',
properties: [
{ name: 'origin', type: 'text' as const, required: true, indexed: true },
{ name: 'destination', type: 'text' as const, required: true, indexed: true },
{ name: 'carrier', type: 'text' as const, required: true },
{ name: 'status', type: 'select' as const, required: true, defaultValue: 'booked', options: [
{ label: 'Booked', value: 'booked' },
{ label: 'In Transit', value: 'in-transit' },
{ label: 'Out for Delivery', value: 'out-for-delivery' },
{ label: 'Delivered', value: 'delivered' },
{ label: 'Exception', value: 'exception' },
]},
{ name: 'estimatedDelivery', type: 'date' as const, required: true, indexed: true },
],
linkTypes: [
{ name: 'trackingEvents', targetObjectType: 'TrackingEvent', cardinality: 'one-to-many' as const },
{ name: 'deliveries', targetObjectType: 'Delivery', cardinality: 'one-to-many' as const },
],
actions: [
{
name: 'dispatchShipment',
displayName: 'Dispatch Shipment',
description: 'Mark a booked shipment as dispatched and in transit',
requiredRole: 'tenant-user',
validationRules: { requiredFields: ['origin', 'destination', 'carrier'], requiredStatus: 'booked' },
sideEffects: [
{ type: 'set_field', field: 'status', value: 'in-transit' },
],
},
],
status: 'published' as const,
},
{
name: 'TrackingEvent',
displayName: 'Tracking Event',
description: 'A status update event during shipment transit',
properties: [
{ name: 'location', type: 'text' as const, required: true },
{ name: 'status', type: 'text' as const, required: true },
{ name: 'timestamp', type: 'date' as const, required: true, indexed: true },
{ name: 'description', type: 'text' as const, required: false },
],
linkTypes: [
{ name: 'shipment', targetObjectType: 'Shipment', cardinality: 'many-to-one' as const },
],
actions: [],
status: 'published' as const,
},
{
name: 'Delivery',
displayName: 'Delivery',
description: 'A delivery confirmation for a shipment',
properties: [
{ name: 'recipient', type: 'text' as const, required: true },
{ name: 'signature', type: 'text' as const, required: false },
{ name: 'timestamp', type: 'date' as const, required: true, indexed: true },
{ name: 'notes', type: 'text' as const, required: false },
],
linkTypes: [
{ name: 'shipment', targetObjectType: 'Shipment', cardinality: 'many-to-one' as const },
],
actions: [],
status: 'published' as const,
},
],
};
Key Takeaways
- End-to-end visibility: Every shipment is tracked from booking through transit to delivery, answering "where is my shipment?" without calling the carrier.
- Event-driven tracking: Tracking events create a timestamped history of every location and status change, enabling proactive delay detection.
- Delivery confirmation: Recipient and signature data recorded at delivery provides proof of receipt that prevents billing disputes.
- Exception handling: The exception status flag surfaces problematic shipments that need immediate attention, separating them from normal transit flow.