LLM-Powered Agent Simulation
The Extension
Section titled “The Extension”Instead of rule-based agents, we use Claude Opus as the reasoning engine:
Given: - Your persona (income, location, preferences, habits) - Real location data (competitors, distance, demographics) - Mathematical model outputs (Huff probability, catchment zone) - Company concept (what they want to open, pricing, target)
Reason as this person: Would you eat here? Why or why not?Data Requirements
Section titled “Data Requirements”Inherits all datasets from ABM Theory, plus:
| Dataset | What We Use | Link |
|---|---|---|
| FEHD Restaurant Licences | Agent decision context (competitor options in prompt) | View → |
| Ethnicity | LLM persona generation (cultural dining preferences) | View → |
| Household Income | Agent budget constraints in prompts | View → |
| Border Crossing Queues | Tourist/mainland visitor agent injection rate | View → |
Why Opus, Not Sonnet
Section titled “Why Opus, Not Sonnet”| Factor | Opus | Sonnet |
|---|---|---|
| Persona consistency | Excellent | Good |
| Nuanced tradeoffs | Excellent | Good |
| Contradictory reasoning | Handles well | Sometimes flattens |
| Cost per agent | ~$0.05 | ~$0.01 |
For 10 agents, total cost: ~$0.50. Trivial compared to the analysis value.
How Company Input Changes Agents
Section titled “How Company Input Changes Agents”This is the critical link. Each agent receives:
- Open Data — same for all agents (restaurants, demographics, transport)
- Model outputs — Huff probability, catchment zone
- Company concept — your business profile, pricing, target customer
Different business concepts get different agent reactions at the same address. The models calculate different β values. The agents reason about different tradeoffs for a wine bar versus a quick-service lunch spot.
Cost of the Full Pipeline
Section titled “Cost of the Full Pipeline”| Component | Method | Cost |
|---|---|---|
| Open Data | CKAN API, FEHD XML, MTR CSV | Free |
| Mathematical models | Huff + Gravity + Catchment | Free |
| Agent simulation | 10 × Claude Opus | ~$0.50 |
| Total | ~$0.50 |
A comparable analysis from a retail consultancy: $50,000-100,000.
Roadmap
Section titled “Roadmap”MVP (Current Implementation)
Section titled “MVP (Current Implementation)”10 synthetic personas generated from demographic data for the target area. Each persona is prompted with:
- Real location data pulled from open datasets
- Mathematical model outputs (Huff probability, catchment population, site score)
- The company’s business concept, pricing, and target customer profile
Claude Opus reasons as each persona and produces structured output: visit likelihood, key objections, unmet needs, and a natural-language explanation.
Future: MirrorFish Integration
Section titled “Future: MirrorFish Integration”The MVP uses 10 hand-crafted synthetic personas. The next stage replaces these with MirrorFish — a population-scale agent simulation platform that generates hundreds of statistically accurate synthetic agents from demographic distributions.
| MVP | MirrorFish | |
|---|---|---|
| Agent count | 10 | Hundreds |
| Persona source | Hand-crafted from demographics | Statistically generated populations |
| Demographic accuracy | Approximate | Census-calibrated distributions |
| Cost | ~$0.50 | Higher compute cost |
| Status | In development | Planned |
MirrorFish agents would reflect the full heterogeneity of the target area: the right proportion of elderly residents, young professionals, domestic workers, tourists, and office commuters — each with internally consistent attributes drawn from real demographic data.
Implementation Notes
Section titled “Implementation Notes”Current Implementation (2026-03-25)
Section titled “Current Implementation (2026-03-25)”Still a placeholder: No LLM inference occurs server-side. The function returns a structured response that the frontend can use to run inference client-side.
Prompt template: A fully-formed prompt string is generated and returned, incorporating real context from the request:
- District name and key demographics (population, median income)
- Competitor count within 800m
- Cuisine type(s), price band, floor area, target customers
- Instructions to simulate 5 named personas with step-by-step reasoning
Hardcoded persona profiles: personaProfiles array contains 5 pre-written entries — Office Worker, Local Resident, Tourist, Foodie/Expat, Budget Student — each with:
reasoning: templated string referencing cuisine and price bandvisitLikelihood: string like “Medium-High”, “Low-Medium”
Note: These are not LLM-generated. They fill the expected output structure before real inference is wired.
Placeholder verdict: A pre-written verdict string based on competition count and median income thresholds — gives a rough summary without LLM reasoning.
requiresLLM: true: Always present in the response. Signals to the frontend that client-side inference is expected to replace the placeholders with real LLM output.
Changelog
Section titled “Changelog”| Date | Change | Why |
|---|---|---|
| 2026-03-25 | Prompt template updated with richer context (floor area, target customers, structured task) | Initial template lacked service model and target customer context; makes LLM output more actionable |
| 2026-03-24 | Initial implementation. Placeholder from launch; LLM inference deferred to client-side. | — |