This is a short story I read online maybe 5-7 years ago, though I'm unsure if it was a republishing of a printed story. I believe it was a more modern short story, but I could be wrong, and I cannot remember the name for my life. I think it was some anthropologist context.
It is very short, but the gist is that the formula is written on an artifact of a fallen civilization. He asks an onboard AI to synthesize it, but the AI immediately gives a warning to stop him with no explanation. He ignores it and the computer produces a small pill. He takes it, and we realize the pill induces a permanent high of happiness, not wanting to do anything else, or needing to, and its implied he will waste away as food or drink is unwanted.