CRM analytics for a 14-location beauty salon network
The setup: 14 salons. Roughly a million client transactions accumulated over years. Data lived in legacy exports — too much to read, impossible to act on. Salon managers had no way to ask basic questions like "who hasn't visited in 90 days but used to be regulars?" without manually digging through spreadsheets.
What I built: a Telegram-first analytics layer. Front-end is a chat bot anyone on the team can use from their phone. Brain is a multi-agent system on the Anthropic Claude API — Router classifies the question, Parallel runs simultaneous queries where needed, Chain feeds results between agents, Hierarchical lets the top-level agent delegate. Database is Supabase with strict named RPC functions. The agent picks tools; the database does the SQL.
The bot answers the questions a salon manager actually asks. Not the ones a consultant would write into a spec doc. Getting that distinction right is what makes the system useful on day one.
Where it landed: compressed the system prompt from ~35,000 tokens to ~3,000 through better tool and schema design — roughly 90% lower running cost, same accuracy. Monthly idempotent imports keep the data clean. Originally retrieved with Pinecone over summarized vectors; architecture is now evolving toward DuckDB-backed agentic retrieval as scope grows.