Yusuke710/nanoPerplexityAI — reverse-engineered prompt
Reverse engineered prompt
Build me a really simple open source version of Perplexity. I want a small Python app, ideally just one main script, where I can run it from the terminal, type a question, and get back an answer that uses Google search results as context and cites the sources it actually used.
Keep it lightweight and easy to understand, not a full agent setup and not a fancy web app. The flow should be that the model first decides if the question needs a web search, rewrites the query if needed, grabs relevant pages, pulls the text, then answers using that context. As the answer is being generated, stream it into a markdown file so I can watch it update live in a markdown preview, kind of like a minimal Perplexity experience.
Please make it save the conversation output nicely, and let me press a key to save or quit after each run. It should work with an OpenAI API key from my environment. If anything is unclear, look up current docs online and keep the code simple.
Want more depth? Deep Reverse