Video yükleniyor...
Video Yüklenemedi
🧵 Making Proactive Agents with Code Generation Last week we shared about how you can use code generation to compose tools. But code generation can also give your agents new capabilities- like proactively acting on your behalf.
35,797 görüntüleme • 11 ay önce •via X (Twitter)
19 Yorum

In this case, I want to make an email agent that processes my emails. Running an agent on every email I receive would be slow & unpredictable, so instead I'm allowing the user to generate callbacks that are called when I get an email. Here's an example generated function:

When doing code generation, I like to think in terms of files that execute, instead of evaluating code in a repl. Files allow Claude to verify its work, create helper scripts, etc. In my email agent, listeners are scripts in a folder that store logs as well.

This code is all run in a sandbox. So when the user makes a request that suggests a new listener, the AI writes a listener file, the backend detects it, updates and sends over an event. Everything looks seamless to the user.

Code generation in a sandbox powered by an agent is one of the most powerful tools for creating radically new user experiences. Look out for more content here, my next post will be about UI generation. You can see my code for the email agent here:

This is so good!

your tweets are the best, fascinating seeing different use cases I’ve gone through docs + repo + your tweets what’s the next best resource you recommend? who are you following/learning from? I’m interested in learning from people building with the sdk

Really looking forward to more of your reflections on product design details, CC tools mode is really surprising

Your thread is going viral! #TopUnroll 🙏🏼@chaodoze for 🥇unroll

"But code generation can also give your agents new capabilities- like proactively acting on your behalf." I am genuinely having trouble understanding how these correlate.

Very cool approach

Thank you for sharing!

Man, are you guys just using everything from my MCP Summit talk on servlets and the work I've been doing on this publically for last 5 months with and speaking on spaces, posts, code etc? The thing is you still haven't caught on to the real trick you can do which turns this up past 11....

Curious how you handle versioning and rollback of listener scripts in the sandbox environment?

@threadreaderapp unroll please

People are getting worthwhile emails!?

love these demos!

Could you make tutorials so less technical people can try it too?

Anthropic Cookbook from an year ago was goated Not these slops from recently, damn I miss the cookbook team

シェアありがとうございます!新しい能力の可能性に驚いています。 皆さんはどんな経験がありますか? 共有しましょう!




