KatalockAi AcademyBack to KatalockAi
Build track, required for the Phase 15 certificate

Build an autonomous research agent

Build a research loop that generates hypotheses, searches literature, runs sandboxed experiments, judges results with paired tests, schedules branches with UCB, critiques drafts and writes a LaTeX paper.

about 28 h 8 guided steps Reviewed against a 6-point rubric
Submit your project Get coached by Professor Katalock

Build it step by step

  1. 1Hypothesis GeneratorPhase 19: Capstone projects
  2. 2Literature RetrievalPhase 19: Capstone projects
  3. 3Experiment RunnerPhase 19: Capstone projects
  4. 4Result EvaluatorPhase 19: Capstone projects
  5. 5Paper WriterPhase 19: Capstone projects
  6. 6Critic LoopPhase 19: Capstone projects
  7. 7Iteration SchedulerPhase 19: Capstone projects
  8. 8End-to-End Research DemoPhase 19: Capstone projects

What You'll Build

A deterministic auto-research loop made of eight contract-first components: a hypothesis generator with a temperature ramp and novelty filter, a BM25 plus citation-graph literature retriever, a subprocess experiment runner, a statistical result evaluator, a skeleton-first paper writer, a structured critic loop, an asyncio UCB scheduler, and an end-to-end orchestrator that composes them. Unlike the lesson 57 demo, which stubs the first four stages, your end-to-end run uses your real generator, retriever, runner and evaluator on an experiment and a paper corpus you chose.

Requirements

  1. Hypothesis generator. A sampler (mock LLM by default) called over a temperature ramp (default six passes from 0.2 to 1.2), parsed into typed Hypothesis records (variables, metric, baseline_ref), filtered by a hashed bag-of-words cosine novelty threshold (default 0.25) and ranked by 0.4 * novelty + 0.3 * specificity + 0.3 * testability. Same seed, same queue.
  2. Literature retrieval. A corpus of at least 30 paper records on a topic you pick (real titles and abstracts you collected, or carefully written mock ones), BM25 from scratch (k1 1.5, b 0.75), BFS over the citation graph capped at 2 hops, dedup by id and the blended final_score with per-paper score fields.
  3. Experiment runner. An ExperimentSpec executed in a subprocess with a hard wall-clock timeout and a polled RSS memory cap, terminal states ok, timeout, oom, crash, the last JSON stdout line taken as metrics, one-knob ablations and a seed forwarded to the script. Write your own experiment script that does real numeric work (for example a numpy model whose accuracy or loss depends on a config knob) and show each terminal state at least once.
  4. Result evaluator. Direction-aware improvement, optional log scaling, a 2 percent threshold, a paired t-test written by hand (incomplete beta via continued fraction), seed pairing with PairingError, and the five-row verdict table (failed, noise, noise, improved, regressed). Test your t-test against one known reference value and say where it came from.
  5. Paper writer. A Paper skeleton with sections, figures and bib entries, the four validation gates, figures injected from experiment manifests, and an all-or-nothing write of paper.tex, references.bib and manifest.json.
  6. Critic loop. Scores on five dimensions (clarity, novelty, evidence, methodology, related work), structured suggestions applied by a reviser, and termination by target (every dimension at least 8.0), plateau (mean gain below 0.1 for two rounds) or budget (5 rounds), with a per-round trace.
  7. Scheduler. UCB1 with c = sqrt(2) and untried branches first, three asyncio slots, pruning below 0.2 mean reward after 3 runs, paper triggers at 0.7, an expander for follow-up hypotheses, and max_experiments and max_seconds budgets with a stop_reason.
  8. End-to-end. python main.py seeds the queue from your generator, filters with your retriever, runs your experiment through your runner, turns evaluator verdicts into scheduler rewards, picks the best branch, runs the critic loop and writes the paper. It emits one report, is deterministic (two runs give an identical manifest), and raises typed errors (NoTriggerError, PaperValidationError) instead of continuing on a broken input.

Constraints

  • Python standard library plus numpy; CPU only; the whole loop should finish in under a few minutes.
  • Mock LLM by default so the run is reproducible. A real model is optional through any OpenAI-compatible endpoint (the KatalockAi API, or a local model); if you use one, keep a --mock flag that the graded run uses.
  • Compiling the LaTeX with pdflatex is optional; the .tex, .bib and manifest are what get graded.
  • The subprocess runner is not a security sandbox. Only run experiment scripts you wrote.

Stretch Goals

  • Persist UCB statistics and stage outputs to JSON so a restarted loop resumes without rerunning cheap stages.
  • Swap the deterministic critic for a model-based critic that returns the same Critique shape.
  • Render the scheduler and critic traces as one timeline plot.

How to Submit

Public repo with research/ (generator, retrieval, runner, evaluator, writer, critic, scheduler), experiments/ (your script), corpus/ (your paper records), main.py, tests/ and results/ (demo report JSON, ablation table, paper output). The README must explain how to run the loop, what topic and experiment you chose and why, how an evaluator verdict becomes a scheduler reward, how determinism is guaranteed, and one case where a verdict was noise or failed and what that told you.

How It's Reviewed

Professor Katalock reads your repository and the evidence you paste, and scores each criterion out of 100. You pass with a weighted total of 70 or more and no criterion below 40. A copied or padded submission is flagged and fails.

CriterionWeightHow it's checked
End-to-end research loop25Pasted `python main.py` output shows real generator, retrieval, runner and evaluator stages feeding the scheduler, a picked branch, a critic trace and written paper files; a second run produces an identical manifest.
Component correctness and tests25Pytest passes with tests for novelty rejection, BM25 and graph hops, timeout and crash paths, the t-test reference value and pairing error, validation gates, plateau and budget exits, and UCB untried-first and pruning.
Experimental honesty15The learner's own experiment script does real computation, candidates and baselines are paired by seed, and the ablation table plus at least one non-improved verdict are shown.
Paper artifact10results/ holds paper.tex, references.bib and manifest.json where every cite key resolves and every figure has a stable label.
Code quality10Each stage is a separate module with typed dataclasses, composed by plain imports; no global state; mock and real LLM sit behind one interface.
README and reflection15README covers run steps, topic and experiment choice, reward mapping, determinism, and a reflection on a noise or failed verdict.

Submit

Push your work to a public GitHub repository with a README that explains how to run it, then paste the evidence below. Up to 3 reviews a day, free.

  • Full output of `python main.py`, including the scheduler stop_reason and the critic trace
  • Output of running the demo twice plus a diff (or hash comparison) of the two manifests
  • The ablation table and the verdict JSON for at least one hypothesis
  • The first 40 lines of the generated paper.tex
  • Output of `python -m pytest -q`
  • A short reflection on one verdict that was noise or failed

Reviews are done by AI against the rubric above. They check the evidence in your repository; they are not a substitute for a human code review, and a review can be wrong. If you think it is, improve the README so the evidence is unmistakable and resubmit.