mvp-ai's picture
|
download
raw
6.06 kB
# AGENTS.md
Erdős Navigator — a queryable database of 1,217 problems posed by Paul Erdős,
plus the record of what AI systems have already attempted on them.
This file follows the [AGENTS.md](https://agents.md) convention and is read by
Codex, Cursor, Copilot, Zed, Windsurf, Amp, Jules, Aider and others. Claude Code
also reads `CLAUDE.md`, which carries the same facts in more depth.
## What this repository is for
Two audiences, one codebase:
1. **Agents using the data** — pick a problem, see what has been tried, attempt it.
2. **Agents developing the tooling** — extend the CLI, API, MCP server or sync.
If you are here to work on a mathematical problem, start with
`./erdos ai {number}` and read `.claude/skills/erdos-solver/SKILL.md`.
## Setup
```bash
pip install -r requirements.txt
```
The SQLite database ships in the repository at `data/erdos_problems.db`. No
scraping, no API keys, no build step.
## Commands
```bash
# Problems
./erdos get 42 # one problem
./erdos find "Sidon set" # full-text search
./erdos open primes # open problems by tag
./erdos prizes # open problems with prizes
# AI attempt history — check this before working on anything
./erdos ai 42 # what AI systems tried, when, and how it went
./erdos frontier # open problems with no recorded AI attempt (472)
./erdos frontier --formalized # ...that already have a Lean statement (236)
./erdos ai-failed # open problems where an AI claim was wrong (8)
./erdos ai-stats # contribution counts by system and vendor
# Database
./erdos stats # counts by status, tag, formalization
./erdos provenance # per-source freshness — read this first
./erdos corpora # registered problem corpora
./erdos sync # refresh from upstream git sources
# Services
python api/main.py # REST API on :8000, docs at /docs
python mcp_server/server.py # MCP server over stdio
```
Add `--json` to `get`, `ai`, `frontier`, `ai-failed`, `ai-solved`, `ai-stats`,
`provenance`, `corpora` and `stats`.
## Data freshness — read before trusting a field
Run `./erdos provenance` for exact dates. Summary:
| Fields | Source | Status |
|--------|--------|--------|
| status, prize, tags, OEIS, formalization | teorth/erdosproblems (git) | **live** |
| Lean file links | google-deepmind/formal-conjectures (git) | **live** |
| AI contribution record | teorth/erdosproblems wiki | **frozen 2026-06-30** |
| statements, reactions, comments, contributors | erdosproblems.com | **frozen 2026-02-01** |
erdosproblems.com is behind Cloudflare bot protection, so statements cannot be
refreshed. Problems #1180–#1217 therefore have full metadata but **no statement
text**. Do not add scraping workarounds — see `scrapers/legacy/README.md`.
Always confirm a problem is still open at `https://www.erdosproblems.com/{number}`
before investing serious effort in it.
## Architecture
```
data/erdos_problems.db SQLite: problems, tags, references, reactions,
comments, ai_contributions, ai_systems, corpora,
source_provenance
corpus/ Pluggable corpus framework + git-based sync
base.py Corpus / Source / SyncReport abstractions
registry.py Where corpora are registered
erdos/ The Erdős corpus and its four sources
tools/query_db.py Python SDK (ErdosDB) — the single query layer
erdos CLI, wraps the SDK
api/main.py FastAPI REST service
mcp_server/server.py MCP server for cross-agent access
lean/ Lean 4 + mathlib project for formalizing proofs
.claude/skills/ Problem-solving, technique and formalization skills
scrapers/legacy/ Retired HTML scrapers (non-functional)
```
Everything reads through `tools/query_db.py`. Add a query there first, then
surface it in the CLI, API and MCP server — do not write SQL in those layers.
## Conventions
- Python 3.10+; standard library plus the pinned dependencies. No ORM.
- The database is the interface. Prefer a new `ErdosDB` method over ad-hoc SQL.
- `problems_fts` is external-content with **no triggers**. Any write to
`problems` must be followed by `corpus.schema.rebuild_fts()` or search
silently returns stale results.
- Sources only write the fields they own, so a sync never clobbers scraped data.
- Nothing outside `corpus/erdos/` may assume the corpus is Erdős problems.
## Adding another problem corpus
The schema, SDK, CLI, API and MCP server are corpus-agnostic. To add one:
1. Implement a `Corpus` with a `CorpusMeta` and a list of `Source`s — copy
`corpus/erdos/` as a template.
2. Register it in `corpus/registry.py`.
3. `python -m corpus.sync --corpus <slug>`
No changes are needed downstream.
## Testing
There is no test suite yet. Verify changes by exercising the surfaces:
```bash
./erdos stats && ./erdos ai 42 && ./erdos frontier --prize
python -c "from fastapi.testclient import TestClient; from api.main import app; \
c=TestClient(app); c.__enter__(); print(c.get('/statistics').status_code)"
python mcp_server/server.py # then connect an MCP client
```
Run `python -m corpus.sync --dry-run` before committing sync changes.
## Do not
- Add scraping that circumvents erdosproblems.com's bot protection.
- Claim a problem is solved without following
`.claude/skills/erdos-solver/VERIFICATION.md`. Of 538 recorded AI
contributions, 19 are marked incorrect and 43 unverified.
- Commit `data/.sync-cache/` or `data/erdosproblems-repo/` (both gitignored).
## Attribution
Data from [erdosproblems.com](https://www.erdosproblems.com) (Thomas Bloom),
[teorth/erdosproblems](https://github.com/teorth/erdosproblems) (Terence Tao et
al.) and [formal-conjectures](https://github.com/google-deepmind/formal-conjectures)
(Google DeepMind). See `ATTRIBUTION.md`. Code is MIT.

Xet Storage Details

Size:
6.06 kB
·
Xet hash:
fb10ec862821b5750f827da5811af2635d470a34116a73baaf5c2236e87c7f1c

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.