Inspiration

Hotel search often starts from zero, even when the traveler has already shared what matters to them. Someone may repeatedly ask for cafés, convenient transportation, lively neighborhoods, or quiet places—but those preferences usually disappear between conversations.

We built PickTrip Memory to make hotel search remember. Instead of asking users to repeat themselves, the AI learns from previous conversations and uses those preferences to personalize future searches, recommend relevant hotels and nearby places, and automatically add useful pins to the map.

What it does

PickTrip Memory combines conversational hotel search with persistent user preferences.

For example, if a traveler previously mentioned that they enjoy cafés and care about public transportation, a future hotel search can automatically:

  • Recall those preferences
  • Recommend hotels that better match them
  • Add relevant hotels and nearby places to the map
  • Explain why each recommendation fits
  • Continue refining the results through multi-turn conversation

Users can clear the current map pins without deleting their long-term preferences. When they search another destination, the map resets while the AI still remembers what matters to them.

How we built it

We replaced the original AI agent layer in PickTrip while reusing its existing hotel-search APIs and authentication system.

Mastra powers the conversational agent, tool orchestration, and observable agent workflow. Elasticsearch stores long-term preferences and conversation memories, then retrieves relevant context using hybrid semantic and keyword search. The retrieved memories are combined with live hotel results from PickTrip APIs.

The frontend is built with Next.js and TypeScript. Mapbox renders stable hotel and point-of-interest pins, while PickTrip authentication keeps memories connected to the actual signed-in user instead of a fixed demo account.

Challenges we ran into

The hardest challenge was turning free-form conversations into reliable recommendations. User preferences can be implicit, contradictory, destination-specific, or outdated. We addressed this by storing structured preference memories with categories, confidence, polarity, timestamps, and source messages.

We also had to keep the AI response synchronized with the map. Hotel names and pins must come from real PickTrip API results, so we added deterministic grounding to prevent the agent from inventing hotels or claiming that pins were added when a tool failed.

Another challenge was balancing persistent memory with temporary search state. Our solution separates long-term preferences from map pins: users can clear or replace the current map results while retaining their personal travel profile.

What we learned

We learned that useful agent memory is not simply saving chat history. The system must decide what is worth remembering, retrieve only what is relevant, and ground every recommendation in live data.

Mastra made the agent workflow and tool calls observable, while Elasticsearch gave us a flexible memory layer for semantic recall and structured retrieval. Together, they allowed us to demonstrate a clear before-and-after experience: without memory, hotel search is generic; with memory, the same search becomes personal, contextual, and immediately visible on the map.

What's next

Next, we plan to add preference editing, richer explanations for every recommendation, feedback-based ranking, and time-aware memory so newer preferences can replace outdated ones. We also want to extend the same memory layer across the complete PickTrip travel-planning experience.

Built With

  • api?es|ql?semantic
  • authentication?picktrip
  • mastra?elasticsearch?next.js?react?typescript?mapbox?openrouter?firebase
  • search?ai
  • search?vector
Share this project:

Updates