# primeintellect-ai/lab-cookbook architecture

> Architecture diagram of the GitHub repository primeintellect-ai/lab-cookbook, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/primeintellect-ai/lab-cookbook
- Repository: https://github.com/primeintellect-ai/lab-cookbook

## Overview

Lab Cookbook is a workspace of learning guides, runnable configurations, and local agent environments for Prime Intellect Lab. Its principal user journey is to follow a guide, select an environment and configuration, then evaluate or train an agent; prompt optimization and deployment are additional documented capabilities. The graph includes representative environment modules and specialized search, coding, and multimodal examples. README statements support the workspace and capability links; sampled source confirms selected tool and task implementations, but not a single shared runtime orchestrator.

Main entry points: [`guides`](https://github.com/primeintellect-ai/lab-cookbook/tree/main/guides) (Cookbook Guides), [`configs`](https://github.com/primeintellect-ai/lab-cookbook/tree/main/configs) (Eval Configs), [`environments/calendar_scheduling/calendar_problem.py`](https://github.com/primeintellect-ai/lab-cookbook/blob/main/environments/calendar_scheduling/calendar_problem.py) (Calendar Problem), [`configs/gepa`](https://github.com/primeintellect-ai/lab-cookbook/tree/main/configs/gepa) (GEPA Configs)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_learning["Learning Guides"]
  node_guides["Cookbook Guides"]
end

subgraph group_configuration["Run Configurations"]
  node_eval_configs["Eval Configs"]
  node_gepa_configs["GEPA Configs"]
  node_rl_configs["RL Configs"]
end

subgraph group_environments["Agent Environments"]
  node_reverse_text["Reverse Text<br/>[reverse_text.py]"]
  node_wordle["Wordle<br/>[wordle.py]"]
  node_shape_detective["Shape Detective<br/>[shape_detective.py]"]
  node_calendar_task["Calendar Problem"]
  node_calendar_env["Calendar Tools"]
  node_calendar_tui["Calendar TUI"]
  node_math_python["Python Math<br/>[math_python.py]"]
  node_gsm8k["GSM8K<br/>[gsm8k.py]"]
  node_ethics["Ethics Debate<br/>[ethics_debate.py]"]
  node_simple_judge["Simple Judge<br/>[simple_judge.py]"]
end

subgraph group_search["Search Environments"]
  node_wiki_search["Wiki Search<br/>[wiki_search.py]"]
  node_patent_basic["Patent Q&amp;A"]
  node_patent_advanced["Advanced Patent Q&amp;A"]
  node_patent_analysis["Patent Analysis"]
  node_wikispeedia_env["Wikispeedia Agent"]
  node_wiki_graph[("Wiki Graph<br/>[wiki_graph.py]")]
  node_deep_agents["Deep Agents"]
end

subgraph group_specialized["Specialized Environments"]
  node_swe_grep["Code Search<br/>[swe_grep.py]"]
  node_opencode["Coding Agent<br/>[opencode_harbor.py]"]
end

node_user(("Lab User"))
node_agent(("Agent"))
node_lab(("Prime Intellect Lab"))

node_user -->|"follows"| node_guides
node_guides -->|"uses recipes"| node_eval_configs
node_guides -->|"builds environments"| node_reverse_text
node_guides -->|"teaches evaluating"| node_agent
node_guides -->|"teaches training"| node_agent
node_guides -->|"teaches optimizing"| node_agent
node_guides -->|"covers deployment"| node_lab
node_eval_configs -->|"evaluates"| node_agent
node_gepa_configs -->|"optimizes prompts"| node_agent
node_rl_configs -->|"trains"| node_agent
node_calendar_env -->|"uses task model"| node_calendar_task
node_calendar_tui -.->|"renders task"| node_calendar_task
node_wikispeedia_env -->|"loads graph"| node_wiki_graph

click node_guides "https://github.com/primeintellect-ai/lab-cookbook/tree/main/guides"
click node_eval_configs "https://github.com/primeintellect-ai/lab-cookbook/tree/main/configs"
click node_gepa_configs "https://github.com/primeintellect-ai/lab-cookbook/tree/main/configs/gepa"
click node_rl_configs "https://github.com/primeintellect-ai/lab-cookbook/tree/main/configs/rl"
click node_reverse_text "https://github.com/primeintellect-ai/lab-cookbook/blob/main/environments/reverse_text/reverse_text.py"
click node_wordle "https://github.com/primeintellect-ai/lab-cookbook/blob/main/environments/wordle/wordle.py"
click node_shape_detective "https://github.com/primeintellect-ai/lab-cookbook/blob/main/environments/shape_detective/shape_detective.py"
click node_calendar_task "https://github.com/primeintellect-ai/lab-cookbook/blob/main/environments/calendar_scheduling/calendar_problem.py"
click node_calendar_env "https://github.com/primeintellect-ai/lab-cookbook/blob/main/environments/calendar_scheduling/calendar_scheduling.py"
click node_calendar_tui "https://github.com/primeintellect-ai/lab-cookbook/blob/main/environments/calendar_scheduling/calendar_scheduling_tui.py"
click node_math_python "https://github.com/primeintellect-ai/lab-cookbook/blob/main/environments/math_python/math_python.py"
click node_gsm8k "https://github.com/primeintellect-ai/lab-cookbook/blob/main/environments/gsm8k/gsm8k.py"
click node_ethics "https://github.com/primeintellect-ai/lab-cookbook/blob/main/environments/ethics_debate/ethics_debate.py"
click node_simple_judge "https://github.com/primeintellect-ai/lab-cookbook/blob/main/environments/simple_judge/simple_judge.py"
click node_wiki_search "https://github.com/primeintellect-ai/lab-cookbook/blob/main/environments/wiki_search/wiki_search.py"
click node_patent_basic "https://github.com/primeintellect-ai/lab-cookbook/blob/main/environments/patent_search/basic_patent_q_and_a/basic_patent_q_and_a.py"
click node_patent_advanced "https://github.com/primeintellect-ai/lab-cookbook/blob/main/environments/patent_search/advanced_patent_q_and_a/advanced_patent_q_and_a.py"
click node_patent_analysis "https://github.com/primeintellect-ai/lab-cookbook/blob/main/environments/patent_search/patent_technical_analysis/patent_technical_analysis.py"
click node_wikispeedia_env "https://github.com/primeintellect-ai/lab-cookbook/blob/main/environments/langchain_deep_agents_wikispeedia/langchain_deep_agents_wikispeedia.py"
click node_wiki_graph "https://github.com/primeintellect-ai/lab-cookbook/blob/main/environments/langchain_deep_agents_wikispeedia/wiki_graph.py"
click node_deep_agents "https://github.com/primeintellect-ai/lab-cookbook/blob/main/environments/langchain_deep_agents/langchain_deep_agents.py"
click node_swe_grep "https://github.com/primeintellect-ai/lab-cookbook/blob/main/environments/swe_grep/swe_grep.py"
click node_opencode "https://github.com/primeintellect-ai/lab-cookbook/blob/main/environments/opencode_harbor/opencode_harbor.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_guides,node_user toneBlue
class node_eval_configs,node_gepa_configs,node_rl_configs toneAmber
class node_reverse_text,node_wordle,node_shape_detective,node_calendar_task,node_calendar_env,node_calendar_tui,node_math_python,node_gsm8k,node_ethics,node_simple_judge toneMint
class node_wiki_search,node_patent_basic,node_patent_advanced,node_patent_analysis,node_wikispeedia_env,node_wiki_graph,node_deep_agents toneRose
class node_swe_grep,node_opencode,node_agent,node_lab toneIndigo
```

## Components

### Learning Guides

- [Cookbook Guides](https://github.com/primeintellect-ai/lab-cookbook/tree/main/guides): `guides`

### Run Configurations

- [Eval Configs](https://github.com/primeintellect-ai/lab-cookbook/tree/main/configs): `configs`
- [GEPA Configs](https://github.com/primeintellect-ai/lab-cookbook/tree/main/configs/gepa): `configs/gepa`
- [RL Configs](https://github.com/primeintellect-ai/lab-cookbook/tree/main/configs/rl): `configs/rl`

### Agent Environments

- [Reverse Text](https://github.com/primeintellect-ai/lab-cookbook/blob/main/environments/reverse_text/reverse_text.py): `environments/reverse_text/reverse_text.py`
- [Wordle](https://github.com/primeintellect-ai/lab-cookbook/blob/main/environments/wordle/wordle.py): `environments/wordle/wordle.py`
- [Shape Detective](https://github.com/primeintellect-ai/lab-cookbook/blob/main/environments/shape_detective/shape_detective.py): `environments/shape_detective/shape_detective.py`
- [Calendar Problem](https://github.com/primeintellect-ai/lab-cookbook/blob/main/environments/calendar_scheduling/calendar_problem.py): `environments/calendar_scheduling/calendar_problem.py`
- [Calendar Tools](https://github.com/primeintellect-ai/lab-cookbook/blob/main/environments/calendar_scheduling/calendar_scheduling.py): `environments/calendar_scheduling/calendar_scheduling.py`
- [Calendar TUI](https://github.com/primeintellect-ai/lab-cookbook/blob/main/environments/calendar_scheduling/calendar_scheduling_tui.py): `environments/calendar_scheduling/calendar_scheduling_tui.py`
- [Python Math](https://github.com/primeintellect-ai/lab-cookbook/blob/main/environments/math_python/math_python.py): `environments/math_python/math_python.py`
- [GSM8K](https://github.com/primeintellect-ai/lab-cookbook/blob/main/environments/gsm8k/gsm8k.py): `environments/gsm8k/gsm8k.py`
- [Ethics Debate](https://github.com/primeintellect-ai/lab-cookbook/blob/main/environments/ethics_debate/ethics_debate.py): `environments/ethics_debate/ethics_debate.py`
- [Simple Judge](https://github.com/primeintellect-ai/lab-cookbook/blob/main/environments/simple_judge/simple_judge.py): `environments/simple_judge/simple_judge.py`

### Search Environments

- [Wiki Search](https://github.com/primeintellect-ai/lab-cookbook/blob/main/environments/wiki_search/wiki_search.py): `environments/wiki_search/wiki_search.py`
- [Patent Q&A](https://github.com/primeintellect-ai/lab-cookbook/blob/main/environments/patent_search/basic_patent_q_and_a/basic_patent_q_and_a.py): `environments/patent_search/basic_patent_q_and_a/basic_patent_q_and_a.py`
- [Advanced Patent Q&A](https://github.com/primeintellect-ai/lab-cookbook/blob/main/environments/patent_search/advanced_patent_q_and_a/advanced_patent_q_and_a.py): `environments/patent_search/advanced_patent_q_and_a/advanced_patent_q_and_a.py`
- [Patent Analysis](https://github.com/primeintellect-ai/lab-cookbook/blob/main/environments/patent_search/patent_technical_analysis/patent_technical_analysis.py): `environments/patent_search/patent_technical_analysis/patent_technical_analysis.py`
- [Wikispeedia Agent](https://github.com/primeintellect-ai/lab-cookbook/blob/main/environments/langchain_deep_agents_wikispeedia/langchain_deep_agents_wikispeedia.py): `environments/langchain_deep_agents_wikispeedia/langchain_deep_agents_wikispeedia.py`
- [Wiki Graph](https://github.com/primeintellect-ai/lab-cookbook/blob/main/environments/langchain_deep_agents_wikispeedia/wiki_graph.py): `environments/langchain_deep_agents_wikispeedia/wiki_graph.py`
- [Deep Agents](https://github.com/primeintellect-ai/lab-cookbook/blob/main/environments/langchain_deep_agents/langchain_deep_agents.py): `environments/langchain_deep_agents/langchain_deep_agents.py`

### Specialized Environments

- [Code Search](https://github.com/primeintellect-ai/lab-cookbook/blob/main/environments/swe_grep/swe_grep.py): `environments/swe_grep/swe_grep.py`
- [Coding Agent](https://github.com/primeintellect-ai/lab-cookbook/blob/main/environments/opencode_harbor/opencode_harbor.py): `environments/opencode_harbor/opencode_harbor.py`

### Other components

- **Lab User**
- **Agent**
- **Prime Intellect Lab**

## Connections

- Lab User → Cookbook Guides: follows (evidence: `README.md`)
- Cookbook Guides → Eval Configs: uses recipes (evidence: `README.md`)
- Cookbook Guides → Reverse Text: builds environments (evidence: `README.md`)
- Cookbook Guides → Agent: teaches evaluating (evidence: `README.md`)
- Cookbook Guides → Agent: teaches training (evidence: `README.md`)
- Cookbook Guides → Agent: teaches optimizing (evidence: `README.md`)
- Cookbook Guides → Prime Intellect Lab: covers deployment (evidence: `README.md`)
- Eval Configs → Agent: evaluates (evidence: `README.md`)
- GEPA Configs → Agent: optimizes prompts (evidence: `README.md`)
- RL Configs → Agent: trains (evidence: `README.md`)
- Calendar Tools → Calendar Problem: uses task model (evidence: `environments/calendar_scheduling/calendar_scheduling.py`)
- Calendar TUI → Calendar Problem: renders task (evidence: `environments/calendar_scheduling/calendar_scheduling_tui.py`)
- Wikispeedia Agent → Wiki Graph: loads graph (evidence: `environments/langchain_deep_agents_wikispeedia/langchain_deep_agents_wikispeedia.py`)
