Following on from my earlier post about implementing Cube Dev as a semantic layer for our SEO, Reddit, and marketing agency stack, I'm now tackling the agentic side. We're a Next.js shop, so Cube felt more natural than dbt. Semantic layer is solid, API exposed for customers, but the real question is how to hook AI into it. Using Codex or Claude Code via CLI works for me, but clients aren't going to subscribe to those tools. They need the agent embedded inside their account dashboard.
I've been playing with the Claude Agent SDK, but it feels limiting when you need custom query chaining or multi-step behaviour. Someone else in the community went a different route - embedded the agent directly using the API rather than relying on external subscriptions. That gives you full control over costs and lets you white-label properly. They ended up building a lightweight wrapper that handles the semantic layer translation and keeps conversation context between queries. Clients apparently love having everything in one place without extra logins.
Biggest pain point they mentioned - and I can already see it coming - is rate limiting and query costs spiralling when clients go wild with requests. Need to bake usage tracking in from day one.
We've also got some Google Cloud credits, so Gemini might come into play. Has anyone done a direct comparison between Claude's SDK and a custom wrapper for this kind of embedded agentic analytics? Curious about the trade-offs in flexibility versus maintenance overhead.