Atlas is an AI travel agent you chat with about your own trip. It is a working Next.js app: a real Anthropic tool-use loop on the server, streamed to the browser one event per line, with every tool call the agent makes drawn in the thread as it happens.
The app ships with two travellers — Sam Ellery and Priya Raman — and the account switcher at the bottom of the sidebar moves between them. Each traveller's chat history is their own.
cp .env.local.example .env.local # add your Anthropic key
npm install
npm run dev # http://localhost:3200You land in Sam Ellery's account. Ask about a trip, start new chats, reopen old ones from the sidebar. The sidebar's history is this browser's own (localStorage).
lib/agent.ts— the tool-use loop, on@anthropic-ai/sdk(the Messages API client). The model asks to use a tool, we run it, hand back what it printed, and go round again until it answers. It is generic over its tools and runs fine with none — thetoolsarray is where an integration would plug in.app/api/chat/route.ts— the loop as an NDJSON stream: assistant text deltas, tool calls, and tool results, in the order they happened.app/page.tsx— the chat UI. It rebuilds the assistant turn from the event stream, so text and tool calls appear in the order the agent produced them.lib/chat-history.ts— the sidebar's conversation list, in localStorage.
/admin is the demo's control panel — deliberately not linked from the chat
UI, which is a product. Reset this browser clears the sidebar's local
history and writes back Sam's opening position: he asks whether three weeks is
enough for a Vietnam e-visa, returns to say it took 19 working days, and
mentions he will not fly overnight. The replies are fixture text
(lib/fixture.ts), not generated.