Inspiration

Planning trips usually means juggling a dozen browser tabs, losing track of details, and repeatedly explaining your preferences to AI tools that forget everything the moment you close the browser. We wanted to build an agentic travel platform that acts like a real travel partner—one that actually remembers your past trips, preferences, and constraints across sessions without throwing you back to square one.

What it does

SAFAR-AI is an agentic travel assistant designed to make trip planning dynamic, personalized, and persistent.

Agentic Memory: Uses CockroachDB to store user profiles, interaction history, and contextual preferences so the AI learns what you like over time.

Smart Route & Itinerary Generation: Generates tailored travel plans, chat responses, and booking workflows through simple conversational prompts.

Serverless Backend API: Exposes clean REST endpoints (/api/v1/health, /users/register, /chat, /bookings) for smooth frontend consumption.

How we built it

Backend: Built with Python and Flask, integrated with aws-wsgi to adapt Flask routes into serverless event handlers.

Cloud Infrastructure: Hosted on AWS Lambda with AWS API Gateway handling routing using catch-all proxy routes (/{proxy+}) and Payload Format 1.0.

Database & Memory: CockroachDB Serverless manages user authentication, relational application data, and long-term agent memory over encrypted SSL connections.

Challenges we ran into

Serverless WSGI Routing: Getting API Gateway to pass raw path requests directly into Flask without hardcoding stage prefixes required dialing in specific $default stage routing and proxy setups.

Lambda SSL Certificates: Handling CockroachDB's SSL connection requirements inside Lambda's ephemeral execution environment required configuring connection strings specifically for serverless Linux runtimes rather than relying on local machine certificate paths.

Accomplishments that we're proud of

Deploying a fully functional serverless Flask application on AWS Lambda with ultra-low latency.

Successfully implementing persistent memory for AI agents using CockroachDB.

Building a clean, modular backend setup that can scale horizontally without managing traditional servers

What we learned

The subtle differences between API Gateway Payload Format 1.0 and 2.0 when interfacing with WSGI adapters.

How to structure relational database schemas in CockroachDB to efficiently feed historical context back into LLM prompts.

What's next for SAFAR-AI

Vector Search Integration: Leveraging CockroachDB's spatial and vector capabilities for semantic location matching.

Real-time Booking Execution: Connecting live flight and hotel APIs directly into the agent's action tools.

Cross-Platform App Launch: Connecting our Flutter mobile app to the serverless API endpoints for on-the-go travel management.

Built With

Share this project:

Updates

Submission history