A Go-based CLI agent that fetches open Erdős problems from the community database, sends them to an LLM for proof or disproof attempts, and securely saves the generated solutions.
📺 Overview
✨ Features
- Automated Scraping: Fetches the latest open problems from the community database (
problems.yaml) and scrapes detailed problem descriptions directly from erdosproblems.com. - LLM Integration: Uses the
any-llmlibrary to interface seamlessly with various LLM providers (OpenAI, Anthropic, Gemini, Groq, Ollama) and orchestrate proof generation. - Secure Credentials: Prompts securely for API keys and stores them via OS keychain encryption for seamless future runs.
- Continuous Solve Loop: Allows for selecting and solving multiple problems in a continuous execution loop without needing to restart the CLI.
- Robust Error Handling: Retries automatically on transient errors (timeouts, rate limits, network issues) with exponential backoff, and supports long-running LLM requests (up to 120 minutes).
- Solution Archiving: Automatically saves generated proofs as markdown files in a designated
solns/directory.
🚀 Getting Started
Prerequisites
- Go 1.21 or higher installed on your system.
Build and Run
-
Clone the repository:
git clone https://github.com/demirbey05/erdos-agent.git cd erdos-agent -
Build the executable binary:
go build -o erdos-agent . -
Run the agent:
🛠 Usage & Workflow
- Configuration: On the first run, the agent will prompt you to select an LLM provider (e.g.,
openai,anthropic,gemini,groq,ollama), a specific model, and your API key (hidden input). This configuration is securely encrypted and saved to~/.erdos-agent/config.enc. - Problem Selection: The agent retrieves and displays a list of currently open Erdős problems. You can then:
- Enter a comma-separated list of problem numbers (e.g.,
1, 42, 108). - Type
allto attempt all open problems. - Type
prizeto attempt only problems that have an associated cash prize.
- Enter a comma-separated list of problem numbers (e.g.,
- Execution: The agent will automatically fetch the full problem details, query the configured LLM with a specialized prompt to generate an unconditional proof or disproof, and wait for the response.
- Results: Generated solutions are saved in the
solns/directory. Each markdown file includes the attempt details and is easily readable.
🧠 Architecture Overview
The codebase is organized as follows:
main.go: The entry point that orchestrates the CLI flow, fetches metadata, and handles the continuous execution loop.internal/scraper/: Retrieves and parses YAML metadata from GitHub and scrapes HTML descriptions from the web.internal/solver/: Interfaces with the LLM viagollm, constructs the mathematical prompts, and handles saving the solutions.internal/keystore/: Securely manages API keys using AES-256-GCM encryption.internal/models/: Defines core domain data types likeProblemandStatus.
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
