--- title: "Town Trial: multi-agent memory for town policies" description: "Town Trial runs six agents that test a policy idea on a simulated town. past.dev is their shared memory for facts, failed ideas and audiences." canonical: https://past.dev/blog/projects/town-trial last-updated: 2026-11-19 --- # Town Trial: multi-agent memory for town policies Projects, November 17, 2026. The past.dev team. Smaran Kudapa, Nived Nandakumar and Atul Modur built Town Trial at the Iterate AI Research Hackathon. Six AI agents test a local policy idea on a simulated copy of a town. The agents share one memory on past.dev. Demo video: [A demo of Town Trial by the team](https://www.youtube.com/watch?v=ZaJVsbZ8RjM). The app shows the agents on Olympus, an island above the town. - Built by: Smaran Kudapa ([GitHub](https://github.com/SmaranKudapa), [LinkedIn](https://www.linkedin.com/in/smaran-kudapa/), [X](https://x.com/KudapaSmaran)), Nived Nandakumar ([GitHub](https://github.com/NivedN08), [LinkedIn](https://www.linkedin.com/in/nivednandakumar/), [X](https://x.com/NivedNand)), Atul Modur ([GitHub](https://github.com/Atul-Modur), [LinkedIn](https://www.linkedin.com/in/atul-modur/), [X](https://x.com/atul_modur03)) - Event: [Iterate AI Research Hackathon](https://iterate.inc/ai-research), Wefunder, San Francisco, November 14 and 15, 2026 - Live site: https://town-trial.vercel.app - Code on GitHub: https://github.com/SmaranKudapa/town-trial ## The project You type the name of a town and a policy idea, for example "Extend library hours two evenings a week". Town Trial builds the town from OpenStreetMap data and fills it with simulated residents. Six AI agents turn the idea into an experiment, run it in a simulator, and write a new version of the idea when it fails. The result is a short report about the best version: what it does, for which residents, and at what cost. Each agent has one job. | Agent | Job | |---|---| | Exa Dude | Searches the web with the Exa search API and checks each claim against its source | | Athena | Turns the idea into an experiment, writes a new version after each failure, and writes the final report | | Hephaestus | Explains why each version fails, and rejects each new version that has no source | | Hermes | Runs the simulations on Modal, a cloud service that runs code | | Apollo | Calculates the cost and compares it with the budget of the town | | Memory agent | Loads the facts of earlier trials, and creates the identities and the audiences on past.dev. In the app, its name is Past Dev. | The agents need the same facts at different times. Exa Dude finds a fact, for example the current opening hours of the library. Athena then compares each new version of the idea with these hours. Hephaestus reads the source of each claim before it reviews a new version. Apollo needs the budget facts for its cost check. A later trial in the same town can also start from these facts. ## How the memory works Town Trial calls the past.dev REST API from one Python file, [memory.py](https://github.com/SmaranKudapa/town-trial/blob/main/town-trial/backend/memory.py). On past.dev, each agent has its own identity: a name for the author or the reader of a record. Each write sends the identity of its author. Each read is one `POST /api/v1/recall` with the identity of the reader. | Agent | Writes to past.dev | Reads from past.dev | |---|---|---| | Exa Dude | Facts with their sources: opening hours, budget figures, how the town announces news, and limits such as staff hours | Nothing | | Athena | The best version of the idea in each trial, for later trials | Facts from Exa Dude | | Hephaestus | Why each version of the idea failed | Facts from Exa Dude, before each review | | Memory agent | Identities, audiences and notices | Facts from earlier trials in the same town | | Apollo | Nothing | Budget facts from Exa Dude | Hermes runs the simulations and does not use memory. Each write is one `POST /api/v1/ingest`. This is the body of a write, simplified from memory.py: ```python BASE = "https://api.past.dev/api/v1" auth = {"Authorization": f"Bearer {key}"} body = { "id": f"{town}:{source_id}", # a changed fact replaces the old one "content": f"{claim}\nSource: {source_url}", "timestamp": effective_date, # the date of the source "identity": author, # the agent that found the fact "metadata": {"author": author, "kind": kind, "trial": trial}, } httpx.post(f"{BASE}/ingest", json=body, headers=auth) ``` The `id` of a fact is the town and a name, for example `ely-mn:fact-library-hours`. If an agent writes a fact again with the same id, the new version replaces the old one. ### An audience controls who can recall a notice Town Trial can also test which residents hear a notice, for example a notice about new library hours. In these trials, the simulation measures the percentage of working parents who hear the notice within 3 days. Each resident is an identity on past.dev, with traits such as town and group. On past.dev, an audience is a group of identities, defined by a rule on their traits. Town Trial uses an audience so that only the residents who heard the notice can recall it. 1. The memory agent creates the audience `heard-{trial}` with `PUT /api/v1/audiences/{slug}`. Its rule selects each resident who has the trait `heard_notice_{trial}` set to true. 2. It writes the notice. The field `audience` of the notice is `heard-{trial}`. 3. After the simulation, the memory agent copies the result into past.dev. It gives this trait to each resident who heard the notice, with `PATCH /api/v1/identities/{identity}`. The team calls this step the replay. 4. A recall as one of these residents now returns the notice. A recall as another resident does not return it. ## What memory changed The team saved the event logs of 24 trials. The trials ran on November 15, 2026, in four towns in Minnesota, Michigan, Oregon and Texas. ### Three agents work from the facts of Exa Dude The logs have 318 reads from past.dev. In 246 of them (77%), an agent reads a fact from Exa Dude. The memory agent sends the other 72 reads: one at the start of each trial, and the recall checks of residents. Some facts from Exa Dude come from earlier trials. In 21 of the 24 trials, the memory agent started with facts from earlier trials in the same town. In 8 trials, Athena took the current opening hours from a fact of an earlier trial. | Reader | Reads of facts from Exa Dude | When | |---|---|---| | Hephaestus | 133 | before each review | | Memory agent | 60 | at the start of a trial, from earlier trials | | Athena | 53 | for the current hours and each new version of the idea | Reads of facts from Exa Dude in the 24 trials, for each reader. ### One fact from a newspaper changed the result in Ely The trace below is one trial in Ely, Minnesota. The idea of the user was to keep the library open later on two evenings each week. The score of each version is the number of visits each week by residents whose schedules conflict with the current hours. In the simulation, the idea of the user got the best score. Then Exa Dude found a cut to the library budget in a local newspaper. After this fact went into memory, Athena chose a schedule inside the new limit. 1. Exa Dude: Writes the opening hours of the library, from [elylibrary.org](https://www.elylibrary.org/): Monday to Friday, 09:00 to 18:30. Record: `ely-mn:fact-library-hours`. 2. Athena: Reads the hours. Each new version of the idea must get a better score than these hours. Record: `ely-mn:fact-library-hours`. 3. Hephaestus: Writes what the idea of the user still misses: day workers in the evening. It asks if the library board can approve more evening hours. Record: `failure-6ca98ef352e7-1`. 4. Exa Dude: Searches for this question, and finds a report in the [Ely Echo](https://www.elyecho.com/article/3605,check-it-out-at-your-library) about a cut of $38,506.91 to the library budget. The code turns the cut into a limit: 95 staff hours each week, the same number as now. The idea of the user needs 103 hours. Exa Dude writes the limit to memory. Record: `ely-mn:fact-staffing-cap`. 5. Athena and Hephaestus: Athena reads the limit before it writes a new version. Hephaestus reads it before each review. Record: `ely-mn:fact-staffing-cap`. 6. Athena: Writes the final report. It recommends later hours on Tuesday and Thursday and shorter hours on Friday, inside the limit. This schedule gets a score of 6.9, against 5.2 for the current hours. The idea of the user gets 7.1, but it needs 103 staff hours. Trial 6ca98ef352e7, from its event log, with the past.dev record of each step. ### Only the residents who heard the notice could recall it In each of the 8 notice trials, the memory agent tested recall for 3 residents: 2 who heard the notice and 1 who did not. It tested each resident before and after the replay. Before the replay, no resident could recall the notice. After the replay, all 16 residents who heard the notice could recall it. None of the 8 other residents could recall it. | Residents | Before the replay | After the replay | |---|---|---| | Heard the notice (16 residents) | 0 of 16 can recall it | 16 of 16 can recall it | | Did not hear it (8 residents) | 0 of 8 can recall it | 0 of 8 can recall it | Recall checks in the 8 notice trials. One square is one check of one resident. ## Try Town Trial 1. Open [town-trial.vercel.app](https://town-trial.vercel.app). 2. Type a town and select Build town. 3. Type a policy idea and select Run trial. 4. Read [memory.py](https://github.com/SmaranKudapa/town-trial/blob/main/town-trial/backend/memory.py). It contains each call to past.dev. To build agents that share one memory, start with the [quickstart of the Memory API](/docs/memory-api/quickstart). Thank you to Smaran, Nived and Atul for building with past.dev at the hackathon.