
Asking questions about documents in Discord
Jan 2024 - Jul 2024Simply was a companion service to Simplify Me. that brought document questions into Discord. Users could send a PDF, image, or text file and ask follow-up questions without moving to a separate website. I built it in Python, connected the Discord API to Google Gemini, and deployed it on AWS EC2.
Follow-up questions usually depend on what came before them, so I made the bot keep a limited conversation history around each document, with a reset whenever users wanted to start over. Once the context became too large, Gemini would summarize the earlier conversation before continuing. The hardest part was preventing spam and prompt-injection attacks, and looking back, I do not think I handled that nearly as well as I could have.
I also gave Simplify Me. users extended access to Simply when they shared summaries from the website. It became a small referral system that helped more people discover both projects. That was especially useful for users in places like China, because Simply could summarize and respond in over 40 languages while Simplify Me. itself was still limited to English through ToS;DR.