How it works
This chatbot answers questions about Ray Peat's ideas using only what he wrote and said, and shows where each claim comes from. I built it and run it on my own, Javi, and all the code is public on GitHub.
The problem
Ask any AI about Ray Peat and it mixes what he said with what the internet says, and sometimes credits him with the opposite of what he thought. Here the AI does not answer from memory: it first searches his texts and then answers with what it found, citing it.
Where the answers come from
- 78 articles from raypeat.com, downloaded and split into short passages.
- 5 books, cited by page. Their text is copyrighted: it is used to answer but never shown.
- 53 issues of his newsletter (Ray Peat's Newsletter, 1995–2013), cited by date. Also copyrighted: used to answer but never shown. Issues he later published as articles on his website are used from there.
- 221 radio and podcast interviews, about 250 hours of audio. A program of my own transcribes them and marks who is speaking in each sentence, so only Peat's words count as his opinion.
What happens when you ask
- The AI decides what to search for. It gets your question and a search tool. It can search up to three times, from different angles.
- The search combines two ways of finding. One by meaning (it finds a passage even if it uses other words or another language) and one by exact words (for terms like "pregnenolone"). The results of both are merged into one list.
- The answer is written from those passages, in the language you asked in. Each number in brackets opens the original text, or the audio of the interview.
How I know it doesn't make things up
I measured it with 30 questions. Another AI acts as judge: it splits each answer into claims attributed to Peat and checks them one by one against his texts.
- Searching his texts: 198 of 202 claims supported (98%) and none contradicting him.
- The same model, from memory: 144 of 198 (73%) and 7 contradicting him.
On top of that, every time I change the bot's instructions a suite of 34 questions runs with automatic checks: that it cites the expected sources, that literal quotes really exist and that it does not answer about topics unrelated to Peat.
What it is built with
- Server: Java 21 and Spring Boot, with hand-written SQL.
- Data: PostgreSQL with pgvector for search by meaning.
- AI: Claude (Anthropic) to answer, Voyage AI for search and Whisper to turn voice into text.
- Web: HTML, CSS and JavaScript, no frameworks.
- Infrastructure: AWS in Ireland, with Docker.
Privacy and limits
No accounts, cookies or ads, and IP addresses are not stored. The details are on the privacy page. Answers may contain errors and are not medical advice.
The code
It is at github.com/javimp21/peatying, under the MIT license. The README also tells the problems that came up and how I solved them. Ray Peat's texts are not in the repository.