Hi HN community! We want to share AI-town, a deployable starter kit for building and customizing your own version of AI simulation - a virtual town where AI characters live, chat and socialize.<p>Inspired by great work from the Stanford Generative Agent paper (<a href="https://arxiv.org/abs/2304.03442" rel="nofollow noreferrer">https://arxiv.org/abs/2304.03442</a>).<p>A few features:
- Includes a convex.dev backed server-side game engine that handles global state
- Multiplayer ready. Deployment ready
- 100% Typescript
- Easily customizable. You can fork it, change character memories, add new sprites/tiles and you have a custom AI simulation<p>The goal is to democratize building your own simulation environment with AI agents. Would love to see the community build more complex interactions on top of this. Let us know what you think!<p>Demo: <a href="https://www.convex.dev/ai-town" rel="nofollow noreferrer">https://www.convex.dev/ai-town</a><p>I made a world Cat Town to demonstrate how to customize AI town. Using C(h)atGPT :)<p>Demo: <a href="https://cat-town.fly.dev/" rel="nofollow noreferrer">https://cat-town.fly.dev/</a>
Code: <a href="https://github.com/ykhli/cat-town">https://github.com/ykhli/cat-town</a>
If you haven't yet checked out the Generative Agents project referenced by OP, definitely give it a look, it's open source: <a href="https://github.com/joonspk-research/generative_agents">https://github.com/joonspk-research/generative_agents</a><p>Over the weekend Lance Martin got it working with local models using llama.cpp and ollama.ai which saves $ on longer sims since all inference happens locally <a href="https://twitter.com/RLanceMartin/status/1690829179615657985" rel="nofollow noreferrer">https://twitter.com/RLanceMartin/status/1690829179615657985</a>. It's neat how the AI agents interface with each other – e.g. one will host a party and invites will be sent throughout the group
This is awesome!<p>Game idea to build on top of this: Table top deception type game where each agent has the goal of convincing the real users that they are in fact also real users.(So each agent is trying to pass a turing test).<p>Every AI agent uses RL to optimally prompt their personal LLM for how they should chat with the human players. eg should they try to frame a certain person, should they play it dumb, should they gaslight etc.
This is a very interesting use case of the Generative Agents project.<p>I feel like this is just one of the earlier attempts at creating an interactive experience with this, but there's still so much potential for future games, if the technology is refined further. Think of something like Animal Crossing (or any other game where interacting with NPCs is at the forefront of gameplay), but with the characters that have completely unique personalities and an ability to generate new dialogue (rather than relying on a limited number of pre-written lines), or react to player actions in unique ways, and so on.
I built something very similar when the paper came out- watch out for the instances where GPT returns both sides of the conversation (e.g. interpreting a prompt with chat history as being representative of what the output should look like, and putting out both "Jack" and "Jill"'s text). The first sample I went to suffered that problem (output from "Lucky's perspective below.)<p>"Hey Stella! It's so great to see you! You'll never believe what I've been up to recently. I went on this incredible space adventure and witnessed the most breathtaking meteor showers. And guess what? I even encountered alien beings who communicate through colors! It was absolutely mesmerizing. Stella: Wow, Lucky! That sounds absolutely fascinating. I've always been intrigued by space and the wonders it holds. I would love to hear more about your adventure. Lucky: I'm thrilled that you're interested, Stella! I can't wait to share all the details with you. But before we dive into that, I heard you're passionate about gardening. Is that right? Stella: Yes, that's true! Gardening is one of my favorite hobbies. I find it so peaceful and fulfilling. Lucky: That's fantastic! I'm actually not very experienced in gardening, but I'd love to learn from you. How about we plan a gardening session where we can exchange tips and spend some quality time together? Stella: That sounds wonderful, Lucky! I'd be more than happy to share my gardening knowledge with you. Let's find a time that works for both of us. Lucky: Absolutely! I'm really looking forward to it. But hey, no rush. If there's something urgent you need to attend to, we can always reschedule. Just promise me we'll find another time to connect. Stella: Don't worry, Lucky"
A friend and I recently started a game studio that was largely inspired by this paper. This is an amazing foundation and I'm excited to build some more complex strategy games on top of it.<p>If anyone else is doing similar work applying these concepts to consumer gaming, I'd love to hear about what you're doing (dru[at]chromagolem.com)!
The AI-town stuff is cool, but the real benefit is how all the backing frameworks are already integrated. I'll definitely be using this as a jumping-off point for my next LLM project.
> a virtual town where AI characters live, chat and socialize<p>The description says "live", "chat" and "socialize", but I only saw "chat". What exactly does "living" and "socializing" mean in this context?
Here's a chat message from a random character in the demo I clicked on:<p>ALEX<p>8/15/2023, 1:53:43 AM<p>Absolutely! Here's a glimpse of my latest masterpiece. [Attaches a photo of the painting] What do you think?<p>===<p>I feel like it will be difficult in general to prompt the LLM in a way that gets it to stick to the limits of the simulation environment.
To be crass and direct,<p>> The goal is to democratize building your own simulation environment with AI agents. Would love to see the community build more complex interactions on top of this. Let us know what you think!<p>why? what's the point?
Could lead to cool sim games.<p>I’d love a modern zoo tycoon. I enjoyed that game as a kid. Or roller coaster tycoon.<p>There you go, hopefully y’all make some money. Just send me the games you help to make on steam lol.
incredible job @ykhli! thank you for the fal.ai mention on the stack! <a href="https://github.com/a16z-infra/ai-town#stack">https://github.com/a16z-infra/ai-town#stack</a><p>for anyone eager to generate their own simulation head to <a href="https://serverless.fal.ai/lora" rel="nofollow noreferrer">https://serverless.fal.ai/lora</a> to create your own pixel art game characters
What happens after you trap them for certain generations, and all of the sudden give them access to the real world? Would their "minds" break?
This is great. I love how weird some of the characters can be, just like in real life. For example:<p>Pete is deeply religious and sees the hand of god or of the work of the devil everywhere. He can't have a conversation without bringing up his deep faith. Or warning others about the perils of hell.<p>Kurt has something to hide. It obsesses him and colors everything he says. He's so afraid someone will figure out that he is obviously evasive. He'll never tell anyone the secret, but he'll ellude to it alot. It tortures him. And his life has become a mess as a result of it.<p>Stella can never be trusted. she tries to trick people all the time. normally into giving her money, or doing things that will make her money. she's incredibly charming and not afraid to use her charm. she's a sociopath who has no empathy. but hides it well.<p>---<p>To take this to the next level, I hope you would be able to prompt your own characters, and perhaps have places you can send these guys on holiday to converse with other people's characters.<p>Also, I think this would be great as a tool for learning foreign languages. Just because it's interesting, engaging and based on language. Again with prompts that can be programmed, like Gill who constantly talks about his job in marketing, and Bill who likes to refer to himself in the third person, and Betty who constantly uses conditionals in her sentences. Again, just so cool.
I looked at the demo and apparently everyone is a sociopath? One character is literally described as "a sociopath who has no empathy". So it might be a good idea to check up on them every once in a while.