feat: let the model decide the campus map via maps_show_map #14

Closed
Jc-965 wants to merge 0 commits from cmumaps-improvements into main
Jc-965 commented 2026-08-06 21:50:11 +00:00 (Migrated from codeberg.org)

Summary

The model now decides when an answer should include a campus map by calling a local maps_show_map tool. This replaces regex matching as the primary signal, while keeping the existing patterns as a fallback so maps still work when the tool is not called.

  • maps_show_map takes a required destination and an optional origin. Both are limited to valid building codes through schema enums, so nonexistent locations are rejected before they reach the map logic.
  • The tool only returns a confirmation message. agent/cmu_maps.py still validates the building codes and generates every map URL, so the model never creates links itself.
  • If the model provides an invalid or hallucinated code, the system falls back to inferring the location from the user's query instead of generating a URL the map cannot handle.
  • The system prompt now includes the building catalog and common nicknames
  • maps_show_map is excluded from services_used and is never shown to the user as a source for the answer.
  • The tool is bound after tool filtering, so disabling CMUMaps removes it from the prompt, the bound schemas, and the tools node.
  • Conversational queries such as "I'm at Tepper, how do I get to Gates?" now generate a route instead of a single destination pin.
  • Added aliases for Margaret Morrison, Maggie Mo, and Sorrells. Sorrells resolves to Wean (no interior spaces)
  • Also rewrote some comments to be more concise
## Summary The model now decides when an answer should include a campus map by calling a local `maps_show_map` tool. This replaces regex matching as the primary signal, while keeping the existing patterns as a fallback so maps still work when the tool is not called. - `maps_show_map` takes a required `destination` and an optional `origin`. Both are limited to valid building codes through schema enums, so nonexistent locations are rejected before they reach the map logic. - The tool only returns a confirmation message. `agent/cmu_maps.py` still validates the building codes and generates every map URL, so the model never creates links itself. - If the model provides an invalid or hallucinated code, the system falls back to inferring the location from the user's query instead of generating a URL the map cannot handle. - The system prompt now includes the building catalog and common nicknames - `maps_show_map` is excluded from `services_used` and is never shown to the user as a source for the answer. - The tool is bound after tool filtering, so disabling CMUMaps removes it from the prompt, the bound schemas, and the tools node. - Conversational queries such as "I'm at Tepper, how do I get to Gates?" now generate a route instead of a single destination pin. - Added aliases for Margaret Morrison, Maggie Mo, and Sorrells. Sorrells resolves to Wean (no interior spaces) - Also rewrote some comments to be more concise
Jc-965 closed this pull request 2026-08-13 04:12:17 +00:00

Pull request closed

Sign in to join this conversation.
No description provided.