Skip to content

Latest commit

 

History

21 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Threshold

A living market, simulated.

Describe a product and how you're advertising it — Threshold doesn't predict an outcome, it builds the population that produces one. Thousands of AI personas, each with a job, a family, a personality, and a budget, live out their days: they get exposed to your ads, talk to each other, form opinions, and either buy or don't — all deterministic and reproducible, never an LLM guessing a number. On top of that deterministic core sits an agent layer where real Gemini-driven personas narrate their own days in character, and a live command layer lets you interject mid-simulation — inject a new campaign, interview a persona about why they haven't converted yet, or pull live metrics — and watch the world actually respond.

The result isn't a single conversion-rate guess. It's a causal conversion path for a real persona, a list of near-misses and exactly what gap stopped them, a taxonomy of why people didn't buy, the optimal time of day to advertise (discovered from personas' actual routines, not assumed), and a word-of-mouth network you can watch spread.

Tech: Python + FastAPI backend running a deterministic tick-based simulation engine (fatigue, word-of-mouth, mood/stress, finances, events); React + TypeScript + Framer Motion frontend. LLM layer runs on Gemini — gemini-3.5-flash for persona narration/insights, Google's iAPI (Managed Agents / antigravity-preview-05-2026) for spotlight personas running as real managed agents via client.interactions.create, with automatic fallback to plain Gemini if iAPI is unavailable. Every LLM call is guarded (timeout → retry → circuit breaker → deterministic fallback) and structurally barred from ever setting a probability, price, or purchase outcome — it only proposes and narrates; a separate resolver validates and executes against the deterministic engine. A live command layer (inject_campaign / talk_to_persona / query_metrics) lets you reach into a simulation while it's still running — the same router the Live API voice interface is built to sit on top of.


Idea Explanation

the user gives you a product idea and the methods he is using to advertise his product, we run a simulation and say how well the advertisement method worked. how many people purchased the product, how many didnt, how many were aware and insights based on what other methods he could have chosen etc. also we give a chain of events on how info about the product spread.

user gives product idea + ad methods. user gives text based info.

an llm converts to proper json based attributes which are pre required for the simulation. if enough info arent given to cover the json the LLM is allowed to ask questions back to the user to fill up the json, increasing interactivity.

lets say i have a machine to generate a lot of personas, so i already have a lot of personas. each persona(json) have the same attribute keys but with different values. what are the attributes ? we will add that later based on whats required for the simulation so reverse engineering. based on the persona, for the different ad methods we have try to calculate how much that specific stream of ad will affect them. how fast will a person accept this method of ad. this is purely going to be based the persona's personality(json attribute values). These are going to be used as weights, when a persona is exposed to an ad method.

All of these personas are grouped into different families, their attributes like age and other things should match according the their family status son - lower age, father more age and things like that.

All the independent(job) people should be grouped into companies, company events like bonuses, firing, should all be handled.

people should also have schools, colleges where interactions again can happen.

Next a time table is generated using LLM's for each persona, a generic time table for each persona based on their personality(json attributes) ofc.

Then we have a global counter which counts the global time. each person is at a specific location doing the stuff mentioned in his timetable. based on the things he is doing he might become exposed to an ad and his enthusiasm value will increase based on weight and other dependent stuff. when multiple personas are at the same location - home - eating breakfast - a speak(word of mouth) event maybe triggered details listed below later. in the conversation, one person could end up talking about the product to another person. thats how conversations happen between personas. can happen at friend level, family level, office colleague level etc. other non-word of mouth events are triggered too based other dependencies mentioned later based on location, niche, phone etc.

This is how we will be simulating hundreds or thousands of personas, as everything is formula/probability based and deterministic.

at every instant of time each persona's action, location should be strictly tracked.

enthusiaism meter must be tracked accurately and certain attributes of the person and the feeling toward the product must be changed based on this meter too.

We log the major events somewhere and then pass that onto an LLM to generate text which explain exactly how the information spread and what means were really important what didnt really contribute and stuff, we offer proper insights here.

Feature Explanation

  • phone - have a list of apps for a person based on their personality from their attributes and when they just want to randomly look into their phone, choose a random one from them (use weighs for the apps too if possible as a person might be into a specific app).

  • family members are divided into Independent and Dependent based on if they earn or not.

generally how a convo happens ? :

  • if A is generally comfortable with group, generally shares stuff
  • if the product has made a significant impact on him enough to talk about it

WORD of MOUTH

  • Recommend - if A thinks the other person might be interested in the product
  • Debate/convince - if you really like a product and the other person disagrees, you try to defend it. cant really be simulated ig
  • Ask(family) - if the person is dependent and doesnt make any money, asks inpedendent person in the family.
  • Opinion - if A doesnt have niche on something and B does, A might end up asking an opinion about it to B
  • Shared - if the item is sharable, between family member, friend, colleague, split the money. both needs niche for the product and okay with sharing.

Result :

  • for recommend he can end up considering the product or ignore it make algorithms/formulae for this
  • debate cant really be simed rn
  • ask, the independent decides based on his budget situation
  • shared, if item is sharable and both wants.

BUDGET MECHANISM

  • family level
  • for independent people with a job
  • has a fixed salary, he gets on a date
  • pay frequency needs to be decided
  • consider bonuses and side hustles spendings :
  • EMI/RENT - starting payments
  • groceries/necessities
  • random spendings - medical, shopping, food deliveries
  • savings

Disposable income is calculated based on this. ans agreeing for Asks is decided based on this budget mechanism

Track bank account of people too, their savings as well as some people will be willing to spend some money from that if the dependent is really asking them a lot or if they are really interested in the product, generally for high priced products like a PC, Houses etc.

Non-word of mouth

  1. Phone system - multiple apps based on personality, when seeing phone, choose a random app. have seperate apps decidated on specific times too based on personality in the time table(merge phone with other events too, Ex : like going to office in the metro while seeing phone)

  2. Social media - has niche(algorithm will find the person better) and the person is on the same app, then he gets a percentage change of getting that ad if the ad exists on that medium

  3. Celebrity/Influencer - the celebrity doesnt really matter here, if person knows celeb, he will get that content on a very higher percentage chance. almost 100. influencers are almost everywhere. only works when the user has ad collabed with an influencer. do a popularity search based on the celeb mentioned(LLM) and start of with almost that many people knowing that celeb.

  4. Banners - person going to a specific location(transit/on a walk etc) then he might end up seeing the banner.

  5. Podcasts - generally dont have dedicated time for podcats(low exceptions could exist) so people generally listen to podcasts while doing other stuff. so attach podcasts to other half focus needed stuff and include it as an app, in the rand app picker. also niche matters here too for the ad to match.

  6. Searches - if persons niche matches almost perfectly with the product, triggers a search event during phone time, he searches on top sites, and if ad is present there he sees it.

you can find other appropriate times for this event too, doesnt necessarily take long.

either already has money and is searching or might ASK later to an independent family member.

  1. TV ad - tv ad is chosen by the user based on channel, niche and channel. channel doesnt really matter in this simulation i think. so a TV event is needed for people. watching tv, is really obsolete nowadays so not a common event tbh.

  2. Radio ad - user chooses, time, niche. Radio event generally triggered while driving car and listening to the radio. depends on personality of the person too if he would listen to the radio while driving.

  3. Cinema ad - user chooses type of movie. Movies should be a random event. a person never goes alone, only with friends. friends with same interest as of the movie theme. and relationship level matters too.

  4. OTT ads - user chooses niche(show type), age-group. watching shows in an event, measure stress of people and stuff, a person watches shows to relieve stress if the person is into shows/movies. all group(friend/family) agrees with similar interest, watch shows together. if niche is 18+ then avoid watching with family.

  5. Billboards ads - assume the location of the bill board is appropriate and the user givees u niche. so if niche of the person matches and he goes outside, he ends up seeing the billboard.

  6. instore display ad - niche + goes shopping. shopping is an event too. triggered generally alone or with family.

  7. Content and review - person searches for content related to a certain product he is looking for and conducts small research. related to the 6) Searches mechanism. LLM gives a score for the product and based on that the product either appears at the top or doesnt. so eith a normal search event happens or this happens. this affects way more obviously.

  8. Random see event - the product might be randomly seen, very very low chance but can happen, during shopping, just in an imaage random places you decide some random events like these.

Problem : since each person follows the same timetable, each day will look the same, so result will just be 1 day * no of days. hence these different events are what makes each day different. so try adding all kinds of different events, whatever u can think of to make the simulation better and more real and most importantly different each day.

-----Iteration 1 features----

  1. Ad fatigue - after each exposure the the attribute(affecting weight) must be reduced. non linear decay, almost logrithmic.

  2. Enthusiasm decay - see the ad once and for a while u dont the enthusiasm meter drops. the decay rate again needs to be personality and impact dependent.

  3. Awareness states - based on enthusiasm meter, should be different thresholds for different people based on their personality.

  4. FOMO - if most people in a group(colleague/friend/family) has one, then due to FOMO the left out people become interested too

  5. Mood/Stress state - keep track of each persona's mood and almost every exposure and interaction depends on it. Ex: bad mood - generally ignores chats, ads have less effect good mode - impulse buy

  6. weekday/weekend - total different timetables

  7. relationship status - needs to be tracked, influence totally depends on this, key for WOM. Needs to be bidirectional A -> B and B -> A could be different.

  8. Daily random event roll - add random extra events to a day, changing the daily repetetive timetable.

  9. Time table appender - we have a general timetable, but for each day of the week, we add extra notes/events, like Friday - more free, happy as you have weekend approaching, Sunday - enjoying but still stressd about he work needed to submit on monday. so not whole new timetables, just custom variations of it based on persona attributes.

--- Random event pool for now --- -Bad sleep → mood penalty -Sick day → home all day, more phone/OTT/YT -Unexpected expense → kills purchase likelihood -Late night → extra browsing block

School Interactions :

Map is divided not into different schools, but different grades, as we cant simuate all the different grades/classes inside a school. so we have buildings representing different grades(1-12).

They go to respective grades based on their age, rather than having different schools for each age like 1-12(12 schools), we will do a logical split between them, and the split is :

Std : 1-3 Std : 4-6 Std : 7-8 Std : 9-10 Std : 11-12

Convo Events :

  • FLEX : you see someone else having the same product
  • FOMO : most of the class has the product, so the left out person wants it too
  • EXTERNAL : If the product causes an impact on you outside school, you end up speaking about it to classmates(all together)/friend group or your main friends.
  • OPINION - same as the normal one

IDEA DESIGN : you have multiple buildings representing different logical grades, conversation happens only when persona's are at school at the same time. User gives product, an LLM decides which building should be ON/OFF based on the age relevance of the product and the building. Friendship's betweeen the personas are initially set based on gender, interests(niche), hobbies, Personality(introvert/extrovert), (sometimes even academic level). then these relationship statuses change overtime. enthusiasm meter fills here too based on the convos the students might have. Obviously most of these students will be dependent and with enough enthusiasm they end up asking for it at their homes(independent(father)).

Convo events here are handled based on previous WOM convos, things like mood and other stuff obviously affect things.

College Interactions (whats new from school) :

Buildings are divided based on courses(Medical, CSE, Arts etc), the rest of the stuff remains almost the same as School. LLM decides which building to keep ON based on the product. Rest of the idea remains same like the school one.

Companies/Job Interactions :

So have building based on different fields, these represent different companies, all of them dont speak to each other(you would believe in school everyone speaks to each other but actually since the relationship between them wont be high most people end up not speaking to each other) so we'll follow that here too. so each company endup becoming a building. The convo events remain the same. Salary mentioned in the persona's json needs to be paid on time, and need to integrate smoothly with the budget mechanism. then maybe track another meter called the budget meter ? based on salaries and bonuses this fluctuates and this heavily affect if a person wants to buy something or some dependent person asks him for something.

Mood and stress States Mood : Bad | Neutral | Good it affects WOM(social behaviour), Ad effect, impulse buying

Examples : Stress hits 3 -> bad sick day -> bad unexpected expense -> bad got paid -> good weekend arrives -> good

Stress Counter(0-3) OTT trigger when high stress more phone usage late night awake event less WOM stress carries over to next day

Combinations :

Good + (0-1) = high ad effect, more buy chance, high WOM Good + (2-3) = lesser ad effect, a bit busy, less likely to act

Neutral + (0-1) = Default behaviour, normal ad effect Neutral + (2-3) = Stressed, higher phone/OTT usage

Bad + (0-1) = low ad effect, avoids WOM, more scrolling Bad + (2-3) = near zero ad effect, almost no chance to buy

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages