Map records bind visual identity to graph nodes
The index K combines named map units, amenities, facility anchors and landmark-directory records. A record k stores names and aliases Nk, descriptions Tk, a category, source, graph node vk, optional floor ℓk and association type. The graph supplies the output coordinate x(vk).
For named unit and amenity geometry, indexing selects a junction, entrance or point-of-interest node on the same floor within 20 metres of the feature centre. Landmark-directory entries supply their own node associations. Facility records attach to graph endpoints associated with that facility.
Spatial filtering bounds the candidate set
The vision model maps image I to an observation O: visible names, text, objects, floor label, direction hint and reliability γ. The workflow resolves a visible floor label against the scene manifest. An unknown label or a conflict with the supplied floor produces an empty match set.
The centre x0 is the supplied photo position, or the current graph node. The uncertainty radius a comes from the supplied position accuracy. With no floor constraint, retrieval includes nearby records on all floors. Localization excludes path-edge records.
Text retrieval supplies evidence to the matching model
Normalization applies Unicode NFKC, lowercasing and removal of punctuation and spaces. The lexical matcher compares character-bigram sets with Dice similarity, retaining exact-name matches. Generic facility names receive a 0.35 multiplier; description matches receive a 0.85 multiplier. The shortlist keeps the 20 highest lexical scores, with distance breaking ties.
The matching model receives the observation and retrieved records, then returns candidate IDs with paired observed and mapped text spans. Programmatic validation keeps a pair only when both normalized spans contain at least two characters and occur in their declared sources. Optional user clues remain a separate evidence source. In the live workflow that accepts these clues, the lexical score takes the maximum of photo-based and user-description similarity.
Ranking combines identity evidence with spatial context
| Symbol | Definition |
|---|---|
| Lk | Maximum supported lexical similarity for the candidate. |
| Mk | 1 if at least one evidence pair survives validation; 0 otherwise. |
| Dk | max(0, 1 − dist(k, x0) / 120 m). |
| Rk | max(0, 1 − distance to the nearest same-floor route node / 50 m); zero if none exists. |
| γ | Reliability of the visual observation. |
| κk | 0.79 for an approximate association; 1 for other associations. |
The fixed spatial-score scale is 120 m even when the retrieval radius differs. Scores express retrieval support; the implementation has no probability calibration.
Evidence gates the selection of a map anchor
Algorithm 2 Retrieval-Augmented Landmark Localization
Input: Image I, map index K, graph G, position / floor / route context, optional user clues.
Output: ready with a node reference, needs_confirmation with candidates, or no_match.
- O ← visual observation of I; resolve its floor against the scene manifest.
- if a visible floor label is present but unrecognized, or its resolved floor conflicts with the supplied floor, then return
no_match. - C ← nearby, floor-compatible landmark records from K.
- C20 ← top 20 records by lexical score, breaking ties by distance.
- if C20 = ∅ then return
no_match. - H ← model evidence matches between O and C20.
- Validate observed and mapped spans in H against their declared sources.
- Compute Sk for each candidate; sort by score, then distance.
- Let k1 be the top record; let k2 be the highest-ranked record on a different node.
- if S1 < 0.20 then return
no_match. - if S1 ≥ 0.80 and S1 − S2 ≥ 0.12 then
- return
readywith node v1 and its floor reference. - return
needs_confirmationwith the ranked candidates.
Use S2 = 0 when no candidate refers to a different node. Records that share one node represent the same approximate location. Approximate associations remain below the 0.80 ready threshold.
Coordinate lookup connects localization to routing
The workflow validates node and floor references against the scene. Pending workflow confirmations expire after five minutes and bind to their originating journey context. In the phone session flow, the user confirms the selected anchor before the session updates its current position and replans the remaining journey. The returned coordinate denotes the associated map anchor near the landmark.
- Structured visual observation ↗
backend/agents/vision.ts - Map index and spatial retrieval ↗
backend/retrieval/map-index.ts - Retrieved-evidence matching ↗
backend/agents/map-matcher.ts - Lexical scoring, evidence validation and decisions ↗
backend/retrieval/rank.ts - Localization output and pending confirmation ↗
backend/workflows/localization.ts