Perpetual Money Glitch 🤖💰

Inspiration 💡

Have you ever wished your computer could make money for you while you sleep? That's exactly what inspired us to create the Perpetual Money Glitch. We were fascinated by the possibility of combining Perplexity's powerful Sonar-Pro model with code execution capabilities to create an agent that could autonomously generate real-world income without constant human supervision.

The name "Perpetual Money Glitch" is our playful nod to Perplexity (the hackathon host) and to the idea of creating a "glitch in the matrix" - a system that continuously generates value on its own once set in motion.

What it does ⚙️

Perpetual Money Glitch is an autonomous AI agent powered by Perplexity's Sonar-Pro that:

  1. Plans revenue-generating strategies by thinking step-by-step about profitable opportunities
  2. Writes and executes Python code to implement these strategies in real-time
  3. Tracks earnings from its activities in a structured format
  4. Analyzes results to determine what's working and what isn't
  5. Adapts its approach based on performance data
  6. Operates ethically within programmed constraints

The agent works through iterations, with each cycle involving planning, code execution, result analysis, and strategy refinement. It's designed to pursue only legal and ethical means of generating income, with a focus on digital methods like content creation, automation tools, web services, and affiliate marketing.

How we built it 🛠️

We architected the system with several key components:

  • PerplexityBot class: The core agent that manages conversation, planning, and execution
  • Code execution environment: A secure sandbox for running Python code generated by the agent
  • Earnings tracking system: A dedicated mechanism for monitoring financial results
  • Conversation management: A system to handle the dialogue between iterations
  • Error handling and resilience: Mechanisms to recover from failures and API issues

The architecture follows a cycle of:

  1. Agent planning (via Perplexity API)
  2. Code generation
  3. Code execution in a controlled environment
  4. Result analysis
  5. Strategy refinement

We integrated Perplexity's Sonar-Pro model through their API, providing our agent with advanced reasoning capabilities to identify and implement money-making strategies.

Challenges we ran into 🧗

Building an autonomous money-making agent presented several significant challenges:

  1. Safe code execution: Creating a secure environment where the agent could run code without risking system integrity
  2. Earnings tracking: Developing a reliable system to track and verify real-world earnings
  3. Conversation management: Ensuring the agent maintained coherent reasoning across multiple iterations
  4. Error resilience: Building recovery mechanisms for when strategies fail or API calls timeout
  5. JSON parsing: Handling occasional malformed responses from the model
  6. Strategy continuity: Ensuring the agent could build upon previous work rather than starting from scratch each iteration

Perhaps the most difficult challenge was guiding the agent to focus on concrete, actionable strategies rather than vague plans. We solved this through careful prompt engineering and feedback mechanisms.

Accomplishments that we're proud of 🏆

We're particularly proud of:

  1. True autonomy: Our agent can genuinely operate without human intervention for dozens of iterations
  2. Real money generation: The system has successfully implemented strategies that earned actual revenue
  3. Adaptive learning: The agent demonstrates the ability to learn from failures and improve over time
  4. Ethical constraints: We successfully implemented guardrails to ensure the agent only pursues ethical means of income
  5. Robust architecture: The system gracefully handles errors and unexpected situations
  6. Detailed logging: Our comprehensive logging system provides transparency into the agent's decision-making

Most importantly, we've demonstrated that AI agents can create real economic value autonomously - a significant step toward truly useful AI systems.

What we learned 📚

This project taught us valuable lessons about:

  1. Prompt engineering: Crafting effective instructions for autonomous agents is an art and science
  2. Conversation management: Building systems that maintain context across multiple AI interactions
  3. AI safety: Implementing practical guardrails for autonomous systems
  4. Error handling: Designing resilient systems that can recover from failures
  5. The power of Perplexity's models: Sonar-Pro demonstrated impressive planning and reasoning capabilities
  6. Money-making strategies: We gained insights into various digital income streams

Most importantly, we learned that autonomous AI agents can be genuinely productive when given the right tools and constraints.

What's next for Perpetual Money Glitch 🚀

We're excited about several directions for future development:

  1. Multi-agent collaboration: Implementing specialized agents that work together (e.g., a research agent, coding agent, and marketing agent)
  2. Enhanced learning: Implementing more sophisticated mechanisms for the agent to learn from past successes and failures
  3. Expanded execution capabilities: Adding support for more languages and tools beyond Python
  4. Web interface: Creating a dashboard to monitor agent activities and earnings in real-time
  5. Strategy marketplace: Allowing agents to share successful strategies with each other
  6. Integration with more services: Adding direct connections to e-commerce platforms, content systems, and payment processors
  7. Improved earnings validation: Building more robust mechanisms to verify and document income

Our ultimate vision is to create a ecosystem of autonomous agents that can generate sustainable passive income for their owners, demonstrating the practical economic value of AI beyond mere automation.

Try it out 🔍

The code is available on GitHub at [link to repository]. To get started:

  1. Clone the repository
  2. Install the requirements
  3. Add your Perplexity API key to the .env file
  4. Run python main.py
  5. Watch as your digital employee begins working to generate income!

We're excited to see what the community builds with this foundation, and how far we can push the boundaries of autonomous AI agents.

Built With ⚡

  • Perplexity Sonar-Pro
  • Python
  • JSON
  • Requests
  • dotenv
  • logging

Built With

Share this project:

Updates