The studio journal
Blog
Notes on building web platforms and AI products.
JSON mode isn't a contract: making structured output reliable in production
Constrained decoding gets you syntactically valid JSON, not semantically correct data. Here's the validation, retry, and schema-design layer that actually makes structured output production-grade.
Read →Multi-tenant RAG: the isolation bugs that don't show up in the demo
Namespaces and metadata filters aren't isolation until you enforce them at every hop. Here's where cross-tenant leakage actually happens in a RAG pipeline, and how to close it.
Read →How xAI builds Grok — and how to build a Grok of your own
Grok isn't a model, it's an agent system: tools trained into the reasoning, real-time X and web search on the provider's infra, a four-agent cross-verifying architecture, and long-running agents. We break down its features, architecture, and safety harness — then map each piece to a component you can build self-hosted on a subscription you already pay for.
Read →The Hive Playbook — one agent platform, five kinds of work
A chat box with an LLM is a toy. What makes a self-hosted agent platform useful is the playbook: the specific combinations of engine, tools, and surface that turn it into a coding team, a research desk, a QA gate, and a business analyst. Here are the five workflows we actually run on Hive, tool by tool.
Read →Model routing and fallback: your app's real reliability layer
Provider outages and rate limits are inevitable. Here's how to design model routing and fallback logic so they don't take your product down with them.
Read →How to build a bot like our Grok image agent — the anatomy of an agent tool
A 'bot' in an agent platform isn't a monolith. It's a small tool plus a persona that knows when to call it. Using our Grok image generator as the worked example: the tool-vs-MCP decision, the function schema that doubles as a prompt, the tool loop, and turning a tool into a bot.
Read →You can't ship agents on vibes — evals for agentic systems
A one-line prompt tweak can silently break an agent, and you won't notice until a user does. The fix is an eval harness: a golden set of inputs and checks, run against every agent and workflow on every change. Here's the anatomy — deterministic checks, LLM-as-judge, run-on-change regression, and grading multi-agent workflows, not just single agents.
Read →Your platform is the moat, the coding agent is a plug-in
We already run a self-hosted autonomous engineer. When we wanted Cursor's cloud agents too, we didn't choose between them — we made the executor swappable. Here's the integration architecture that turns any hosted coding agent into a first-class engine behind your own surface, in four small pieces.
Read →An autonomous engineer your team actually owns
Devin and Cursor's background agents are impressive — and they're someone else's cloud, metered per task, holding your code. Here's the full architecture for building the same capability self-hosted: the loop, the data model, the six-phase plan, and the hardening that makes it safe for a real team.
Read →Agent observability: why request logs aren't enough
A log line per API call tells you the model responded. It doesn't tell you why the agent looped, which tool call caused the failure, or where your token budget went.
Read →One agent per node: running the Claude Agent SDK inside LangGraph
Most LangGraph examples wire nodes straight to a raw model API — and throw away the tools, context management, and reasoning that make an agent useful. Make each node a full Claude Agent SDK call instead. Here's the pattern, the parallel fan-in that makes it sing, and how we shipped it in Hive.
Read →Context rot: why your long-running agent gets worse before it runs out of room
A full context window isn't the failure mode that kills long-running agents. A noisy one is — and it happens long before you hit the token limit.
Read →LangGraph vs Claude Agent SDK: which one for your agent stack?
One is an orchestration runtime you wire by hand; the other is a batteries-included agent loop. They aren't rivals — they sit at different layers. Here's how to tell which job needs which, with diagrams and the hybrid that uses both.
Read →Prompt injection isn't a wording problem — it's a data-flow problem
Better instructions don't stop prompt injection. Separating what an agent reads from what it's allowed to do does. Here's the architecture.
Read →Controlling LLM costs in production without hurting quality
Model routing, prompt caching, and fallbacks aren't three separate projects — they're one cost architecture. Here's how to build it without degrading answers.
Read →One work, many titles: tagging and grouping a streaming catalog
The same show lives on five platforms, in three countries, under different names — next to remakes that look identical but aren't. Here's a production workflow to tag every title and group the duplicates into one work, with AI in the loop and still trustworthy.
Read →Tool schemas are an API design problem, not a prompt problem
When an agent calls the wrong tool or invents a parameter, the fix usually isn't a better prompt — it's a better schema. Here's how to design tools agents actually use correctly.
Read →Why we built Hive
Most team AI tools bolt agents on as an integration. We wanted agents to be first-class teammates — shared, configurable, and running on the subscriptions you already pay for.
Read →Your AI demo works. Production is where it breaks.
The gap between a great AI demo and a reliable product is almost never the model. It's everything you didn't build around it — and evals are how you close it.
Read →RAG that actually answers
Keyword search finds documents that contain your words. Semantic RAG finds documents that mean what you asked. Here's why that difference decides whether your AI is useful.
Read →