anarkos agents part 1 - the idea
There have been multiple, very interesting studies on LLM agents as characters in simulated worlds. The one that really inspired me to take on this project was Generative Agents: Interactive Simulacra of Human Behavior, which was a very interesting look at agents behaving socially.
What I'd like to see, though, is how agents interact when there's more to do than organizing cocktail parties. How do agents interact within market settings? How do they interact when there is a real world for them to explore? How do they interact when they can buy and sell goods? How do they interact when they can trade? How do they interact when they can plan a household, run for election with real votes, rotate crops?
These are more interesting questions. But first, we must start somewhere simple: what is the smallest possible environment we can build to start to observe interesting agentic interactions in a simulated, but realistic, environment?
## The Environment
We start with three households and a market. One house for a single man, one with newlyweds, one with parents with two young children. There is also a market in the middle of the square that buys produce and sells supplies to the farming households.
Prices of goods will at first be set statically, and the goods themselves are sold to the market and essentially enter a "black hole." Eventually, I'd like more realistic, dynamic pricing, and to make a network of villages that trade goods according to the needs of the village: an agricultural village exports produce to villages that are financial sector or knowledge work focused, who are net importers of produce but are net exporters of financial capital, or another village that does mining or fuel refining that net import produce but export fuel that other villages need to run their machines.
The list of available actions will, at first, be very simple: plant carrots or beans, water crops, harvest crops, store crops, sell crops, buy seeds, repeat. My main focus for this initial version is to ascertain how capable these agents are at doing very simple, repetitive tasks, making observations about their environment and inferring actions ("this carrot is ready for harvesting, I should harvest it", "I currently have 15 carrots in this crate, I should sell them" etc.) and then repeating the process.
Memory and Context, and Replay-ability
Here is where things get complicated.
I will, obviously, need to build a core memory and context management system, which will need to scale well since it will serve as the foundation for the rest of the project. Managing context size means establishing a "long term memory" schema, which in other projects has meant a vector store. I think I will represent this as a journal that the character always has on them that they can store long term memories in and reference for later.
These "journals" are a microcosm of a larger focus: data-logging and replay-ability.
The purpose of this project isn't just to have a fun little game up. I want to gather information about the way these agents interact with each other, and why they do the things they do. In order to do this, I need to track as much data as possible: what crops the agents are growing, how much they're harvesting, what price they're selling the crops at, how much are they producing over time, etc.
In the first version of this system, the data won't be incredibly interesting for the most part: crop prices will be stable and static, each seed will produce a constant and predictable crop yield, the crop yield will happen over a static period of time, etc.
But over time, as I implement dynamic pricing, fertilizer that can affect crop yield, and complex dynamics between agents (agents in one house can 'donate' cash to a house that isn't doing well) this data will be vital, especially when combined with what is functionally a black box of agent interactions.
I'd also like to implement a very difficult function: replay-ability. I want to be able to rewind to specific points in a simulation, unwind the "memory" of the agents back to a specific point, unwind their interactions with each other and the market, and be able to ask different agents questions about things they did. "Why did you switch from carrots to beans here? Why did you give your neighbor half your money?" This rewind feature means I'll have to be very particular about how I store data and how I can recall it. The biggest issue here is that the agents are not deterministic beings: if I rewind to a certain point in time and take care to keep all things exactly the way they are, there is a high likelihood that starting the simulation back at that point will lead to a different timeline than the original, like the branches on a tree. That said, I can approximate a "true rewind" if I can reliably unwind decisions and actions to the point that as much of the data is the same as the original timeline as possible.
Progress thus Far
Thus far, I have a character script to move around the environment (using mouse and keyboard) and the models for a market, a house, and a bag of seeds. Today, I'm starting on implementing navigation meshes from different points on the map. These will be fairly basic at first, just navigating between different points of interest on the map that the agent will be able to decide between, but eventually I'd like them to be more complex.
By the end of the weekend, I want basic agentic movement implemented to where an agent can move from the house to the farm space and from the farm space to the market, etc.
Aesthetically, I need to majorly fix the lighting and put some semblance of material textures on the models. I'm not going to be focusing a ton of effort on the aesthetics of the environment, but this looks... pretty bad.

There is... a lot of other stuff that needs to happen in the short term to get this into a shape that's even remotely interesting. So here goes nothing!