A recursive ML research agent with a Streamlit UI. Enter a research direction and the agent autonomously loops through literature review → experiment design → code generation → evaluation until stopping criteria are met. All knowledge is written to a Cortex memory graph that can be exported for a marketplace.
cd recursive-research
pip3 install -r requirements.txt
streamlit run app.pyUses litellm for multi-provider support:
| Provider | Model Example | API Key Env Var |
|---|---|---|
| Google Gemini | gemini/gemini-2.0-flash |
GEMINI_API_KEY |
| Anthropic | claude-sonnet-4-20250514 |
ANTHROPIC_API_KEY |
| OpenAI | gpt-4o |
OPENAI_API_KEY |
Per iteration: 2 LLM calls (Literature + Experimenter) and 2 Python functions (Evaluator + Decision). Mock compute returns fake metrics on a diminishing-returns curve — no GPU needed.
recursive-research/
├── app.py # Streamlit dashboard
├── research_loop.py # Main orchestration loop
├── agents/
│ ├── __init__.py # Package init
│ ├── literature.py # Semantic Scholar/arXiv API + LLM synthesis
│ └── experimenter.py # Hypothesis + code generation prompt
├── evaluator.py # Pure Python metric comparison
├── decision.py # Continue/pivot/stop logic
├── cortex_client.py # Cortex SDK + HTTP fallback
├── mock_compute.py # Fake metrics with diminishing returns
├── db.py # SQLite for sessions + messages
├── baseline_train.py # Starting GPT training script
├── utils.py # JSON parsing helpers
└── requirements.txt
The app works without Cortex (prints warnings but won't crash).
# Docker
docker run -d -p 9090:9090 -p 9091:9091 mikesquared/cortex:latest
pip3 install cortex-memoryMIT