惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
大猫的无限游戏
大猫的无限游戏
博客园 - 聂微东
Jina AI
Jina AI
The Cloudflare Blog
V
Visual Studio Blog
博客园_首页
量子位
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 【当耐特】
爱范儿
爱范儿
博客园 - 三生石上(FineUI控件)
小众软件
小众软件
博客园 - 司徒正美
阮一峰的网络日志
阮一峰的网络日志
Last Week in AI
Last Week in AI
V
V2EX
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 叶小钗
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
WordPress大学
WordPress大学
宝玉的分享
宝玉的分享
T
Tailwind CSS Blog
博客园 - Franky

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
PostHog Rebuilt Their AI Architecture Twice. Here Are the...
Patrick Hugh · 2026-04-30 · via DEV Community

PostHog ships analytics to thousands of daily agent users. They rebuilt their AI architecture twice before landing on something that worked. That is expensive learning. Most teams cannot afford two rewrites.

They distilled the pain into five rules. I am going to reframe each one as a diagnostic question. If you cannot answer these about your product, you have work to do.

Rule 1: Treat agents like users

The question: Do you build empathy for your agent users the same way you build empathy for human users?

Most teams treat agents as an afterthought. They bolt an API onto a product built for humans and call it "agent support." That is like building a mobile app by shrinking your desktop site to fit a phone screen. Technically works. Actually terrible.

PostHog's insight: you need to talk to agents, watch them work, and develop intuition for what they want. The same product instinct you build for human users applies to agent users.

How to tell you are doing it wrong: You have never watched an AI agent use your product end to end. You do not know where it gets stuck, what confuses it, or what it skips.

The cheap fix: Run Claude Code or Cursor against your product for 30 minutes. Watch what happens. Write down every point of friction.

Rule 2: Give agents the same capabilities as users

The question: Can an agent do everything a human user can do in your product?

The value of agents is reducing the time, attention, and expertise needed to complete a task. If your product does not give agents the same capabilities as users, you are always bottlenecked by a human in the loop.

This sounds obvious. It is not. Most products have features that only work through a UI (drag-and-drop, visual configuration, modal dialogs). Those are invisible to agents.

How to tell you are doing it wrong: There are tasks in your product that require clicking through a UI to complete. No API. No CLI. No programmatic alternative.

The cheap fix: List every user action in your product. Star the ones that have no API equivalent. Those are your agent capability gaps. Fix the highest-traffic ones first.

Rule 3: Meet agents at their semantic layer

The question: Are you giving agents a high-level API or meeting them where they already reason?

PostHog found that agents reason best in SQL. Not in proprietary query languages. Not in custom DSLs. SQL is the semantic layer where LLMs already have strong intuition.

So they built their agent experience around SQL. Not because SQL is the best query language. Because it is the one agents already know.

How to tell you are doing it wrong: Your agent integration requires the agent to learn your custom API schema from scratch. It reads 50 pages of docs before it can do anything useful.

The cheap fix: Find the universal language closest to your domain. For data products, that is probably SQL. For infrastructure, that is probably CLI commands. For content, that is probably markdown. Build your agent interface on that layer.

Rule 4: Front-load context

The question: Are you loading domain context at session start or forcing the agent to rediscover it every time?

PostHog loads their taxonomy, SQL syntax, and critical querying rules at the start of every MCP session. The agent does not waste tokens figuring out what a "person" is in PostHog's data model. It already knows.

This is the difference between a new hire who gets a 30-minute onboarding doc and one who gets dropped into the codebase cold.

How to tell you are doing it wrong: Every agent session starts with the agent asking "what tables exist?" or "what is the schema?" It spends 40% of its token budget just figuring out where it is.

The cheap fix: Create a system prompt or context file that loads at session start. Include: data model, naming conventions, common queries, and known gotchas. Measure the token cost of context loading vs. the token savings from fewer exploratory queries.

Rule 5: Skills, not scripts

The question: Are your agent skills domain knowledge or micromanagement scripts?

There is a difference between telling an agent "click this button, then type this, then click submit" and telling it "good retention analysis starts with a cohort definition based on a meaningful activation event."

The first is a script. It breaks every time the UI changes. The second is knowledge. It works regardless of the interface.

PostHog's skills embed opinions about what good metrics and analysis look like. They do not tell the agent which buttons to press. They tell it what good output looks like.

How to tell you are doing it wrong: Your agent instructions read like a QA test script. Step 1, step 2, step 3. The agent fails when any step changes.

The cheap fix: Rewrite your agent instructions as outcomes, not procedures. "Create a retention chart grouped by signup week" not "click New Insight, select Retention, set Group By to Week, set Event to $signup."

The meta-lesson

PostHog rebuilt twice because they started by bolting agent support onto a human-first product. The five rules are really one rule: agents are a different user with different needs, and they deserve the same product thinking you give human users.

If your product supports agents, ask yourself these five questions. If you cannot answer them confidently, you know where to start.


Building agent features? AgentGuard adds runtime safety (budget limits, loop detection, kill switches) to any AI agent in three lines of Python.

Get started with AgentGuard

Related: AI Agent Cost and Pricing in 2026

Source: The golden rules of agent-first product engineering