Max Hodak Writings


April 2023

The code: build-a-bot on GitHub

I’ve been as blown away as everyone else by the recent progress in AI. Every day I’m surprised by some new behavior someone has figured out how to prompt out of an LLM; it is obvious that these models are going to transform many industries.

A major emerging theme is composing different models and plugins into complex meaningful behavior. There are a bunch of existing libraries for doing this, including probably most famously LangChain, but after some initial experiments we felt like we wanted something slightly different.

Our core goals were to build something simple, robust, and fully asynchronous, which we could deploy to production and leave running with minimal intervention for extended periods of time, while also being easy to protoype interesting new complex patterns like self-reflection or multi-agent communication. We also wanted to emphasize the simple: running it should be as simple as setting an environment variable or two and running one command, not figuring out a multi-stage Docker build or something.

agent intro gif

We’ve open sourced what we have as build-a-bot, and an agent we’ve built using it is currently deployed to production at Science, though our adventures with it are still very early.

One pattern in particular that’s easy to implement is daydreaming, where multiple models are wired up to converse with each other with slightly different prompts, allowing the daydreamer to autonomously trace out trajectories in the embedding space around an initial prompt. Some of our experiments have shown this to be useful for really powerful self-prompting that can result in much smarter downstream responses than you’d get at first by effectively giving the model some time to mull things over for itself.

agent daydream example

I’m posting this here rather than on Science’s official blog since this is a small experiment at this stage and I’m not speaking on behalf of the whole company with this project at this point. I think it’s super important for there to be a strong open source tradition in compositional AI agents, though, and if others find this as useful as we have I’m sure we’d be interested in supporting further development in collaboration with the community.