Route Planning & Distance with AI Agents (Amap)
Let an AI agent run route planning end to end with Amap — compute multi-stop driving routes and a full distance matrix from one plain-English prompt, then have the agent optimize stop order and build a delivery plan.

Tool names in this guide are for reference only and may have changed or been renamed. Please use the latest tools in the tool marketplace when implementing.
Key takeaways
- Compute multi-stop driving routes from one prompt, no map dashboard clicking
- Get a full distance matrix in one batch call to feed your scheduling logic
- Let the agent optimize stop order and return an actionable delivery plan
Tools used
Why route planning is a grind
Logistics, delivery and field work all come down to two questions: what's the fastest way from A to B, and in what order should one vehicle hit a dozen stops. The hard part isn't getting a map — it's turning map data into an executable schedule. You query routes one stop at a time in a map dashboard, jot down distance and travel time, stitch a distance matrix by hand in a spreadsheet, and then order the stops from gut feel. Add a few more points and you've lost a morning — and the moment traffic shifts, the whole table has to be recomputed.
An AI agent collapses that loop. Instead of looking up stops one by one, you hand the agent your origin, destination and waypoints in one sentence. It calls a route-planning tool (such as ae_amap_maps_get_v5_direction_driving) for the routes, then a distance tool (such as ae_amap_maps_get_v3_distance) to measure every pair of points, and returns a schedule you can actually run.
The workflow in four steps
- Give the stops — hand the agent an origin, a destination and any waypoints; multiple stops are fine.
- Compute driving routes — get the recommended route, distance and ETA for each leg.
- Measure distances in batch — pair up the stops into a full distance matrix.
- Optimize order and schedule — the agent uses the matrix to optimize stop order and returns an executable delivery plan.
How to run each step
Step 1 — Describe the job
Tell the agent plainly: use ae to plan a driving route from example origin through example stop A and example stop B to example destination, then measure the distance between all of these points. The agent interprets this and picks the matching tools. No API wiring, no map dashboard login.
Step 2 — Driving routes
The agent calls a driving-directions tool (such as ae_amap_maps_get_v5_direction_driving) to compute the recommended route, total distance and estimated time for each leg. You can hand it several stops at once rather than querying each leg separately.
Step 3 — Batch distance
Next it calls a distance tool (such as ae_amap_maps_get_v3_distance) to measure the points pairwise and fill in a complete distance matrix. This is where a human loses a morning and an agent spends seconds.
Step 4 — Order optimization and scheduling
With the matrix in hand, the agent optimizes the stop order based on distance and travel time, turning "which stop first" from guesswork into a data-driven decision. What it returns isn't a pile of raw distances — it's an ordered delivery plan you can hand straight to a driver.
Doing it by hand vs. with an agent
| Step | Manual in a map dashboard | With an AI agent |
|---|---|---|
| Single leg | Query per stop, note distance/time | One prompt returns route/distance/ETA |
| Multi-point distance | Query pair by pair, stitch by hand | Full distance matrix in one call |
| Order optimization | Order from gut feel | Agent sorts by distance/time automatically |
| Recompute | Traffic shifts, redo the whole table | Re-run the prompt, same structure |
| Consistency | Varies per person | Same structured output every run |
How to get started
- Sign up — new users get 1,000 free credits.
- Connect in-app inside an agent like WorkBuddy or Trae, or paste a one-line MCP config into Claude Code, Cursor or VSCode.
- Give the instruction in natural language and let the agent route, measure and order the stops.
FAQ
Does it support multiple stops? Yes. Hand the agent an origin, a destination and several waypoints together; it computes the legs and measures distances in one flow instead of stitching legs by hand.
Can it build a distance matrix? Yes. The agent uses a distance tool to measure all points pairwise and returns a full matrix you can feed straight into scheduling logic.
Is it limited to mainland China? Amap mainly covers driving routes and distances within mainland China. For areas outside that, state the target region in your prompt and the agent will judge whether it applies.
