I spent months building an AI agent.
Not a demo. The boring parts nobody shows: – it asks permission before doing anything risky – it never sees an API key – I attacked it with prompt injection 8 ways. 0 worked.
Building it in public for the next 2 weeks. 🧵 starts tomorrow.
One more thing I want to share, out of the blue: it takes real effort to make a person switch from one product to a better one (or at least one you claim is better), as it's human nature to enjoy the state of inertia.
Real experience is the real wisdom.
One thing I have understood after spending around a year in this domain is that your perceptions about a product are only yours, not those of the people who are going to use it.
Your product might follow all the cardinal truths of product management, but if that sector is not doing well, then you must take a look at your product's alignment with it.
If the product manager doesn't have the technology sophistication, doesn't have the deep customer knowledge, doesn't have the passion for the product, or doesn't have the respect of their product team, then it's a sure thing for something not good.
Bug 5: security canaries leaked into old messages. The canary token was generated per run. But conversations replay old messages, so old canaries showed up in new runs where the output guard didn't know to strip them.
Fix: make it per conversation.
The general lesson across all 5: in agents, the unit of state is the conversation, not the request. Most of my bugs came from getting that wrong.
5 bugs that taught me how AI agents really fail in production 🧵
None of them crashed. All of them silently did the wrong thing, which is exactly why they're dangerous.
Bug 4: the cache gave the wrong answers.I cached answers by hashing the question + model + prompt version + tools + user. Great for "what's our refund policy?" Terrible for "what about the second one?" mid-conversation, because the cache key didn't include the history.
Fix: only cache the first turn of a conversation. Past that, the answer depends on context the key can't see.
The rule: anything that can change the answer must be in the cache key, or you don't cache.
Tomorrow I'm posting the bugs.
Not the "oops, typo" kind. The ones that silently corrupted data, created ghost chats, and served people the wrong answers from cache, and passed every test while doing it.
If you're building anything with LLMs + a database, tomorrow's thread will probably save you a week.
Then I made it run by itself.
Scheduled tasks let you save any question with a schedule: 🕗 "Every weekday at 8:00, summarise new arXiv papers on agent security" 📬 "Every 2 hours, check my inbox for anything from the finance team"
Schedules are either every N minutes (15 minimum) or daily at a time in your timezone.
The important design decision: scheduled runs go through the exact same pipeline as a question you type. Same tools, same permission tiers, same injection defences, same audit log. No backdoor "automation mode."
So if a scheduled task wants to send an email, it stops and waits for you. It's marked "needs approval," and you'll see it the next time you open the app.
Results appear in your chat list with a ⏰ so you can open them and keep the conversation going.
Honest limitation: the scheduler isn't replica-safe yet. Run two backend instances and a task would run twice. That's next on my list.
Deep Research mode in my agent: one question, one click, a cited report 🎥
Here's what happens when you turn it on:
🗺️Plan. The agent breaks your question into sub-questions first.
🔍Search widely. Several searches across your documents, the web, and arXiv (the research connector switches on automatically).
⚖️Reconcile. Where sources disagree, it says so rather than silently picking one.
📑Cite. Numbered citations inline, plus a Sources list at the end.
It gets double the step and token budget of a normal question, because good research needs room.
And it runs under exactly the same security rules. If a web page it reads contains an injection, the conversation is tainted and anything outbound still needs your approval. Research mode doesn't get a free pass.
(The video is sped up 2×. A real run takes a minute or two.)
Tomorrow I'm showing my favourite feature: a Deep Research button.
One click and the agent plans an investigation, searches your docs, the web and arXiv, cross-checks sources against each other, and writes a cited report.
I'll also show how it can run automatically every morning while you sleep. 🎥
@sunsetsyntax Thats understandable. But, do consider, once your available tools increases, and a user's query involves more tools, then your agent's latency might increases.
4 things I learned running MCP servers in production that aren't in the docs:
1. One dead server shouldn't take down your app. Connect to all servers in parallel, isolate failures, mark the broken one as failed, and boot anyway. Your health endpoint should report the status of each server.
2. Reconnect lazily, once. When a call hits a failed server, try one reconnect (behind a per-server lock so 10 concurrent calls don't cause 10 reconnects), then give up gracefully.
3. Never raise into the agent loop. Transport errors and tool errors come back as text: [mcp error] … / [tool error] …. The model can read an error and adapt. An exception just kills the run.
4. The one that cost me a whole day: the Python MCP SDK uses anyio cancel scopes, and they must be entered and exited by the same task. Open connections from a gather()-ed coroutine and you get baffling errors on shutdown. The fix is to give each connection its own long-lived owner task.
Bonus: prefix every tool as <server>__<tool>. Two servers will eventually both ship a tool called search.
My agent drafting and sending a Gmail reply, with a human in the loop 🎥
Hangul has connectors, tool packs you switch on per conversation from the composer's "+" menu, just like https://t.co/XN7f5o3zRV:
📧 Google Workspace: Gmail (search, read threads, draft, send), Calendar (list/create events), Drive (search/read), Docs (read/append)
📚 Research: arXiv search and paper lookup 🔌 Any MCP server declared in a config file
Results aren't dumped as raw text. A Gmail result renders as a Gmail-style card and a calendar event as a calendar card. The model reads plain text while you see a real UI.
Sends and event creation are DESTRUCTIVE, so the approval card shows a full email compose preview: to, subject, body. You see exactly what's leaving before it leaves.
Connectors are off by default. An agent with fewer tools makes fewer wrong choices, and my tool-selection evals confirmed it.
@UnifiedMachines It will ask for approval separately. For timezone, Hangul knows your device location, but if the receiver is in some other timezone then you must mention it, and accordingly, Hangul will create the meeting.