Skip to content

About

Atlas — a travel agent that reads Stash. Demo of the Stash developer platform: per-traveller tenants, a shared wiki, and visible tool calls.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Atlas — a demo travel agent

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.

Run it

cp .env.local.example .env.local     # add your Anthropic key
npm install
npm run dev                          # http://localhost:3200

You 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).

How it is put together

  • 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 — the tools array 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.

Resetting between demos

/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.

About

Atlas — a travel agent that reads Stash. Demo of the Stash developer platform: per-traveller tenants, a shared wiki, and visible tool calls.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages