Our WhatsApp AI agent almost left Anthropic's SDK, twice
In October I built our WhatsApp agent on Anthropic's SDK rather than TanStack AI. On switchover day I tried to move it to TanStack AI again, and the details I needed to control said no a second time. I'm locked in, and I've kept the lock thin.
On 11 November, a few hours after the switchover, I opened an issue: move our WhatsApp agent onto TanStack AI. By that evening an agent had read TanStack AI’s source, checked it against everything our agent does, and come back with a no.
It was the second time in a month I’d asked that question. I don’t like being locked in to one vendor. It’s why I was wary of all-in-one frameworks, and why I’d rather code in pi, an open-source coding agent, inside herdr, a desktop app for running agents side by side, where I can point the same tools at any provider’s model. TanStack AI is the same idea for an agent: one library for the model call, the tools and the loop, whichever provider sits behind it.
Two AIs in our WhatsApp
Two kinds of AI work with our WhatsApp chats, and they’re easy to mix up.
The first is the one from Part 14: Claude, in the Claude app, using Flair’s MCP server. That’s our general way into Flair, with 81 tools: we use it for sales, but also to update products and costs, or to pull designs when we build ads. A person drives it. We ask, check the preview and say go.
The second is Fleur Concierge, an agent that lives inside Flair and answers customers on WhatsApp by itself. Nobody approves each reply. So it gets a much smaller set of tools: ten.
It can search our designs, show our best sellers, send a design photo, check a delivery fee and check a date. It can read a customer’s own orders, read and save the chat’s quote, and write a summary for the team.
The last tool is handover. It gives the chat back to a person.
Ten, not 81, because an agent talking to customers only needs to help them choose. Every tool it doesn’t have is one less thing that can go wrong while no one is watching.
The first time: Flair v1
We call the agent Fleur Concierge. I built it in Flair v1 between 19 October and 1 November 2026, and we ported it to Flair v2. It calls Claude through the Anthropic SDK directly, with a small tool loop of our own.
The handover idea came from Meta AI, which Meta offers as an agent for WhatsApp Business. It answers customers and hands the chat to a person when it should. For us it was costly to run, and it couldn’t call our own system. So I built our own on Zernio, which already runs our WhatsApp inbox, and on Flair, so the agent’s tools read our real designs, prices and delivery fees.
Building it, I weighed TanStack AI against Anthropic’s own SDK, and chose the SDK.
The second time: switchover day
I like the TanStack libraries, and it would have meant less of our own code. The agent checked TanStack AI against the versions out that week, in November 2026. Its five reasons for no:
- It dropped the effort setting we send with every request.
- It folds cache reads and writes into its input token count. We need fresh and cached input apart.
- It wants to own the message list. Our loop rebuilds it from the database on every call.
- It still depends on Anthropic’s SDK underneath.
- And it would have broken the agent’s tests.
So the agent stays on Anthropic’s SDK. The funny part is that I’d forgotten we had the same debate when I first built the agent in Flair v1, a few weeks earlier, and we landed in the same place.
Locked in, on purpose, for now
The coding tool went the same way. I’d rather code in a tool that works with any provider, but I build in Claude Code.
I still dream of going back to pi, with a frontier model from someone else as good as Opus 5.5. Today Claude Code, with its desktop and iOS apps, is simply ahead. So I’m happy to be locked in for a while, with my eyes open, until a model that’s as good and less locked in arrives.
What I can do meanwhile is keep the lock-in thin. The agent’s loop is ours, and small. Its tools are ours, and so is its prompt. The chat history it rebuilds on every call, and the usage behind its daily cap, live in our own database. If we ever move, it’s the model call that changes, not the agent.
Ten tools, built for one chat
The concierge’s tools aren’t Flair’s MCP tools. Each one is defined on its own, with a name, a description and a strict input schema, written for a model talking to a customer. But inside, each calls the same core actions as everything else: searching designs, quoting a delivery fee, saving the chat’s quote. The rules in those actions apply here too.
Three choices shape them:
- No tool takes an id for a chat, contact or customer. The contact and the enquiry always come from the chat the agent is answering, so it can’t read or change anyone else’s.
my_ordersshows only this customer’s five newest orders. - Inputs are tight. An address must be 8 to 300 characters, a time must be
HH:MM, and summaries and reasons have a length cap. Anything else is refused before an action runs. - Results are short text for the model, not records. A design comes back with its name, size, price, colours and flowers, never its cost or margin.
When an action refuses a call, the model gets the same message staff would see and can try again. Anything unexpected fails the run and hands the chat to staff.
The lessonIf you have to be locked in, keep the lock thin: own the loop, the tools and the data.
What I’d tell anyone picking an AI SDK
- Check the parts you control. Effort, cache tokens, the message list: a wrapper that hides them can cost you more than it saves.
- Write down why you said no. I’d forgotten the first decision until I made it again.
- Own the loop. A small loop of your own is easy to move; a framework’s loop moves only with the framework.
- Give an agent its own small tools. Ours can’t take an id, so it can only see the chat it’s in.
The agent has ten tools, and none of them creates an order or sends a payment link. That’s not a missing feature. It’s the point.
