Skip to the case study
ELALFY.

مَسَارAgentic AI travel assistantLocal application

MASAR AI

An agent that researches, reasons and acts — in Egyptian Arabic, Arabic and English.

A tool-calling travel assistant: the model chooses tools, the server validates and runs them against real data, and every step streams to the browser as it happens.

My part
Product design, full-stack and agent engineering
Status
Local application
Built with
  • TypeScript
  • Node.js
  • React 19
  • Supabase
  • PostgreSQL
  • pgvector
  • Gemini
  • Groq
  • Three.js
  • Playwright
View source code(opens in a new tab)No public demo — this page is the full write-up.

Why it exists

Replace a scripted FAQ bot with a real agent loop: read the conversation, decide which tools to call, act on validated results and answer only from what was actually looked up — while keeping the customer in control of anything that writes data.

My part: product design, full-stack and agent engineering.

How it is built

Node.js 24 runs strict TypeScript directly on node:http with SSE, Zod 4 and node-postgres. The agent runtime builds the prompt, calls Gemini (Groq fallback), validates and executes tool calls, and passes answers through grounding and style guards. Supabase Postgres 17 holds the catalog, conversations, consented memory (pgvector + pg_trgm) and CRM records under row-level security, with contact fields encrypted using AES-256-GCM. The client is React 19 + Vite with Tailwind CSS 4, Radix UI, Motion and a custom GLSL Three.js orb. Tests use node:test, in-memory PGlite with pgvector, and Playwright on desktop Chrome and a Pixel 7 profile.

What is implemented

  • Multi-step function calling with bounded steps, a turn deadline, per-tool timeouts and cancellation — 14 tools with Zod-validated arguments
  • Gemini as primary model with a Groq fallback, client-side rate limits and per-call budgets
  • Worldwide offer research through Tavily: every listing carries its source, link and retrieval time and is marked unverified
  • Voice notes transcribed by Groq Whisper and reviewed by the customer before sending
  • Opt-in long-term memory with pgvector semantic recall; customers can correct, forget or erase it
  • Lead, quote and handoff actions that run only after the customer approves a masked preview, bound to the exact arguments and usable once
  • Server-Sent Events stream real agent progress; every run is traced with redacted tool inputs
  • A Liquid Glass Three.js orb that reacts to real agent states and microphone level, with quality tiers and a CSS fallback

Hard parts and decisions

Answers that can be trusted

A grounding guard holds back any answer that states catalog facts without a lookup. Prices from the web appear only when they are literally present in the source with their currency.

Letting an agent write data safely

Write actions stop at an approval the customer confirms in the UI. The approval is tied to the exact arguments, expires after one use, and contact details are encrypted at rest.

Arabic as the first language

A per-turn register hint and a style guard keep replies in the customer’s language and dialect — Egyptian, Modern Standard, English, mixed or Franco Arabic — with a designed RTL interface.

Where it stands today

Local application

Feature-complete build with public source code on GitHub. There is no public hosted deployment; it runs locally. The travel company, its four programs and prices are demonstration data. MASAR never confirms bookings, availability or payments. Screenshots were captured against the project’s deterministic test server, which is why the model label reads “e2e-scripted”.